You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: match the hook table against dispatch sites, not raw text
`test_hook_reference_table_lists_every_hook` scanned every byte of
`crates/**.rs` and `python/datafusion/**.py` for `__datafusion_*__`, so
comments and docstrings counted as evidence a hook exists. A doc-comment
contrasting a hook with one that was removed, or naming a hypothetical,
would have had to be deleted or added to the guide's table, and neither
is right.
Count sites instead. On the Rust side a site is a string literal holding
nothing but the hook name -- what `hasattr`, `getattr`, and
`call_capsule_getter` are handed -- or a `fn` of that name, which is a
hook the host implements itself. Error strings that merely embed a name
no longer count; each already sits beside a real lookup.
On the Python side, read the syntax tree rather than the text: a method
being defined, an attribute being accessed, or a string standing alone.
A docstring is one string node holding the whole docstring, so prose
drops out without a rule of its own.
The dispatched set is unchanged at 18, still matching the table exactly.
Verified in both directions: a comment naming a removed hook now passes,
while adding a real lookup for an undocumented name still fails.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments