Skip to content

pydantic 2 #124

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

Closed
keul opened this issue Jul 10, 2023 · 2 comments
Closed

pydantic 2 #124

keul opened this issue Jul 10, 2023 · 2 comments

Comments

@keul
Copy link

keul commented Jul 10, 2023

Although this repository seems to not define any dependency, it uses pydantic.

I tried to migrate a stac_fastapi project to fastapi 0.100.0 and pydantic 2, but I've import errors:

  File "/Users/keul/mambaforge/envs/copds3.10/lib/python3.10/site-packages/stac_fastapi/types/core.py", line 9, in <module>
    from stac_pydantic.links import Relations
  File "/Users/keul/mambaforge/envs/copds3.10/lib/python3.10/site-packages/stac_pydantic/__init__.py", line 1, in <module>
    from .catalog import Catalog
  File "/Users/keul/mambaforge/envs/copds3.10/lib/python3.10/site-packages/stac_pydantic/catalog.py", line 5, in <module>
    from stac_pydantic.links import Links
  File "/Users/keul/mambaforge/envs/copds3.10/lib/python3.10/site-packages/stac_pydantic/links.py", line 59, in <module>
    class Links(BaseModel):
  File "/Users/keul/mambaforge/envs/copds3.10/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 95, in __new__
    private_attributes = inspect_namespace(
  File "/Users/keul/mambaforge/envs/copds3.10/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 279, in inspect_namespace
    raise TypeError("To define root models, use `pydantic.RootModel` rather than a field called '__root__'")
TypeError: To define root models, use `pydantic.RootModel` rather than a field called '__root__'

Pydantic 2 has been released. Any plan to migrate?

@keul
Copy link
Author

keul commented Jul 10, 2023

See also stac-utils/stac-fastapi#588

@gadomski
Copy link
Member

Closed by #127

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 a pull request may close this issue.

2 participants