Skip to content

Conversation

@isabelizimm
Copy link
Contributor

resolves #184

@isabelizimm
Copy link
Contributor Author

Tests are failing as there's increased type specificity (particularly with numpy self-reporting types rather than pydantic choosing the type). These changes are work for both pydantic<2.0 and pydantic>2.0, so we shouldn't have to worry about backwards compatibility.

All changes are internal. The main changes are in prototypes and API
errors. Prototypes now are created from dictionaries of tuples of (type, value). API errors are now a list of dictionaries, giving the type, location, error message, erroneous input, and a url to pydantic's website with more about the error.
@isabelizimm
Copy link
Contributor Author

For now, spacy is not compliant with pydantic v2. These changes will give some deprecation warnings in tests, but overall are v1 and v2 compatible.

@isabelizimm isabelizimm marked this pull request as ready for review July 25, 2023 01:30
@isabelizimm isabelizimm changed the title Update Pydantic usage Update Pydantic usage for v2 compatibility Jul 25, 2023
python -m pip install xgboost
python -m pip install spacy
python -m pip install torch
python -m pip install statsmodels
Copy link
Contributor Author

@isabelizimm isabelizimm Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is effectively the same as python -m pip install -e ".[dev,all_models]", but Python 3.7 will not complete installation, ending in an OSError saying there is not enough space 😩 this is likely due to some pretty intense dependency resolution.

I'll likely want to rethink this strategy, but that can come in a separate PR.

python -m pip install spacy
python -m pip install torch
python -m pip install statsmodels
python -m pip install typing_extensions==4.7.1
Copy link
Contributor Author

@isabelizimm isabelizimm Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned due to fastapi requirements. fastapi/fastapi#9808

@isabelizimm isabelizimm merged commit 68635e7 into main Jul 26, 2023
@isabelizimm isabelizimm deleted the ptype-compat branch July 26, 2023 14:48
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.

pydantic v2.0 breaking prototypes

1 participant