Skip to content

Commit db91f80

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents f17c28f + 4526d62 commit db91f80

28 files changed

+885
-370
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
- uses: actions/setup-python@v6
4343
with:
4444
python-version: |
45-
3.9
4645
3.10
4746
3.11
4847
3.12
@@ -62,14 +61,14 @@ jobs:
6261
if: startsWith(matrix.os, 'ubuntu')
6362

6463
- name: Build wheels
65-
uses: pypa/[email protected].0
64+
uses: pypa/[email protected].1
6665
with:
6766
output-dir: wheelhouse
6867
config-file: "pyproject.toml"
6968
env:
7069
# Ignore 32 bit architectures
7170
CIBW_ARCHS: "auto64"
72-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
71+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
7372
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
7473
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
7574
# Ignore tests for pypy since not all dependencies are compiled for it

.github/workflows/python-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
50-
python: ['3.9', '3.10', '3.11', '3.12']
50+
python: ['3.10', '3.11', '3.12']
5151

5252
steps:
5353
- uses: actions/checkout@v5
@@ -71,7 +71,7 @@ jobs:
7171
runs-on: ubuntu-latest
7272
strategy:
7373
matrix:
74-
python: ['3.9', '3.10', '3.11', '3.12']
74+
python: ['3.10', '3.11', '3.12']
7575

7676
steps:
7777
- uses: actions/checkout@v5

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
- uses: actions/setup-python@v6
4343
with:
4444
python-version: |
45-
3.9
4645
3.10
4746
3.11
4847
3.12
@@ -57,14 +56,14 @@ jobs:
5756
if: startsWith(matrix.os, 'ubuntu')
5857

5958
- name: Build wheels
60-
uses: pypa/[email protected].0
59+
uses: pypa/[email protected].1
6160
with:
6261
output-dir: wheelhouse
6362
config-file: "pyproject.toml"
6463
env:
6564
# Ignore 32 bit architectures
6665
CIBW_ARCHS: "auto64"
67-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
66+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
6867
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
6968
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
7069
# Ignore tests for pypy since not all dependencies are compiled for it

mkdocs/docs/configuration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,18 @@ catalog:
539539
py-io-impl: pyiceberg.io.fsspec.FsspecFileIO
540540
```
541541

542+
##### Apache Gravitino
543+
544+
```yaml
545+
catalog:
546+
gravitino_catalog:
547+
type: rest
548+
uri: <gravitino-catalog-uri>
549+
header.X-Iceberg-Access-Delegation: vended-credentials
550+
auth:
551+
type: noop
552+
```
553+
542554
### SQL Catalog
543555

544556
The SQL catalog requires a database for its backend. PyIceberg supports PostgreSQL and SQLite through psycopg2. The database connection has to be configured using the `uri` property. The init_catalog_tables is optional and defaults to True. If it is set to False, the catalog tables will not be created when the SQLCatalog is initialized. See SQLAlchemy's [documentation for URL format](https://docs.sqlalchemy.org/en/20/core/engines.html#backend-specific-urls):

mkdocs/docs/contributing.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ Deprecated in 0.1.0, will be removed in 0.2.0. The old_property is deprecated. P
234234

235235
For the type annotation the types from the `Typing` package are used.
236236

237-
PyIceberg offers support from Python 3.9 onwards, we can't use the [type hints from the standard collections](https://peps.python.org/pep-0585/).
238-
239237
### Third party libraries
240238

241239
PyIceberg naturally integrates into the rich Python ecosystem, however it is important to be hesitant adding third party packages. Adding a lot of packages makes the library heavyweight, and causes incompatibilities with other projects if they use a different version of the library. Also, big libraries such as `s3fs`, `adlfs`, `pyarrow`, `thrift` should be optional to avoid downloading everything, while not being sure if is actually being used.

mkdocs/docs/how-to-release.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This guide outlines the process for releasing PyIceberg in accordance with the [
3030
## Requirements
3131

3232
* A GPG key must be registered and published in the [Apache Iceberg KEYS file](https://downloads.apache.org/iceberg/KEYS). Follow [the instructions for setting up a GPG key and uploading it to the KEYS file](#set-up-gpg-key-and-upload-to-apache-iceberg-keys-file).
33+
* Permission to update the `KEYS` artifact in the [Apache release distribution](https://dist.apache.org/repos/dist/release/iceberg/) (requires Iceberg PMC privileges).
3334
* SVN Access
3435
* Permission to upload artifacts to the [Apache development distribution](https://dist.apache.org/repos/dist/dev/iceberg/) (requires Apache Committer access).
3536
* Permission to upload artifacts to the [Apache release distribution](https://dist.apache.org/repos/dist/release/iceberg/) (requires Apache PMC access).
@@ -405,5 +406,12 @@ cd icebergsvn
405406
echo "" >> KEYS # append a newline
406407
gpg --list-sigs <YOUR KEY ID HERE> >> KEYS # append signatures
407408
gpg --armor --export <YOUR KEY ID HERE> >> KEYS # append public key block
408-
svn commit -m "add key for <YOUR NAME HERE>"
409+
svn commit -m "add key for <YOUR NAME HERE>" # this requires Iceberg PMC privileges
409410
```
411+
412+
<!-- prettier-ignore-start -->
413+
414+
!!! note
415+
Updating the `KEYS` artifact in the `release/` distribution requires Iceberg PMC privileges. Please work with a PMC member to update the file.
416+
417+
<!-- prettier-ignore-end -->

pyiceberg/catalog/glue.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -355,34 +355,29 @@ def __init__(self, name: str, client: Optional["GlueClient"] = None, **propertie
355355
_register_glue_catalog_id_with_glue_client(self.glue, glue_catalog_id)
356356

357357
def _convert_glue_to_iceberg(self, glue_table: "TableTypeDef") -> Table:
358-
properties: Properties = glue_table["Parameters"]
359-
360-
database_name = glue_table.get("DatabaseName", None)
361-
if database_name is None:
358+
if (database_name := glue_table.get("DatabaseName")) is None:
362359
raise ValueError("Glue table is missing DatabaseName property")
363360

364-
parameters = glue_table.get("Parameters", None)
365-
if parameters is None:
366-
raise ValueError("Glue table is missing Parameters property")
361+
if (table_name := glue_table.get("Name")) is None:
362+
raise ValueError("Glue table is missing Name property")
367363

368-
table_name = glue_table["Name"]
364+
if (parameters := glue_table.get("Parameters")) is None:
365+
raise ValueError("Glue table is missing Parameters property")
369366

370-
if TABLE_TYPE not in properties:
367+
if (glue_table_type := parameters.get(TABLE_TYPE)) is None:
371368
raise NoSuchPropertyException(
372369
f"Property {TABLE_TYPE} missing, could not determine type: {database_name}.{table_name}"
373370
)
374-
glue_table_type = properties[TABLE_TYPE]
375371

376372
if glue_table_type.lower() != ICEBERG:
377373
raise NoSuchIcebergTableError(
378374
f"Property table_type is {glue_table_type}, expected {ICEBERG}: {database_name}.{table_name}"
379375
)
380376

381-
if METADATA_LOCATION not in properties:
377+
if (metadata_location := parameters.get(METADATA_LOCATION)) is None:
382378
raise NoSuchPropertyException(
383379
f"Table property {METADATA_LOCATION} is missing, cannot find metadata for: {database_name}.{table_name}"
384380
)
385-
metadata_location = properties[METADATA_LOCATION]
386381

387382
io = self._load_file_io(location=metadata_location)
388383
file = io.new_input(metadata_location)

pyiceberg/catalog/rest/__init__.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def _create_session(self) -> Session:
238238
"""Create a request session with provided catalog configuration."""
239239
session = Session()
240240

241+
# Set HTTP headers
242+
self._config_headers(session)
243+
241244
# Sets the client side and server side SSL cert verification, if provided as properties.
242245
if ssl_config := self.properties.get(SSL):
243246
if ssl_ca_bundle := ssl_config.get(CA_BUNDLE):
@@ -265,9 +268,6 @@ def _create_session(self) -> Session:
265268
else:
266269
session.auth = AuthManagerAdapter(self._create_legacy_oauth2_auth_manager(session))
267270

268-
# Set HTTP headers
269-
self._config_headers(session)
270-
271271
# Configure SigV4 Request Signing
272272
if property_as_bool(self.properties, SIGV4, False):
273273
self._init_sigv4(session)
@@ -654,6 +654,16 @@ def rename_table(self, from_identifier: Union[str, Identifier], to_identifier: U
654654
"source": self._split_identifier_for_json(from_identifier),
655655
"destination": self._split_identifier_for_json(to_identifier),
656656
}
657+
658+
# Ensure that namespaces exist on source and destination.
659+
source_namespace = self._split_identifier_for_json(from_identifier)["namespace"]
660+
if not self.namespace_exists(source_namespace):
661+
raise NoSuchNamespaceError(f"Source namespace does not exist: {source_namespace}")
662+
663+
destination_namespace = self._split_identifier_for_json(to_identifier)["namespace"]
664+
if not self.namespace_exists(destination_namespace):
665+
raise NoSuchNamespaceError(f"Destination namespace does not exist: {destination_namespace}")
666+
657667
response = self._session.post(self.url(Endpoints.rename_table), json=payload)
658668
try:
659669
response.raise_for_status()

0 commit comments

Comments
 (0)