Repository navigation
Commit 4a4baea
committed
fix: build StaticTable version-hint metadata locations with forward slashes
StaticTable._metadata_location_from_version_hint built the version-hint and
resolved metadata locations with os.path.join. Iceberg locations are URIs and
must always be forward-slash separated, but os.path.join uses the OS separator,
so on Windows it produced backslash-separated keys such as
s3://.../taxis\metadata\version-hint.text. That is an invalid object-store key,
which breaks the documented "pass the table root path" usage of
StaticTable.from_metadata on Windows.
Join the components with explicit forward slashes, matching how locations are
built elsewhere in pyiceberg (for example pyiceberg/table/locations.py). Behavior
is unchanged on POSIX. The now-unused os import is removed.
Add an OS-independent regression test that swaps os.path.join for the Windows
join so the metadata location is asserted to stay a valid forward-slash URI on
any platform (the existing test only exercised local temp paths, which use the
POSIX separator on Linux CI and never caught this).
Related: #24771 parent 1312c55 commit 4a4baea
2 files changed
Lines changed: 48 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
1963 | 1962 | | |
1964 | 1963 | | |
1965 | 1964 | | |
1966 | | - | |
| 1965 | + | |
| 1966 | + | |
1967 | 1967 | | |
1968 | 1968 | | |
1969 | 1969 | | |
1970 | 1970 | | |
1971 | 1971 | | |
1972 | 1972 | | |
1973 | 1973 | | |
1974 | | - | |
| 1974 | + | |
1975 | 1975 | | |
1976 | | - | |
| 1976 | + | |
1977 | 1977 | | |
1978 | | - | |
| 1978 | + | |
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
593 | 636 | | |
594 | 637 | | |
595 | 638 | | |
| |||
0 commit comments