Implementation:Eventual Inc Daft Catalog From Iceberg
| Knowledge Sources | |
|---|---|
| Domains | Data_Engineering, Data_Catalog |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Concrete tool for creating a Daft Catalog from a PyIceberg catalog instance provided by the Daft library.
Description
The Catalog.from_iceberg() static method wraps a PyIceberg catalog object into a Daft Catalog. Internally, it imports the IcebergCatalog adapter and delegates to its _from_obj() factory method. This enables table discovery and access through Daft's unified catalog interface. If the pyiceberg package is not installed, a helpful ImportError is raised directing the user to install the Iceberg extras.
Usage
Import and use this method when you have an existing PyIceberg catalog instance and want to use it within Daft for table discovery and data access.
Code Reference
Source Location
- Repository: Daft
- File:
daft/catalog/__init__.py - Lines: L198-217
Signature
@staticmethod
def from_iceberg(catalog: object) -> Catalog
Import
from daft.catalog import Catalog
cat = Catalog.from_iceberg(pyiceberg_catalog)
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| catalog | object | Yes | A PyIceberg catalog instance (e.g., from pyiceberg.catalog.load_catalog())
|
Outputs
| Name | Type | Description |
|---|---|---|
| return | Catalog | A new Daft Catalog instance backed by the PyIceberg catalog |
Usage Examples
Basic Usage
from pyiceberg.catalog import load_catalog
from daft.catalog import Catalog
# Load a PyIceberg catalog and wrap it for Daft
iceberg_catalog = load_catalog("my_iceberg_catalog")
catalog = Catalog.from_iceberg(iceberg_catalog)