-
Notifications
You must be signed in to change notification settings - Fork 73
Parsing improvements #874
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
Merged
Merged
Parsing improvements #874
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0ca3883
small logic rewrite for `tryParseImpl` and added kdocs. StringParsers…
Jolanrensen 95b9df6
added "canParse" functions for Kotlin/Java duration to avoid exceptio…
Jolanrensen abe03dc
added toInstantOrNull functions avoiding exceptions when parsing
Jolanrensen e0c4de7
adding tests to ensure consistency between duration and instant parsing
Jolanrensen af19cfd
creating low-in-exceptions DateTimeFormatter.parseOrNull function for…
Jolanrensen e3dfcfd
small json parsing fix
Jolanrensen bee6c2f
cleaning up
Jolanrensen fcfac95
adding contracts to `AnyCol.isX` functions
Jolanrensen de81ab6
enabling column-parallel parsing with coroutines
Jolanrensen bd178e3
Merge branch 'master' into parsing-optimization
Jolanrensen 219ddff
Merge branch 'master' into parsing-optimization
Jolanrensen 7b9c86b
fixup! enabling column-parallel parsing with coroutines
Jolanrensen 5057eeb
tiny logic change so we take all parsers and not just the parserMap (…
Jolanrensen 72c8a17
copied some kdoc to denote the difference between DataColumn.tryParse…
Jolanrensen 2a90396
removing parallelization from parse for now
Jolanrensen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
335 changes: 249 additions & 86 deletions
335
core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we ask stdlib for a non-throwing parsing function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, my bad, it's from Java, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in any case, i want to understand better what copy-pasted parts are needed
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for kotlin Instants, we've got
parseOrNull
, a non-throwing parsing function :) For Java I managed to make my ownparseOrNull
.I copied over a lot of tests from kotlinx-datetime such that we can catch functional changes when we update java/kotlinx-datetime versions.
The biggest thing I copied was regarding Kotlin Duration. It would be great if we could have a non-throwing
Duration.parseOrNull
in the stdlib. I solved this by creating a functionDuration.canParse
which contains copied logic but returnsfalse
instead of throwing an exception. For this I also put plenty of tests in place to catch functional changes if we bump Kotlin versoin.