Closed
Conversation
| ; library (mostly models). | ||
| langcodes>=3.2.0 | ||
| pydantic[dotenv,email]>=1.10.0, <2.0 | ||
| pydantic[email]>=2.1.1, <3.0 |
Contributor
There was a problem hiding this comment.
Suggested change
| pydantic[email]>=2.1.1, <3.0 | |
| pydantic[email]>=2.1.1 |
|
|
||
| class ESDatabaseBackendSettings(InstantiableSettingsItem): | ||
| """Pydantic modelf for Elasticsearch database backend configuration settings.""" | ||
| """Pydantic modelf for Elasticsearch database backend configuration settings.""" |
Contributor
There was a problem hiding this comment.
Suggested change
| """Pydantic modelf for Elasticsearch database backend configuration settings.""" | |
| """Pydantic model for Elasticsearch database backend configuration settings.""" |
| from enum import Enum | ||
| from pathlib import Path | ||
| from typing import List, Tuple, Union | ||
| from typing import Any, List, Tuple, Union |
Contributor
There was a problem hiding this comment.
Suggested change
| from typing import Any, List, Tuple, Union | |
| from typing import Any, List, Optional, Tuple, Union |
|
|
||
| try: | ||
| from typing import Literal | ||
| from typing import Annotated, Literal, Optional |
Contributor
There was a problem hiding this comment.
Suggested change
| from typing import Annotated, Literal, Optional | |
| from typing import Annotated, Literal |
| from typing import Annotated, Literal, Optional | ||
| except ImportError: | ||
| from typing_extensions import Literal | ||
| from typing_extensions import Annotated, Literal, Optional |
Contributor
There was a problem hiding this comment.
Suggested change
| from typing_extensions import Annotated, Literal, Optional | |
| from typing_extensions import Annotated, Literal |
| ; library (mostly models). | ||
| langcodes>=3.2.0 | ||
| pydantic[dotenv,email]>=1.10.0, <2.0 | ||
| pydantic[email]>=2.1.1, <3.0 |
Contributor
There was a problem hiding this comment.
Suggested change
| pydantic[email]>=2.1.1, <3.0 | |
| pydantic[email]>=2.2.0 |
Contributor
Author
|
replaced by #504 |
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.

Purpose
As mentionned in #401 , upgrading to pydantic 2 should greatly improve performances. Also it would allow projects depending on
ralph(such aswarren) to upgrade more easily.Dealing with common errors when migrating
ERROR: Extra not permitted
In
conf.py, errors such as:may be due to a change in default behavior in models
extra=ignoretoextra=failure. We may set this parameter manually to fix this issue.ERROR: Unable to generate pydantic-core schema
To fix this we change the way we define classes.
Previously in Ralph
New in Ralph
ERROR: Missing values
A recurrent error is the one below, which should be linked to the change of behavior when using
Optional[...]in Pydantic V2. Previously, it would assign a default value ofNone, which is no longer the case. This should have been dealt with bybump-pydanticbut was not always the case. It would be nice to know why before confirming this solution.Previously in Ralph
New in Ralph