Rewrite intake stage from WDL to Python Polars#49
Merged
Conversation
Switching to these made it memory friendly: - `pl.concat(... how="horizontal")` instead of `.join` - `.collect(engine="streaming")` insead of just `.collect()` Also added another check for the merging of main <> freetext files. NOTE: Polars is better than DuckDB for this since it assigns line numbers in a deterministic way (only polars guarantees this, not the case with DuckDB).
Prerequisite in order to have the polars implementation pull the config shared with the other import packages.
GitHub: fixes #50
Known differences: - Behavior change: Newline inside values are now replaced by the Unicode character `` (U+2424), instead of replacing by a space character ` `. - Bug fix: Values within quoted TSV fields are now correctly preserved, whereas the previous implementation added extra quotes. - Bug fix: Tab characters inside quoted TSV values are now correctly preserved, whereas the previous implementation treated them as field separator resulting in shifted values.
This is to prevent any naive TSV parsing from being tripped up.
e4ae095 to
7d9b7cd
Compare
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
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.
TODO
Encapsulate the intake stages into a mini WDL script?Out of scope for this PR.
intake.assembleandintake.tidyupstagesawk.Diff:
ROW_IDis now_rowid_rowid_sourcecolumn to have end-to-end data tracingDiff:
(U+2424), instead of replacing by a space character.