diff --git a/CHANGES/1772.bugfix.rst b/CHANGES/1772.bugfix.rst new file mode 100644 index 00000000..084915d0 --- /dev/null +++ b/CHANGES/1772.bugfix.rst @@ -0,0 +1 @@ +Fixed Pydantic protected namespace warning for `model_custom_emoji_id` by adding `protected_namespaces=()` to `model_config`. diff --git a/aiogram/types/base.py b/aiogram/types/base.py index 7e47b564..ce75e84a 100644 --- a/aiogram/types/base.py +++ b/aiogram/types/base.py @@ -1,10 +1,9 @@ from typing import Any from unittest.mock import sentinel -from pydantic import BaseModel, ConfigDict, model_validator - from aiogram.client.context_controller import BotContextController from aiogram.client.default import Default +from pydantic import BaseModel, ConfigDict, model_validator class TelegramObject(BotContextController, BaseModel): @@ -16,6 +15,7 @@ class TelegramObject(BotContextController, BaseModel): populate_by_name=True, arbitrary_types_allowed=True, defer_build=True, + protected_namespaces=(), ) @model_validator(mode="before")