Skip to content

chore: Update to latest main on upstream DataFusion - #1662

Merged
timsaucer merged 7 commits into
apache:mainfrom
timsaucer:chore/update-main-prepare-df55
Aug 6, 2026
Merged

chore: Update to latest main on upstream DataFusion#1662
timsaucer merged 7 commits into
apache:mainfrom
timsaucer:chore/update-main-prepare-df55

Conversation

@timsaucer

Copy link
Copy Markdown
Member

Which issue does this PR close?

No particular issue. This PR is to update our datafusion dependency so that when DF55 is released we can release our project more quickly.

Rationale for this change

Prepare for DF55 release.

What changes are included in this PR?

  • Upgrade dependencies.
  • Minor changes to the repo for new enum variants and pyo3 upgrades.

Are there any user-facing changes?

None.

@timsaucer
timsaucer marked this pull request as ready for review July 31, 2026 17:47
@timsaucer
timsaucer requested review from Copilot and kosiewAugust 3, 2026 18:27

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates this repo to track the latest upstream DataFusion main branch to reduce lead time for the upcoming DF55 release, with accompanying API/test adjustments for new enum variants and PyO3 upgrades.

Changes:

  • Bump Arrow/DataFusion/PyO3 dependencies and align FFI/Capsule API usage with newer PyO3.
  • Update Python/Rust bindings and tests for DataFusion API changes (e.g., CreateExternalTable locations, new WriteOp variants).
  • Adjust and extend Python test suite to reflect changed upstream behavior (CSV list paths, Spark slice behavior, sqrt negative-input handling).

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
python/tests/test_sql.pyUses distinct CSV paths when registering multiple files.
python/tests/test_spark_functions.pyAdds slice coverage and marks Spark-array behavior as xfail.
python/tests/test_lambda.pyUpdates lambda expr serialization expectations via pickle round-trip.
python/tests/test_io.pyAdjusts multi-path CSV read test to use distinct file paths.
python/tests/test_functions.pyAvoids sqrt on negatives in general math test; adds negative-input rejection test.
python/tests/test_expr.pyAdds deprecation-warning test for CreateExternalTable.location().
python/tests/test_context.pyMirrors CSV multi-path adjustments in SessionContext tests.
python/datafusion/functions/spark.pyUpdates slice doc example to operate on an array column.
python/datafusion/expr.pyAdds deprecated CreateExternalTable.location() shim delegating to locations().
examples/datafusion-ffi-example/src/window_udf.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/table_provider_factory.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/table_provider.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/table_function.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/scalar_udf.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/physical_optimizer.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/physical_extension_codec.rsAdapts PhysicalExtensionCodec trait signature changes; updates PyCapsule creation.
examples/datafusion-ffi-example/src/logical_extension_codec.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/config.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/src/catalog_provider.rsFixes record_batch import source; updates PyCapsule creation API.
examples/datafusion-ffi-example/src/aggregate_udf.rsUpdates PyCapsule creation API for PyO3 0.29.
examples/datafusion-ffi-example/python/tests/_test_table_provider_factory.pyUpdates SQL to provide non-empty LOCATION literal for DF changes.
crates/util/src/lib.rsImproves PyCapsule name UTF-8 error mapping; updates PyCapsule creation API.
crates/core/src/substrait.rsUpdates Substrait deserialization call site to match upstream API.
crates/core/src/sql/logical.rsAdapts to upstream DDL plan container type changes.
crates/core/src/expr/recursive_query.rsUses fallible RecursiveQuery constructor and returns PyDataFusionResult.
crates/core/src/expr/drop_catalog_schema.rsAligns TableReference import location.
crates/core/src/expr/dml.rsHandles new/unknown WriteOp variants with PyNotImplementedError.
crates/core/src/expr/create_external_table.rsMigrates CreateExternalTable from location to locations.
crates/core/src/dataframe.rsUpdates Arrow stream capsule creation; adapts fill_null signature change.
crates/core/src/context.rsUpdates PyCapsule creation API for PyO3 0.29.
crates/core/src/codec.rsAdapts PhysicalExtensionCodec physical-expr encode/decode context changes.
crates/core/src/array.rsUpdates Arrow schema/array capsule creation API for PyO3 0.29.
crates/core/Cargo.tomlEnables datafusion-sparkcore feature.
Cargo.tomlBumps workspace deps; adds git patches pinning DF crates to upstream rev.
Suppressed comments (2)

python/tests/test_spark_functions.py:1

  • The xfail reason references Spark array field names, but the test only asserts values. With strict=True, this becomes brittle (an upstream fix that preserves names but keeps values correct will turn into an XPASS failure without actually validating the reason). Consider asserting the schema/field-name behavior that is currently broken, or adjust the xfail reason to match the actual failing condition.
    python/tests/test_functions.py:1
  • Matching the full error string makes this test fragile to upstream wording changes. Consider matching a more stable substring/regex (e.g., just square root / negative) or asserting on an error code/type if one is available in this project’s Python exception hierarchy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadpython/datafusion/expr.py
Comment threadpython/datafusion/expr.py
Comment threadCargo.toml
AI Disclosure: This code was written in part by an AI agent.:

@kosiewkosiew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timsaucer,

Thanks for working on this! The changes look good overall and I did not find any blocking issues. I have one small suggestion that could strengthen the test coverage around the new upstream API behavior.

Comment threadpython/tests/test_expr.py Outdated
return ctx


def test_create_external_table_location_is_deprecated():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see the deprecated shim covered. One thought: since this test calls the shim with a MagicMock, it does not verify that CreateExternalTable.locations() is actually bound to the upstream locations field.

Would it make sense to build a real CREATE EXTERNAL TABLE logical plan instead and assert both locations() and the deprecated location() on the resulting variant? That would exercise the Rust/Python boundary introduced by this upgrade and give a bit more confidence that the binding is wired up correctly.

AI Disclosure: This code was written in part by an AI agent.:
@timsaucer

Copy link
Copy Markdown
MemberAuthor

Thanks @kosiew

@timsaucer
timsaucer merged commit cc2ec5c into apache:mainAug 6, 2026
26 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@timsaucer@kosiew