Skip to content

to_json Compression doesnt work #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kylepierce opened this issue Sep 29, 2020 · 5 comments
Closed

to_json Compression doesnt work #412

kylepierce opened this issue Sep 29, 2020 · 5 comments
Assignees
Labels
feature minor release Will be addressed in the next minor release ready to release
Milestone

Comments

@kylepierce
Copy link

Describe the bug
Tested all of the compression types for json and none of them actually changed the file size.

To Reproduce
wr.s3.to_json( path='s3://{bucket}/file.bz2', df=df, compression='bz2', orient="records", lines=True, date_format='iso' )

I'll keep testing with different orient but it doesnt seem to pass the compressions along.

@kylepierce kylepierce added the bug Something isn't working label Sep 29, 2020
@igorborgest
Copy link
Contributor

Hi @kylepierce, thanks for reporting it.

Seems it is something inherited from Pandas.

We will investigate it.

@kylepierce
Copy link
Author

Thanks for your reply. I switched from the pandas s3fs to aws wrangler because pd.to_json wasnt saving to s3.

The compression function seems to be broken on when you try to use the "lines" flag. I am reading from a sql database and want to save the output to s3 as a json line delimited. Maybe there is a better way to do this.

@igorborgest igorborgest added the blocked Something is blocking the development label Oct 6, 2020
@igorborgest
Copy link
Contributor

Blocked by Pandas issue.

@igorborgest
Copy link
Contributor

Hi @kylepierce

Pandas 1.2.0 is available so we added support to it in the PR above 👆 .
Could you give it a try before the official release? You can install that directly from the dev branch:

pip install git+https://github.com/awslabs/aws-data-wrangler.git@write-compressed-text

@igorborgest igorborgest self-assigned this Jan 4, 2021
@igorborgest igorborgest added feature minor release Will be addressed in the next minor release ready to release and removed blocked Something is blocking the development bug Something isn't working labels Jan 4, 2021
@igorborgest igorborgest added this to the 2.3.0 milestone Jan 4, 2021
@igorborgest
Copy link
Contributor

Released on version 2.3.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature minor release Will be addressed in the next minor release ready to release
Projects
None yet
Development

No branches or pull requests

2 participants