Skip to content

Commit 661387c

Browse files
Merge remote-tracking branch 'upstream/main' into sm/rest-encryption-read
2 parents 91508f8 + c6b8508 commit 661387c

10 files changed

Lines changed: 343 additions & 303 deletions

File tree

.github/workflows/asf-allowlist-check.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ jobs:
4343
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4444
with:
4545
persist-credentials: false
46-
# Intentionally unpinned to always use the latest allowlist from the ASF.
47-
- uses: apache/infrastructure-actions/allowlist-check@main # zizmor: ignore[unpinned-uses]
46+
- uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ jobs:
4646
persist-credentials: false
4747

4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4
49+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
5050
with:
5151
languages: actions
5252

5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4
54+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
5555
with:
5656
category: "/language:actions"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
if: matrix.os == 'ubuntu-latest'
6969

7070
- name: Build wheels
71-
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
71+
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
7272
with:
7373
output-dir: wheelhouse
7474
config-file: "pyproject.toml"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
if: matrix.os == 'ubuntu-latest'
6363

6464
- name: Build wheels
65-
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
65+
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
6666
with:
6767
output-dir: wheelhouse
6868
config-file: "pyproject.toml"

dev/docker-compose-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
retries: 5
4545
start_period: 90s
4646
rest:
47-
image: apache/iceberg-rest-fixture
47+
image: apache/iceberg-rest-fixture:1.10.1
4848
container_name: pyiceberg-rest
4949
networks:
5050
iceberg_net:

pyiceberg/catalog/rest/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,14 @@ class ListNamespaceResponse(IcebergBaseModel):
337337

338338
class NamespaceResponse(IcebergBaseModel):
339339
namespace: Identifier = Field()
340-
properties: Properties = Field()
340+
properties: Properties = Field(default_factory=dict)
341+
342+
@field_validator("properties", mode="before")
343+
@classmethod
344+
def replace_none_with_dict(cls, v: Any) -> Properties:
345+
if v is None:
346+
return {}
347+
return v
341348

342349

343350
class UpdateNamespacePropertiesResponse(IcebergBaseModel):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ geoarrow = ["geoarrow-pyarrow>=0.2.0"]
101101

102102
[dependency-groups]
103103
dev = [
104-
"pytest==9.0.2",
104+
"pytest==9.0.3",
105105
"pytest-checkdocs==2.14.0",
106106
"prek>=0.2.1,<0.4",
107107
"pytest-lazy-fixtures==1.4.0",

tests/catalog/test_rest.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,39 @@ def test_load_namespace_properties_200(rest_mock: Mocker) -> None:
922922
assert RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).load_namespace_properties(namespace) == {"prop": "yes"}
923923

924924

925+
def test_load_namespace_properties_200_without_properties(rest_mock: Mocker) -> None:
926+
namespace = "leden"
927+
rest_mock.get(
928+
f"{TEST_URI}v1/namespaces/{namespace}",
929+
json={"namespace": ["leden"]},
930+
status_code=200,
931+
request_headers=TEST_HEADERS,
932+
)
933+
assert RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).load_namespace_properties(namespace) == {}
934+
935+
936+
def test_load_namespace_properties_200_with_null_properties(rest_mock: Mocker) -> None:
937+
namespace = "leden"
938+
rest_mock.get(
939+
f"{TEST_URI}v1/namespaces/{namespace}",
940+
json={"namespace": ["leden"], "properties": None},
941+
status_code=200,
942+
request_headers=TEST_HEADERS,
943+
)
944+
assert RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).load_namespace_properties(namespace) == {}
945+
946+
947+
def test_load_namespace_properties_200_with_empty_properties(rest_mock: Mocker) -> None:
948+
namespace = "leden"
949+
rest_mock.get(
950+
f"{TEST_URI}v1/namespaces/{namespace}",
951+
json={"namespace": ["leden"], "properties": {}},
952+
status_code=200,
953+
request_headers=TEST_HEADERS,
954+
)
955+
assert RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).load_namespace_properties(namespace) == {}
956+
957+
925958
def test_load_namespace_properties_404(rest_mock: Mocker) -> None:
926959
namespace = "leden"
927960
rest_mock.get(

tests/integration/test_catalog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ def test_register_table_existing(test_catalog: Catalog, table_schema_nested: Sch
618618

619619

620620
@pytest.mark.integration
621+
@pytest.mark.skip(reason="Requires Iceberg REST Fixtures 1.11.x")
621622
def test_rest_custom_namespace_separator(rest_catalog: RestCatalog, table_schema_simple: Schema) -> None:
622623
"""
623624
Tests that the REST catalog correctly picks up the namespace-separator from the config endpoint.

uv.lock

Lines changed: 294 additions & 294 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)