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

Consider renaming "model_type" discriminator #120

Open
rafa-guedes opened this issue Oct 11, 2024 · 2 comments
Open

Consider renaming "model_type" discriminator #120

rafa-guedes opened this issue Oct 11, 2024 · 2 comments

Comments

@rafa-guedes
Copy link
Collaborator

/home/rguedes/.virtualenvs/xbeach/lib/python3.10/site-packages/pydantic/_internal/fields.py:132: UserWarning: Field "model_type" in BaseInterpolator has conflict with protected namespace "model".

@rafa-guedes
Copy link
Collaborator Author

This is linked to pydantic/pydantic#7121. We are actually already setting the protected_namespaces parameter in RompyBaseModel, this particular warning was just because I didn't inherit BaseInterpolator from RompyBaseClass.

We may still want to consider renaming model_type though, up for discussion.

@rafa-guedes
Copy link
Collaborator Author

Still on this topic of confusing / conflicting namespaces, we use in rompy "model" and "config" broadly which have specific meaning in pydantic itself. Should we consider changing these to something a bit more distinguishable? For example, config in rompy could be renamed into setup. Thoughts @tomdurrant @benjaminleighton ?

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

No branches or pull requests

1 participant