Skip to content

Conversation

@fvaleye
Copy link
Collaborator

@fvaleye fvaleye commented Aug 29, 2025

Description

Support expanding ~ in local paths for DeltaTable storage.

Related Issue(s)

Documentation

Copilot AI review requested due to automatic review settings August 29, 2025 15:00
@fvaleye fvaleye added the binding/rust Issues for the Rust crate label Aug 29, 2025
@github-actions github-actions bot added the binding/python Issues for the Python package label Aug 29, 2025
Copy link
Contributor

Copilot AI left a 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_path utility 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
Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 80.95238% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.34%. Comparing base (21bb954) to head (77899ae).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/table/builder.rs 80.95% 8 Missing and 4 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hntd187
Copy link
Collaborator

hntd187 commented Aug 29, 2025

I was worried us poor windows users would have been left out here, but turns out the dirs crate handles it! :)

@fvaleye fvaleye force-pushed the feature/expanduser-with-tilde-in-local-path branch 5 times, most recently from 7a75ff1 to 32b43c1 Compare August 29, 2025 15:45
try:
df.write_delta(tilde_path)
dt = DeltaTable(tilde_path)
assert dt.to_pandas().equals(df.to_pandas())
Copy link
Collaborator

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

Copy link
Collaborator Author

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!

@fvaleye fvaleye force-pushed the feature/expanduser-with-tilde-in-local-path branch 2 times, most recently from 72dae84 to f9f4a0e Compare August 29, 2025 16:17
@fvaleye fvaleye force-pushed the feature/expanduser-with-tilde-in-local-path branch from f9f4a0e to d2cfef7 Compare August 29, 2025 16:18
@fvaleye fvaleye merged commit 2b48db4 into delta-io:main Aug 29, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

binding/python Issues for the Python package binding/rust Issues for the Rust crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ~ for write_deltalake and read operations

3 participants