Skip to content

Conversation

@pan-x-c
Copy link
Contributor

@pan-x-c pan-x-c commented Dec 20, 2024

Rationale for this change

The C++ arrow has a JSON streaming reader which is not exposed on the Python interface.

What changes are included in this PR?

This PR is based on #33761. It adds the open_json method to open a streaming reader for a JSON file.

Are these changes tested?

Yes

Are there any user-facing changes?

Yes. A new open_json method has been added to the Python interface, located at pyarrow.json.open_json, and its parameters are the same as the pyarrow.json.read_json

@github-actions
Copy link

⚠️ GitHub issue #14932 has been automatically assigned in GitHub to PR creator.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

This looks mostly excellent @pan-x-c , thank you.

Here are a couple minor comments.

Also, could you add the new API to the docs in https://github.com/apache/arrow/blob/main/docs/source/python/api/formats.rst#json-files and perhaps mention it in https://github.com/apache/arrow/blob/main/docs/source/python/json.rst ?

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Feb 5, 2025
@pan-x-c
Copy link
Contributor Author

pan-x-c commented Feb 6, 2025

I have fixed the above comments and some similar issues in the csv module. I also added a brief introduction to open_json based on the doc of open_csv.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the update, one comment remaining below.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution @pan-x-c ! This looks good to me now, I will merge if CI is green.

@pitrou pitrou merged commit 16c7f1a into apache:main Feb 6, 2025
16 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Feb 6, 2025
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 16c7f1a.

There were 8 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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.

3 participants