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

fix: Fix duplicate column output and panic for include_file_paths #18255

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Aug 18, 2024

Fixes #18219 (comment)

Also fixes a panic for batched CSV and Parquet (fixes #18257)

py-polars/tests/unit/io/test_scan.py ..thread '<unnamed>' panicked at crates/polars-core/src/chunked_array/mod.rs:643:9:
index: 10 out of bounds for len: 1

@nameexhaustion nameexhaustion changed the title fix: Duplicate column output for parquet include_file_paths fix: Fix duplicate column output for parquet include_file_paths Aug 18, 2024
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Aug 18, 2024
@@ -461,7 +461,7 @@ pub trait ChunkFilter<T: PolarsDataType> {
/// Create a new ChunkedArray filled with values at that index.
pub trait ChunkExpandAtIndex<T: PolarsDataType> {
/// Create a new ChunkedArray filled with values at that index.
fn new_from_index(&self, length: usize, index: usize) -> ChunkedArray<T>;
fn new_from_index(&self, index: usize, length: usize) -> ChunkedArray<T>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

index and length were flipped on the trait definition

self
#[cfg(debug_assertions)]
{
return self.with_column(column).unwrap();
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 - enable checks here in debug mode to prevent similar mistakes

@@ -210,20 +209,6 @@ impl ParquetExec {
)?
.finish()?;

if let Some(col) = &self.file_options.include_file_paths {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was duplicate from a very old implementation approach that didn't push include_file_paths into the actual reader.

Copy link

codecov bot commented Aug 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.24%. Comparing base (1dc2533) to head (1425737).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18255   +/-   ##
=======================================
  Coverage   80.23%   80.24%           
=======================================
  Files        1500     1500           
  Lines      198889   198882    -7     
  Branches     2837     2837           
=======================================
+ Hits       159573   159585   +12     
+ Misses      38789    38770   -19     
  Partials      527      527           

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

@nameexhaustion nameexhaustion marked this pull request as ready for review August 18, 2024 12:20
@nameexhaustion nameexhaustion changed the title fix: Fix duplicate column output for parquet include_file_paths fix: Fix duplicate column output and panic for include_file_paths Aug 19, 2024
@ritchie46 ritchie46 merged commit 8a46700 into pola-rs:main Aug 19, 2024
30 checks passed
@nameexhaustion nameexhaustion deleted the include-file-paths branch August 29, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
2 participants