quiltdata / quilt

Quilt is a data mesh for connecting people with actionable data
https://quiltdata.com
Apache License 2.0
1.32k stars 92 forks source link

Fix PhysicalKey to URI conversion in Python 3.12 on Windows #4027

Closed dimaryaz closed 3 weeks ago

dimaryaz commented 3 weeks ago

On Windows, pathname2url returns three leading slashes for some reason. urlunparse has been ignoring them - until Python 3.12, where they result in a URL like file://///C:/....

We can instead use pathlib.PurePath.as_uri for this. It is certainly cleaner than using pathname2url (whose documentation basically says "don't use it") - however, we are still stuck with using the url2pathname for the opposite conversion, since there's no pathlib solution for that.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 38.43%. Comparing base (273189e) to head (dfd5fe4).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4027 +/- ## ======================================== Coverage 38.43% 38.43% ======================================== Files 718 718 Lines 33051 33051 Branches 4670 4842 +172 ======================================== Hits 12704 12704 + Misses 19723 19196 -527 - Partials 624 1151 +527 ``` | [Flag](https://app.codecov.io/gh/quiltdata/quilt/pull/4027/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quiltdata) | Coverage Δ | | |---|---|---| | [api-python](https://app.codecov.io/gh/quiltdata/quilt/pull/4027/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quiltdata) | `90.75% <100.00%> (ø)` | | | [catalog](https://app.codecov.io/gh/quiltdata/quilt/pull/4027/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quiltdata) | `11.50% <ø> (ø)` | | | [lambda](https://app.codecov.io/gh/quiltdata/quilt/pull/4027/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quiltdata) | `87.96% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quiltdata#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dimaryaz commented 3 weeks ago

it was succeeding sometimes

Huh, that seems impossible... Unless CI uses some machines that still use an older release of Python?

nl0 commented 3 weeks ago

it was succeeding sometimes

Huh, that seems impossible... Unless CI uses some machines that still use an older release of Python?

yeah i guess it's related to some kind of caching idk