-
Couldn't load subscription status.
- Fork 537
feat(storage): expand user with tilde in local path #3717
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(storage): expand user with tilde in local path #3717
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for expanding the ~ (tilde) character to the user's home directory in local paths for DeltaTable storage operations. This enhancement allows users to use paths like ~/my_delta_table which will be automatically expanded to the full home directory path.
- Introduces a new
expand_tilde_pathutility function that handles tilde expansion - Updates path resolution logic to call tilde expansion before creating local paths
- Adds comprehensive unit tests for the new functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/core/Cargo.toml | Adds dirs crate dependency for home directory detection |
| crates/core/src/table/builder.rs | Implements tilde expansion logic and integrates it into path resolution |
| python/tests/test_writer.py | Adds integration test to verify tilde paths work with Delta table writes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3717 +/- ##
=======================================
Coverage 75.33% 75.34%
=======================================
Files 145 145
Lines 43751 43811 +60
Branches 43751 43811 +60
=======================================
+ Hits 32961 33010 +49
- Misses 9195 9202 +7
- Partials 1595 1599 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I was worried us poor windows users would have been left out here, but turns out the dirs crate handles it! :) |
7a75ff1 to
32b43c1
Compare
python/tests/test_writer.py
Outdated
| try: | ||
| df.write_delta(tilde_path) | ||
| dt = DeltaTable(tilde_path) | ||
| assert dt.to_pandas().equals(df.to_pandas()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the Polars.testing module here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes, it would be better only to use @pytest.mark.polars. Thanks!
72dae84 to
f9f4a0e
Compare
Signed-off-by: Florian Valeye <[email protected]>
f9f4a0e to
d2cfef7
Compare
Description
Support expanding
~in local paths for DeltaTable storage.Related Issue(s)
Documentation