Skip to content

Commit 486ea01

Browse files
vdusekclaude
andauthored
chore: access model_fields from class instead of instance (#800)
## Summary - Access `model_fields` from the class (`type(configuration).model_fields`) instead of the instance (`configuration.model_fields`) in `Configuration.from_configuration` Since Pydantic V2.11, accessing `model_fields` on an instance emits a `PydanticDeprecatedSince211` deprecation warning (to be removed in V3.0). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8a345bd commit 486ea01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/apify/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def from_configuration(cls, configuration: CrawleeConfiguration) -> Configuratio
505505
# Due to known Pydantic issue https://github.com/pydantic/pydantic/issues/9516, creating new instance of
506506
# Configuration from existing one in situation where environment can have some fields set by alias is very
507507
# unpredictable. Use the stable workaround.
508-
for name in configuration.model_fields:
508+
for name in type(configuration).model_fields:
509509
setattr(apify_configuration, name, getattr(configuration, name))
510510

511511
return apify_configuration

0 commit comments

Comments
 (0)