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

Version >2.6 of Pydantic require Field names to be different from type annotations #67

Open
benjaminleighton opened this issue Feb 2, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@benjaminleighton
Copy link
Collaborator

https://docs.pydantic.dev/2.6/errors/usage_errors/#unevaluable-type-annotation

This happens for example in

MARCO: MARCO = MARCO()

because

MARCO the type is potentially confused with MARCO the field name on the COSINE class one of the ways to resolve this is
to define a new variable to hold the type/class with a different name and use that like

MARCO_AS_TYPE = MARCO
...
MARCO: MARCO_AS_TYPE = Field(..., description="MARCO parameters")

@benjaminleighton benjaminleighton added the bug Something isn't working label Feb 2, 2024
@tomdurrant
Copy link
Collaborator

Ok, noted. These namelists are not currently used, so let me now if this is causing any issues with the current CSIRO implementation, if so, I'll just remove the imports, otherwise, I will wait for the full namelist implementation to fix

@tomdurrant tomdurrant added this to the wp3 milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants