[UserWarning] Pydantic warning when using SequentialAgent due to attribute shadowing #2521
Replies: 1 comment
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: This is a known issue. You can suppress the Hello @pierregrothe, Thank you for reporting this. The As a workaround, you can suppress this specific warning by adding the following code to your application's entry point: import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="pydantic") This will prevent the warning from being displayed without affecting the functionality of the We will continue to monitor this and consider a more permanent solution in a future release. [1] https://github.com/google/adk-python/blob/main/src/google/adk/agents/sequential_agent.py |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've noticed a PydanticUserWarning is triggered when using the SequentialAgent class. It seems to be caused by attribute shadowing between the child SequentialAgent and its parent BaseAgent.
Environment:
Python Version: 3.13.6
Pydantic Version: 2.11.7
google-adk Version: 1.10.0
Problem Description:
When importing or instantiating the SequentialAgent, the following warning is displayed:
.../pydantic/_internal/_fields.py:198: UserWarning: Field name "config_type" in "SequentialAgent" shadows an attribute in parent "BaseAgent"
warnings.warn(
Expected Behavior:
The code should execute without raising any UserWarning from Pydantic, assuming the shadowing is intended and handled.
Actual Behavior:
The UserWarning is consistently logged to the console, creating unnecessary noise and potential confusion about which config_type attribute is being used.
Beta Was this translation helpful? Give feedback.
All reactions