Skip to content

Commit 287f679

Browse files
kevinjqliuFokko
andauthored
dep: upgrade pyiceberg-core to 0.8.0 and datafusion to 51 (#2928)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change Update pyiceberg-core to the latest release, 0.8.0 Also update datafusion to match the version iceberg-rust uses, v51 https://github.com/apache/iceberg-rust/blob/v0.8.0/Cargo.toml#L65 Pulled in #2749 as well. Otherwise CI will fail. `register_table_provider` has been deprecated: https://datafusion.apache.org/python/autoapi/datafusion/context/index.html#datafusion.context.SessionContext.register_table_provider ## Are these changes tested? ## Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. --> --------- Co-authored-by: Fokko Driesprong <fokko@apache.org>
1 parent 061713b commit 287f679

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

mkdocs/docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ PyIceberg integrates with [Apache DataFusion](https://datafusion.apache.org/) th
19411941

19421942
The integration has a few caveats:
19431943

1944-
- Only works with `datafusion >= 45, < 49`
1944+
- Only works with `datafusion == 51`, aligns with the version used in `pyiceberg-core`
19451945
- Depends directly on `iceberg-rust` instead of PyIceberg's implementation
19461946
- Has limited features compared to the full PyIceberg API
19471947

@@ -1967,7 +1967,7 @@ iceberg_table.append(data)
19671967

19681968
# Register the table with DataFusion
19691969
ctx = SessionContext()
1970-
ctx.register_table_provider("test", iceberg_table)
1970+
ctx.register_table("test", iceberg_table)
19711971

19721972
# Query the table using DataFusion SQL
19731973
ctx.table("test").show()

pyiceberg/table/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ def __datafusion_table_provider__(self) -> IcebergDataFusionTable:
16011601
16021602
To support DataFusion features such as push down filtering, this function will return a PyCapsule
16031603
interface that conforms to the FFI Table Provider required by DataFusion. From an end user perspective
1604-
you should not need to call this function directly. Instead you can use ``register_table_provider`` in
1604+
you should not need to call this function directly. Instead you can use ``register_table`` in
16051605
the DataFusion SessionContext.
16061606
16071607
Returns:
@@ -1618,7 +1618,7 @@ def __datafusion_table_provider__(self) -> IcebergDataFusionTable:
16181618
iceberg_table = catalog.create_table("default.test", schema=data.schema)
16191619
iceberg_table.append(data)
16201620
ctx = SessionContext()
1621-
ctx.register_table_provider("test", iceberg_table)
1621+
ctx.register_table("test", iceberg_table)
16221622
ctx.table("test").show()
16231623
```
16241624
Results in

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pyiceberg = "pyiceberg.cli.console:run"
5656
[project.optional-dependencies]
5757
pyarrow = [
5858
"pyarrow>=17.0.0",
59-
"pyiceberg-core>=0.5.1,<0.8.0",
59+
"pyiceberg-core>=0.5.1,<0.9.0",
6060
]
6161
pandas = [
6262
"pandas>=1.0.0,<3.0.0",
@@ -94,8 +94,8 @@ sql-sqlite = ["sqlalchemy>=2.0.18,<3"]
9494
gcsfs = ["gcsfs>=2023.1.0"]
9595
rest-sigv4 = ["boto3>=1.24.59"]
9696
hf = ["huggingface-hub>=0.24.0"]
97-
pyiceberg-core = ["pyiceberg-core>=0.5.1,<0.8.0"]
98-
datafusion = ["datafusion>=45,<49"]
97+
pyiceberg-core = ["pyiceberg-core>=0.5.1,<0.9.0"]
98+
datafusion = ["datafusion>=51,<52"]
9999
gcp-auth = ["google-auth>=2.4.0"]
100100

101101
[dependency-groups]

tests/table/test_datafusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_datafusion_register_pyiceberg_table(catalog: Catalog, arrow_table_with_
4949
iceberg_table.append(arrow_table_with_null)
5050

5151
ctx = SessionContext()
52-
ctx.register_table_provider("test", iceberg_table)
52+
ctx.register_table("test", iceberg_table)
5353

5454
datafusion_table = ctx.table("test")
5555
assert datafusion_table is not None

uv.lock

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

0 commit comments

Comments
 (0)