Skip to content

Commit

Permalink
Disable warns about extra fields (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX authored Dec 17, 2023
1 parent 9ca1b81 commit 0d7cd96
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion atproto/xrpc_client/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def __getitem__(self, item: str) -> t.Any:

@model_validator(mode='after')
def __alert_about_extra_fields(self) -> 'ModelBase':
if self.model_extra and os.environ.get('ATPROTO_LEXICON_WARN', '1') == '1':
# used for debugging purposes because gives false positives due to the way pydantic works

if self.model_extra and os.environ.get('ATPROTO_LEXICON_WARN', '0') == '1':
warnings.warn(
f'Extra fields found in the object of type {type(self)}: {self.model_extra}. ' # noqa: S608
f'Probably you are using the old version of SDK. '
Expand Down

0 comments on commit 0d7cd96

Please sign in to comment.