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: enable list of paths for read_csv #824

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

mesejo
Copy link
Contributor

@mesejo mesejo commented Aug 19, 2024

Which issue does this PR close?

N/A

Rationale for this change

Enable users to supply a list of csv file paths to the read_csv function, inspired by this issue: ibis-project/ibis#9866.

What changes are included in this PR?

Changes to the read_csv function in Rust and the corresponding signature types in Python

Are there any user-facing changes?

Yes

Copy link
Contributor

@timsaucer timsaucer left a comment

Choose a reason for hiding this comment

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

Overall looks like a nice addition.

@@ -833,13 +829,16 @@ impl PySessionContext {
.file_extension(file_extension)
.table_partition_cols(convert_table_partition_cols(table_partition_cols)?)
.file_compression_type(parse_file_compression_type(file_compression_type)?);
options.schema = schema.as_ref().map(|x| &x.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this line for?

Copy link
Contributor Author

@mesejo mesejo Aug 20, 2024

Choose a reason for hiding this comment

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

This line sets the options.schema; it is equivalent to the lines (that were deleted),

if let Some(py_schema) = schema {
    options.schema = Some(&py_schema.0);

I chose to do it this way to remove a nested conditional since the type must be checked to support list and string.

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

Thanks @mesejo and @timsaucer

@andygrove andygrove merged commit 805183b into apache:main Aug 22, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants