Skip to content

Commit a9df02b

Browse files
timsaucerclaude
andcommitted
refactor: split the commit rule from the planner-rebinding note
The rule that everything after the planner install must be infallible was tacked onto the end of a comment arguing something else -- why the rebind is guarded on a call that installs nothing. Two unrelated arguments in one block, with the more important of the two reading as a footnote to the other. Give it its own block. Its pointer at the reasoning was a `:ref:` role, which renders nowhere from a `#` comment and leaves a reader who follows it holding a label with no way to resolve it. Name the file and the heading instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 659cda7 commit a9df02b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎python/datafusion/context.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,11 +2245,14 @@ def with_extensions(
22452245
# it already holds, so the rebuild is unobservable except in the one case
22462246
# where it does harm: a planner sitting on some *other* handle's codecs
22472247
# gets dragged onto this handle's, silently undoing that install.
2248-
# Everything below this line must be infallible. A registration whose
2249-
# commit can fail belongs above, split into an import step that returns
2250-
# a resolved object and an insert step that cannot raise -- there is one
2251-
# session here, shared with the receiver, so a failure part-way through
2252-
# has nothing to roll back to. See :ref:`ffi_internals_commit_order`.
2248+
2249+
# Commit. Everything below this line must be infallible. A registration
2250+
# whose commit can fail belongs above, split into an import step that
2251+
# returns a resolved object and an insert step that cannot raise --
2252+
# there is one session here, shared with the receiver, so a failure
2253+
# part-way through has nothing to roll back to. The reasoning is in
2254+
# docs/source/contributor-guide/ffi-internals.md, under "Why
2255+
# `with_extensions` commits last".
22532256
if planner is not None or logical_codecs or physical_codecs:
22542257
new.ctx._install_extension_planner(planner)
22552258
for register, functions in resolved:

0 commit comments

Comments
 (0)