Repository navigation
Let HookToolset pin arguments the model must not choose - #73900
Merged
kaxil merged 1 commit intoSep 30, 2026
Merged
Conversation
kaxil
added this pull request to stack #73905
September 29, 2026 12:49
kaxil
marked this pull request as ready for review
September 29, 2026 13:17
kaxil
force-pushed
the
commonai-hook-pinned-arguments
branch
2 times, most recently
from
September 29, 2026 20:07
cef8491 to
b1245b7
Compare
vatsrahul1001
approved these changes
Sep 30, 2026
pinned_arguments fixes values such as the bucket a storage hook may read. A pinned argument is left out of the schema the model sees, passed to every allowed method, and refused if the model supplies it anyway. Every allowed method has to take each pinned argument by name: one that takes the same thing under another name, in a dict or through **kwargs would let the model choose it after all, so the toolset refuses to be built with it.
kaxil
force-pushed
the
commonai-hook-pinned-arguments
branch
from
September 30, 2026 06:01
b1245b7 to
42c514c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HookToolsetexposes the hook methods inallowed_methods, and until now the model chose every argument of those methods, including the ones that decide what it can reach, such as the bucket a storage hook reads.pinned_argumentsfixes those values:A pinned argument is left out of the schema the model sees and passed to every call. If the model supplies it anyway, the call is refused with an error it can read, rather than silently using the model's value. Each call gets its own copy of a pinned value, so a hook method that mutates a list or dict cannot change what the next call receives.
Pinning fails closed. Every method in
allowed_methodsmust name every pinned argument as a parameter it accepts by keyword, or the toolset raisesValueErrorwhen it is created. The alternative, skipping methods that don't take a pin, would leave the model free to choose that value on exactly the methods the Dag author didn't check, such as acopy_objectwhose destination bucket goes by another name.pinned_argumentsis experimental and listed on the stability page.A scripted model that tries to set the pinned
regiongets a validation error back, andlist_accountsruns with the pinnedemea:{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.