In PyArrow 20.0.0+, when using open_json to read data in batches, an …#942
In PyArrow 20.0.0+, when using open_json to read data in batches, an …#942HunterLine wants to merge 9 commits intodatajuicer:mainfrom
Conversation
…error may occur if a single record is too large
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical data loading issue in PyArrow versions 20.0.0 and above, specifically when processing large JSON records that exceed the default block size. By introducing configurable Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue with reading large JSON records in PyArrow by allowing read_options to be passed to increase the block size. The changes are logical and include a new test case to verify the fix. My review includes a few suggestions to improve code style and maintainability, such as using .get() for dictionary access, replacing os.system with a safer alternative, and using named constants for magic numbers in tests.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Could we expose |
…om/HunterLine/data-juicer into fix/pyarrow-open-json-large-record
HunterLine
left a comment
There was a problem hiding this comment.
feat(config): add read_options config item
Add read_options parameter to the base argument parser in config.py.
This allows passing custom read options (e.g. block_size) to PyArrow
reading functions, taking advantage of improved performance when
loading large JSON files.
…om/HunterLine/data-juicer into fix/pyarrow-open-json-large-record
…om/HunterLine/data-juicer into fix/pyarrow-open-json-large-record
fd7f4dc to
5293c05
Compare
In PyArrow 20.0.0+, when using open_json to read data in batches, an error may occur if a single record is too large:
Underlying PyArrow Error: straddling object straddles two block boundaries (try to increase block size?)
This PR fixes an issue in DataJuicer related to this behavior.