Skip to content

feat(python): integrate Ballista through DataFusion FFI - #2252

Draft
timsaucer wants to merge 4 commits into
datafusion-55from
feat/ffi-query-planner-55
Draft

feat(python): integrate Ballista through DataFusion FFI#2252
timsaucer wants to merge 4 commits into
datafusion-55from
feat/ffi-query-planner-55

Conversation

@timsaucer

Copy link
Copy Markdown
Member

Summary

  • expose Ballista logical and physical extension codecs and an FFI query planner to datafusion-python
  • add a reusable BallistaExtension bundle that installs its components atomically with SessionContext.with_extensions
  • pin the Python and Rust dependencies to the latest commit from Add atomic SessionContext.with_extensions API datafusion-python#1679
  • update the getting-started notebook to use the new extension API
  • preserve context ownership semantics and cover atomic installation and context lifetime with tests

Testing

  • cargo check
  • cargo fmt -- --check
  • uv run pytest python/tests/test_context.py -q (21 passed)

AI Disclosure: This code was written in part by an AI agent.
AI Disclosure: This code was written in part by an AI agent.
AI Disclosure: This code was written in part by an AI agent.:
@github-actions github-actions Bot added the python label Aug 7, 2026

@milenkovicm milenkovicm 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.

After many years! Thanks @timsaucer awesome as always!

"address = f\"df://{host}:{port}\"\n",
"\n",
"ballista_config = ballista_datafusion_config_defaults()\n",
"ctx = SessionContext(SessionConfig(ballista_config)).with_extensions(\n",

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.

Can we use ballista context to hide next few lines and simplify session context creation ?

]


class RedefiningDataFrameMeta(type):

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.

Can we remove this once we get FFI planner ?

session_id = args[0].session_id
df = func(*args, **kwargs)
return DistributedDataFrame(df, session_id, address)
return DistributedDataFrame(

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.

DistributedDataFrame, should be removed with FFI, should it ?

name: &str,
buf: &[u8],
) -> Result<Arc<datafusion::logical_expr::ScalarUDF>> {
self.default_codec.try_decode_udf(name, buf)

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.

Do we need to do something extra to get python udf serde?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants