Skip to content

Commit 6bf48e7

Browse files
timsaucerclaude
andcommitted
style: tidy wording in _resolve_declared_functions
The unusable-declaration error rendered "must be a AggregateUDF" for two of the three kinds; dropping the article reads correctly for all of them. The collision branch carried a seven-line argument for keying on position rather than object identity, duplicating what the extension guide already argues. State the constraint and point at `extension_bundles_collisions` instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f05b808 commit 6bf48e7

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

python/datafusion/context.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,19 +331,15 @@ def _resolve_declared_functions(
331331
wrapped = factory(function)
332332
else:
333333
msg = (
334-
f"A declared {label} must be a {wrapper.__name__} or expose "
334+
f"A declared {label} must be {wrapper.__name__} or expose "
335335
f"{getter}, got {function!r} from {extension!r}"
336336
)
337337
raise TypeError(msg)
338338
name = wrapped.name
339339
if name in claimed:
340-
# Position, not object identity: what the caller controls is the
341-
# argument list, and two entries in it are two installs whether or
342-
# not they are the same object. The distinction the message needs
343-
# is which remedy exists. One argument colliding with itself is a
344-
# bundle author's own bug, and only they can rename a function;
345-
# two arguments colliding is the caller's to resolve, and renaming
346-
# is not among the things a caller can do.
340+
# Keyed on position, not object identity, so each message names
341+
# the remedy its reader actually has — see
342+
# `extension_bundles_collisions` in the extension guide.
347343
claimed_at, claimed_by = claimed[name]
348344
if claimed_at == position:
349345
msg = (

0 commit comments

Comments
 (0)