Skip to content

Commit 98ded53

Browse files
authored
Merge pull request #12 from Schokuroff/fix_py_io
added param for choosing pyiceberg.io.
2 parents 8e29c35 + 97dbba9 commit 98ded53

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/dlt_iceberg/destination_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class IcebergRestConfiguration(DestinationClientConfiguration):
9292
s3_secret_access_key: Optional[str] = None
9393
s3_region: Optional[str] = None
9494

95+
py_io_impl: Optional[str] = None
96+
# https://github.com/apache/iceberg-python/blob/main/pyiceberg/io/pyarrow.py
97+
# https://github.com/apache/iceberg-python/blob/main/pyiceberg/io/fsspec.py
98+
9599
# Retry configuration
96100
max_retries: int = 5
97101
retry_backoff_base: float = 2.0
@@ -115,6 +119,7 @@ class IcebergRestConfiguration(DestinationClientConfiguration):
115119
hard_delete_column: Optional[str] = "_dlt_deleted_at"
116120

117121

122+
118123
class IcebergRestLoadJob(RunnableLoadJob):
119124
"""
120125
Load job that processes a single parquet file.
@@ -668,6 +673,12 @@ def _get_catalog(self):
668673
if self.config.s3_region:
669674
catalog_config["s3.region"] = self.config.s3_region
670675

676+
if self.config.py_io_impl:
677+
catalog_config["py-io-impl"] = self.config.py_io_impl
678+
# For example:
679+
# catalog_config["py-io-impl"] = "pyiceberg.io.fsspec.FsspecFileIO"
680+
681+
671682
logger.info(
672683
f"Creating catalog connection (type={catalog_type}, uri={self.config.catalog_uri})"
673684
)

0 commit comments

Comments
 (0)