Skip to content
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

Feat: better support for JSON i/o #2222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JovanVeljanoski
Copy link
Member

This PR does:

  • Implement new vaex.from_json_arrow method that is significantly faster way of reading JSON records
  • df.export_json() now accepts "backend" and "lines" arguments.
  • Unit-test that tests all of the above features
  • Review

To-Do (to be handled in a separate PR):

  • update the documentation to mention the new features and exposed options.

Copy link
Member

@maartenbreddels maartenbreddels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool work, just some small code comments

packages/vaex-core/vaex/dataframe.py Outdated Show resolved Hide resolved
packages/vaex-core/vaex/dataframe.py Outdated Show resolved Hide resolved
packages/vaex-core/vaex/dataframe.py Outdated Show resolved Hide resolved
Comment on lines 7073 to 7075
if lines:
if not first:
raw = raw.replace('},', '}\n')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will probably go wrong when having nested data (which will contain }), or string data containing a }.
what about just wring a \n separately? although I see we already do it at line 7077? so two newlines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want the from_json_arrow to work, i can't get it to work otherwise.. it requires that each json record is on a new line, and cant end with a trailing comma. I do understand your concerns tho..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants