Skip to content

fix(python): ignore ballista-namespaced cluster_config keys locally#1613

Merged
andygrove merged 1 commit intoapache:mainfrom
andygrove:py-cluster-config-ballista-keys
Apr 28, 2026
Merged

fix(python): ignore ballista-namespaced cluster_config keys locally#1613
andygrove merged 1 commit intoapache:mainfrom
andygrove:py-cluster-config-ballista-keys

Conversation

@andygrove
Copy link
Copy Markdown
Member

@andygrove andygrove commented Apr 28, 2026

Which issue does this PR close?

Closes #1607

Rationale for this change

BallistaSessionContext accepts a cluster_config dict that is intended to be forwarded to the scheduler-side session (e.g. ballista.shuffle.sort_based.enabled). The constructor also applies every entry to the local DataFusion SessionConfig so that DataFusion-namespaced keys (e.g. datafusion.execution.target_partitions) are honored during local table registration and planning.

The problem is that the local SessionConfig built inside BallistaSessionContext does not have the BallistaConfig extension registered, so any ballista.* key blows up with:

PanicException: Configuration("Could not find config namespace \"ballista\"")

This makes the documented cluster_config parameter effectively unusable for any Ballista-specific tuning from Python.

What changes are included in this PR?

  • python/python/ballista/extension.py: skip ballista.* keys in the local-apply loop. The full dict is still stored on the context and forwarded to the scheduler via create_ballista_data_frame, so scheduler-side behavior is unchanged.
  • python/python/tests/test_context.py: new test_cluster_config_accepts_ballista_namespaced_keys covering both a DataFusion key and a Ballista key in the same cluster_config and asserting that context construction and a trivial query both succeed.

Are there any user-facing changes?

Yes, but only in the sense that a previously panicking call now works. No public API shape changes.

The local DataFusion SessionConfig built inside BallistaSessionContext
does not register the BallistaConfig extension, so applying any
ballista.* key panics with 'Could not find config namespace ballista'.
These keys are only meaningful on the scheduler-side session and were
never intended to be set on the local config.

Skip ballista.* keys in the local apply loop. They are still preserved
on the context and forwarded to the scheduler via cluster_config.
@andygrove andygrove marked this pull request as ready for review April 28, 2026 14:02
@andygrove andygrove merged commit 635c141 into apache:main Apr 28, 2026
17 of 18 checks passed
@andygrove andygrove deleted the py-cluster-config-ballista-keys branch April 28, 2026 14:41
Sign up for free to 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.

Ballista configs cannot be set in Python client

2 participants