Skip to content

feat: upgrade url crate, rework temporary directory utils#4860

Merged
westonpace merged 14 commits intolance-format:mainfrom
westonpace:feat/upgrade-url
Oct 2, 2025
Merged

feat: upgrade url crate, rework temporary directory utils#4860
westonpace merged 14 commits intolance-format:mainfrom
westonpace:feat/upgrade-url

Conversation

@westonpace
Copy link
Copy Markdown
Member

@westonpace westonpace commented Sep 30, 2025

There is a behavior change in url 2.5.7 that is blocking a datafusion upgrade. This PR works around that behavior change. Unfortunately, the fix here is to just avoid problematic Windows paths in our tests while we wait for guidance from upstream. It will still be possible for users to encounter errors when providing Windows paths. We can look at hacks for that problem in a future PR (or just hope the upstream bug is fixed promptly).

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 96.81818% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.87%. Comparing base (492e773) to head (33dd234).

Files with missing lines Patch % Lines
rust/lance-core/src/utils/tempfile.rs 89.56% 11 Missing and 1 partial ⚠️
rust/lance-index/src/scalar/bitmap.rs 75.00% 2 Missing ⚠️
rust/lance/src/index/vector/builder.rs 50.00% 0 Missing and 2 partials ⚠️
rust/lance-index/src/vector/ivf/shuffler.rs 0.00% 0 Missing and 1 partial ⚠️
rust/lance/src/dataset/scanner.rs 94.44% 0 Missing and 1 partial ⚠️
rust/lance/src/index/vector/ivf.rs 96.15% 0 Missing and 1 partial ⚠️
rust/lance/src/index/vector/ivf/io.rs 80.00% 1 Missing ⚠️
rust/lance/src/utils/test.rs 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4860   +/-   ##
=======================================
  Coverage   80.87%   80.87%           
=======================================
  Files         332      333    +1     
  Lines      131687   131690    +3     
  Branches   131687   131690    +3     
=======================================
+ Hits       106507   106510    +3     
- Misses      21430    21441   +11     
+ Partials     3750     3739   -11     
Flag Coverage Δ
unittests 80.87% <96.81%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@westonpace westonpace force-pushed the feat/upgrade-url branch 2 times, most recently from 4cce53f to 483f0d6 Compare October 1, 2025 04:09
@cmccabe
Copy link
Copy Markdown
Contributor

cmccabe commented Oct 1, 2025

What is the current state of using slashes in paths on Windows? It used to be that you were supposed to use https://doc.rust-lang.org/std/path/constant.MAIN_SEPARATOR.html but I don't know if we still want to do that.

@westonpace
Copy link
Copy Markdown
Member Author

What is the current state of using slashes in paths on Windows? It used to be that you were supposed to use https://doc.rust-lang.org/std/path/constant.MAIN_SEPARATOR.html but I don't know if we still want to do that.

The following should work (even on Windows):

  • C:/foo/bar
  • /foo/bar (not sure if this uses a "default disk" or if it is always C:)
  • file:///C:/foo/bar
  • foo\bar

The following will fail:

  • C:\foo\bar
  • file:///C:\foo\bar

So my recommendation would be to always use /.

Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

thank you so much for looking into this 🙏 🙏 🙏

Comment thread python/python/lance/vector.py Outdated
# Hack for Windows due to
# https://github.com/apache/arrow-rs-object-store/issues/499
dst_dataset_uri = dst_dataset_uri.replace("\\", "/", 1)
print(f"dst_dataset_uri={dst_dataset_uri}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: remove print

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oops, done.

Comment thread rust/lance-core/src/utils/tempfile.rs Outdated
/// It is useful when you need to create a temporary file that is only used as a standard library path.
#[derive(Default)]
pub struct TempStdFile {
_tempfile: TempFile,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: since this variable is used, this should not have underscore prefix? (similar comment for other _tempfile and _tempdir

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some of them really are use but TempStdFile and TempStdPath I modified to remove the underscore.

@westonpace westonpace merged commit 3de00ee into lance-format:main Oct 2, 2025
29 checks passed
wjones127 pushed a commit to wjones127/lance that referenced this pull request Oct 3, 2025
…at#4860)

There is a [behavior
change](servo/rust-url#1077) in url 2.5.7 that
is blocking a datafusion upgrade. This PR works around that behavior
change. Unfortunately, the fix here is to just avoid problematic Windows
paths in our tests while we wait for guidance from upstream. It will
still be possible for users to encounter errors when providing Windows
paths. We can look at hacks for that problem in a future PR (or just
hope the upstream bug is fixed promptly).
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
…at#4860)

There is a [behavior
change](servo/rust-url#1077) in url 2.5.7 that
is blocking a datafusion upgrade. This PR works around that behavior
change. Unfortunately, the fix here is to just avoid problematic Windows
paths in our tests while we wait for guidance from upstream. It will
still be possible for users to encounter errors when providing Windows
paths. We can look at hacks for that problem in a future PR (or just
hope the upstream bug is fixed promptly).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants