Skip to content

Commit 0712eff

Browse files
timsaucerclaude
andcommitted
Rename _rebind_query_planner to _export_query_planner
The method rebinds nothing. It imports whatever a `__datafusion_session_planner__` hook returned — an object exposing the getter or a raw capsule — and hands back a capsule, so the next hook receives one either way; its own doc comment already said "re-export". Meanwhile "rebind" means something specific and different in this file: rebuilding an installed planner against a handle's codec chains, which is what `set_session_query_planner` does. Freeing the word keeps the two apart. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent f7c448e commit 0712eff

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎crates/core/src/context.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ impl PySessionContext {
16881688
/// not have to branch on which. Importing here also surfaces a malformed
16891689
/// planner at the hook that produced it rather than at the final install.
16901690
/// Writes nothing.
1691-
pub fn _rebind_query_planner<'py>(
1691+
pub fn _export_query_planner<'py>(
16921692
slf: &Bound<'py, Self>,
16931693
planner: Bound<'py, PyAny>,
16941694
) -> PyDataFusionResult<Bound<'py, PyCapsule>> {

‎python/datafusion/context.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ class as :py:meth:`with_logical_extension_codec` describes. Declare
19861986
supplied = extension.__datafusion_session_planner__(new, fallback)
19871987
if supplied is None:
19881988
continue
1989-
planner = new.ctx._rebind_query_planner(supplied)
1989+
planner = new.ctx._export_query_planner(supplied)
19901990

19911991
# Rebinding the session's planner is a side effect on state shared with
19921992
# every other handle, so do not pay it for a call that installs nothing

‎python/tests/test_wrapper_coverage.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
# gap in coverage.
3434
PRIVATE_SUPPORT_METHODS = frozenset(
3535
{
36-
# The three phases of SessionContext.with_extensions: install the
37-
# codecs, normalize each planner hook's return value, commit the
38-
# planner.
36+
# The three steps of SessionContext.with_extensions: install the
37+
# codecs, re-export each planner hook's return value as a capsule,
38+
# commit the planner.
3939
"_install_extension_codecs",
40-
"_rebind_query_planner",
40+
"_export_query_planner",
4141
"_install_extension_planner",
4242
}
4343
)

0 commit comments

Comments
 (0)