support pydantic 2 in elementary#1426
Merged
Merged
Conversation
Contributor
|
👋 @ellakz |
ellakz
commented
Feb 22, 2024
| @@ -0,0 +1,32 @@ | |||
| """ | |||
Contributor
Author
There was a problem hiding this comment.
this is the main interesting change
ellakz
commented
Feb 22, 2024
| pytest-parametrization = ">=2022.2.1" | ||
| pydantic = "<2.0" | ||
|
|
||
| pydantic = "<3.0" |
Contributor
Author
There was a problem hiding this comment.
now we can also run with pydantic 2 but we actually use the pydantic 1 from it
ellakz
commented
Feb 22, 2024
| [mypy-posthog] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-pydantic] |
Contributor
Author
There was a problem hiding this comment.
not sure if there was another way to overcome mypy issues (it was angry at whichever version wasn't installed for my when I ran it)
4d1f163 to
b44b07e
Compare
ellakz
commented
Feb 22, 2024
| # NormalizedArtifactSchema must be first in the inheritance order | ||
| class NormalizedModelSchema(NormalizedArtifactSchema, ModelSchema): | ||
| artifact_type: str = Field("model", const=True) | ||
| artifact_type: str = Field("model", const=True) # type: ignore # noqa |
Contributor
Author
There was a problem hiding this comment.
unfortunately Field in pydantic 2 doesn't have a "const" field and that causes mypy to error. ignoring until we migrate to pydantic 2 for real
haritamar
approved these changes
Feb 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.