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(python): Parse uppercase config keys #19852

Conversation

ion-elgreco
Copy link
Contributor

@ion-elgreco ion-elgreco commented Nov 18, 2024

In delta-rs we also parse config keys that are uppercase, this provides more flexibility and allows people to use same storage options for delta-rs and pola-rs.

Additionally instead of raising for non existing config keys, we just filter them out. This would make it easier to keep engine specific keys in the storage options in python, since delta-rs has some of those to handle mounted storage.

@ion-elgreco ion-elgreco changed the title fix(rust, python): parse uppercase config keys fix(python,rust): parse uppercase config keys Nov 18, 2024
@ion-elgreco ion-elgreco changed the title fix(python,rust): parse uppercase config keys fix(python): parse uppercase config keys Nov 18, 2024
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.46%. Comparing base (da38e37) to head (6ec5f32).
Report is 48 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19852      +/-   ##
==========================================
+ Coverage   79.33%   79.46%   +0.13%     
==========================================
  Files        1548     1555       +7     
  Lines      214247   216315    +2068     
  Branches     2460     2456       -4     
==========================================
+ Hits       169971   171905    +1934     
- Misses      43718    43852     +134     
  Partials      558      558              

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


🚨 Try these New Features:

@ion-elgreco ion-elgreco changed the title fix(python): parse uppercase config keys fix(python): Parse uppercase config keys Nov 18, 2024
@github-actions github-actions bot added fix Bug fix python Related to Python Polars and removed title needs formatting labels Nov 18, 2024
@ritchie46
Copy link
Member

Thanks @ion-elgreco. Can you add a test as well?

@ion-elgreco
Copy link
Contributor Author

@ritchie46 sure, Ill take a look Sunday.

Are there existing integration tests with any object storage?

@ritchie46
Copy link
Member

I think implicitly in python by forcing async.

@ritchie46
Copy link
Member

We can also add a simple rust unit test with a comment on why that is tested. E.g. test parsing an uppercase config.

@ion-elgreco
Copy link
Contributor Author

We can also add a simple rust unit test with a comment on why that is tested. E.g. test parsing an uppercase config.

Sure will do that, don't have time until Sunday for it tho

.map_err(
|_| polars_err!(ComputeError: "unknown configuration key: {}", key.as_ref()),
)
.filter_map(|(key, val)| {
Copy link
Member

@ritchie46 ritchie46 Nov 24, 2024

Choose a reason for hiding this comment

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

Now invalid keys are silently ignored? That doesn't seem right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am doing it explicitly. In delta-rs for example we use quite some custom storage_options for our internal log/objectstore handling.

So when you do a read_delta and you pass those additional options from your DeltaTable object into pola-rs, it will error out, see this comment #19103 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Right, can you add a comment that some keys are read upstream and may silently be ignored there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Donee

@ritchie46
Copy link
Member

Thank you @ion-elgreco.

@ritchie46 ritchie46 merged commit 3fad074 into pola-rs:main Nov 24, 2024
20 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scan_delta parameters are now lowercase since 1.14.0 for S3
2 participants