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

GH-14932: [Python] Add python bindings for JSON streaming reader #45084

Merged
merged 7 commits into from
Feb 6, 2025

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

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 ?

python/pyarrow/_json.pyx Outdated Show resolved Hide resolved
python/pyarrow/_json.pyx Show resolved Hide resolved
python/pyarrow/_json.pyx Outdated Show resolved Hide resolved
python/pyarrow/tests/test_json.py Outdated Show resolved Hide resolved
python/pyarrow/tests/test_json.py Outdated Show resolved Hide resolved
python/pyarrow/tests/test_json.py Outdated Show resolved Hide resolved
@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.

docs/source/python/json.rst Outdated Show resolved Hide resolved
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
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