Skip to content

Commit f6a59ea

Browse files
committed
Merge branch 'main' of github.com:apache/iceberg-python into fd-rust
2 parents e31ebda + e3e0ec6 commit f6a59ea

File tree

10 files changed

+32
-14
lines changed

10 files changed

+32
-14
lines changed

.github/workflows/license_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on: pull_request
2222

2323
jobs:
2424
rat:
25-
runs-on: ubuntu-22.04
25+
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v5
2828
- run: dev/check-license

.github/workflows/pypi-build-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14 ]
35+
os: [ ubuntu-latest, windows-latest, macos-latest ]
3636

3737
steps:
3838
- uses: actions/checkout@v5

.github/workflows/python-ci-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ concurrency:
3232

3333
jobs:
3434
docs:
35-
runs-on: ubuntu-22.04
35+
runs-on: ubuntu-latest
3636

3737
steps:
3838
- uses: actions/checkout@v5

.github/workflows/python-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ concurrency:
4444

4545
jobs:
4646
lint-and-test:
47-
runs-on: ubuntu-22.04
47+
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
5050
python: ['3.9', '3.10', '3.11', '3.12']
@@ -68,7 +68,7 @@ jobs:
6868
run: COVERAGE_FAIL_UNDER=85 make coverage-report
6969

7070
integration-test:
71-
runs-on: ubuntu-22.04
71+
runs-on: ubuntu-latest
7272
strategy:
7373
matrix:
7474
python: ['3.9', '3.10', '3.11', '3.12']

.github/workflows/python-release-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ concurrency:
2727

2828
jobs:
2929
docs:
30-
runs-on: ubuntu-22.04
30+
runs-on: ubuntu-latest
3131

3232
steps:
3333
- uses: actions/checkout@v5

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ permissions:
2929
jobs:
3030
stale:
3131
if: github.repository_owner == 'apache'
32-
runs-on: ubuntu-22.04
32+
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/stale@v10.0.0
3535
with:

.github/workflows/svn-build-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
os: [ ubuntu-22.04, windows-2022, macos-13, macos-14 ]
35+
os: [ ubuntu-latest, windows-latest, macos-latest ]
3636

3737
steps:
3838
- uses: actions/checkout@v5

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ help: ## Display this help message
5858
install-poetry: ## Ensure Poetry is installed at the specified version
5959
@if ! command -v ${POETRY} &> /dev/null; then \
6060
echo "Poetry not found. Installing..."; \
61-
${PIP} install --user poetry==$(POETRY_VERSION); \
61+
${PIP} install poetry==$(POETRY_VERSION); \
6262
else \
6363
INSTALLED_VERSION=$$(${PIP} show poetry | grep Version | awk '{print $$2}'); \
6464
if [ "$$INSTALLED_VERSION" != "$(POETRY_VERSION)" ]; then \
6565
echo "Updating Poetry to version $(POETRY_VERSION)..."; \
66-
${PIP} install --user --upgrade poetry==$(POETRY_VERSION); \
66+
${PIP} install --upgrade poetry==$(POETRY_VERSION); \
6767
else \
6868
echo "Poetry version $(POETRY_VERSION) already installed."; \
6969
fi; \

dev/Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,22 @@ ENV ICEBERG_SPARK_RUNTIME_VERSION=3.5_2.12
4242
ENV ICEBERG_VERSION=1.9.1
4343
ENV PYICEBERG_VERSION=0.10.0
4444

45-
RUN curl --retry 5 -s -C - https://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop3.tgz -o spark-${SPARK_VERSION}-bin-hadoop3.tgz \
46-
&& tar xzf spark-${SPARK_VERSION}-bin-hadoop3.tgz --directory /opt/spark --strip-components 1 \
47-
&& rm -rf spark-${SPARK_VERSION}-bin-hadoop3.tgz
45+
# Try the primary Apache mirror (downloads.apache.org) first, then fall back to the archive
46+
RUN set -eux; \
47+
FILE=spark-${SPARK_VERSION}-bin-hadoop3.tgz; \
48+
URLS="https://downloads.apache.org/spark/spark-${SPARK_VERSION}/${FILE} https://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/${FILE}"; \
49+
for url in $URLS; do \
50+
echo "Attempting download: $url"; \
51+
if curl --retry 3 --retry-delay 5 -f -s -C - "$url" -o "$FILE"; then \
52+
echo "Downloaded from: $url"; \
53+
break; \
54+
else \
55+
echo "Failed to download from: $url"; \
56+
fi; \
57+
done; \
58+
if [ ! -f "$FILE" ]; then echo "Failed to download Spark from all mirrors" >&2; exit 1; fi; \
59+
tar xzf "$FILE" --directory /opt/spark --strip-components 1; \
60+
rm -rf "$FILE"
4861

4962
# Download iceberg spark runtime
5063
RUN curl --retry 5 -s https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-spark-runtime-${ICEBERG_SPARK_RUNTIME_VERSION}/${ICEBERG_VERSION}/iceberg-spark-runtime-${ICEBERG_SPARK_RUNTIME_VERSION}-${ICEBERG_VERSION}.jar \

pyiceberg/table/update/spec.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from pyiceberg.schema import Schema
3333
from pyiceberg.table.update import (
3434
AddPartitionSpecUpdate,
35+
AssertDefaultSpecId,
3536
AssertLastAssignedPartitionId,
3637
SetDefaultSpecUpdate,
3738
TableRequirement,
@@ -169,7 +170,11 @@ def _commit(self) -> UpdatesAndRequirements:
169170
updates = (SetDefaultSpecUpdate(spec_id=new_spec.spec_id),)
170171

171172
required_last_assigned_partitioned_id = self._transaction.table_metadata.last_partition_id
172-
requirements = (AssertLastAssignedPartitionId(last_assigned_partition_id=required_last_assigned_partitioned_id),)
173+
default_spec_id = self._transaction.table_metadata.default_spec_id
174+
requirements = (
175+
AssertLastAssignedPartitionId(last_assigned_partition_id=required_last_assigned_partitioned_id),
176+
AssertDefaultSpecId(default_spec_id=default_spec_id),
177+
)
173178

174179
return updates, requirements
175180

0 commit comments

Comments
 (0)