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

feat: Include file path option for NDJSON #17681

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Jul 17, 2024

ref #10481

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Jul 17, 2024
@@ -40,6 +40,18 @@ impl JsonExec {

let mut n_rows = self.file_scan_options.n_rows;

// Avoid panicking
if n_rows == Some(0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by - fix panic on scan_ndjson().head(0)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a test below

FileScan::Csv { .. } => true,
#[cfg(feature = "json")]
FileScan::NDJson { .. } => true,
FileScan::Anonymous { .. } => false,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure the lazy schema is correct

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.64%. Comparing base (4b7e2bd) to head (8b292c9).
Report is 2 commits behind head on main.

Files Patch % Lines
...tes/polars-mem-engine/src/executors/scan/ndjson.rs 95.00% 1 Missing ⚠️
...ates/polars-plan/src/plans/conversion/dsl_to_ir.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17681      +/-   ##
==========================================
- Coverage   80.67%   80.64%   -0.03%     
==========================================
  Files        1490     1490              
  Lines      195931   196029      +98     
  Branches     2789     2789              
==========================================
+ Hits       158059   158087      +28     
- Misses      37359    37429      +70     
  Partials      513      513              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit 93dedd8 into pola-rs:main Jul 17, 2024
27 checks passed
@nameexhaustion nameexhaustion deleted the file-path-ndjson branch July 19, 2024 12:21
@c-peters c-peters added the accepted Ready for implementation label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants