Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve protected_namespaces warning for pydantic #1834

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

sindhuvahinis
Copy link
Contributor

Description

In Pydantic v2, the default protected namespace is model_, causing warnings in logs when properties like model_id_or_path are used. However, model_id_or_path doesn't conflict with any Pydantic BaseModel configurations.

This issue also suppresses errors when overriding Pydantic configurations like model_validate. The Machine Learning community has raised concerns, suggesting that Pydantic shouldn't restrict users from using model_, hinting at potential changes in Pydantic v3.

Currently, we're addressing this by setting properties_namespaces to an empty tuple, eliminating warnings since model_id_or_path doesn't override any core Pydantic methods.

@sindhuvahinis sindhuvahinis requested review from zachgk, frankfliu and a team as code owners April 29, 2024 18:49
@sindhuvahinis sindhuvahinis merged commit d8ba407 into deepjavalibrary:master Apr 29, 2024
8 checks passed
@sindhuvahinis sindhuvahinis deleted the py branch May 3, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants