kaxil opened a new pull request, #74380:
URL: https://github.com/apache/airflow/pull/74380
Stacked on #74379. Until that merges, this diff also shows its commit; the
change here is the last commit.
`HookToolset(pinned_arguments=...)` leaves a pinned argument out of the
schema the model sees and refuses it if the model sends it anyway. The refusal
is meant to tell the model the argument is fixed. That only happened for
methods that also take `**kwargs`. For an ordinary method with named
parameters, such as `S3Hook.read_key`, the toolset's argument validator was
built from the trimmed schema, so it rejected the pinned name first. The model
got a generic pydantic error instead:
```
[{'type': 'extra_forbidden', 'loc': ('bucket_name',), 'msg': 'Extra inputs
are not permitted', 'input': 'acme-payroll'}]
```
The validator is now built from a copy of the schema that still accepts the
pinned names as optional. A model that sends one reaches `execute_tool` and
gets `bucket_name is fixed for this tool: call it again without it.`, whatever
the method's signature. What the model is shown is unchanged, and the pinned
value is still the one passed to the hook.
The existing real-run test now covers both signatures, and the
named-parameter case fails without the fix. The hook guide's pinned-argument
paragraph and the captured refusal in its "Restricting the agent" section are
updated to the new message, recaptured from the example Dag running through
`AgentOperator`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]