-
Notifications
You must be signed in to change notification settings - Fork 89
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
refactor: replace 3 ak.from_json* functions with one #1617
Merged
jpivarski
merged 10 commits into
main
from
jpivarski/get-to_json-from_json-straightened-out
Aug 23, 2022
Merged
refactor: replace 3 ak.from_json* functions with one #1617
jpivarski
merged 10 commits into
main
from
jpivarski/get-to_json-from_json-straightened-out
Aug 23, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
|
Finally closes #192! |
One thing I forgot: it's still missing documentation. (Not this PR.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unifying
ak.from_json
(in-memory),ak.from_json_file
, andak.from_json_schema
.ak.to_json
is up-to-dateak_from_json_new
was actually finished way back in MayAll of the
from_json
cases go to RapidJSON for the parsing and are incremental in the JSON parsed (doesn't load a big string into memory, though it may result in a big ak.Array). For line-delimited JSON, aline_delimited=True
argument is now necessary. Passing a file name now requires apathlib.Path
, rather than a barestr
(which could be JSON text). All file/non-file cases are wrapped as a Python file-like object for reading in RapidJSON, which releases the GIL at all times except when reading from that file-like object.Technically, the "refactor" commit type might not be correct because this PR is changing the API, but it's more than just adding a "feature" and it's not a "fix".
The new implementations were mostly copied from the following files, now deleted:
The last file, in turn, was developed before it as moved; the original location was: