| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
There was a problem hiding this comment.
Okay first pass done, I have few questions and will probably make a more thorough pass tomorrow!
Sorry, something went wrong.
| from pydantic.validators import bytes_validator | ||
|
|
||
| else: | ||
| from pydantic.v1.validators import bytes_validator |
There was a problem hiding this comment.
Am I understanding correctly that we are falling back to the bytes validator of v1 even if pydantic v2 is used? What is the reason behind this?
Sorry, something went wrong.
There was a problem hiding this comment.
?
Sorry, something went wrong.
| if is_pydantic_v2: | ||
| raise NotImplementedError( | ||
| 'This method is not supported in Pydantic 2.0. Please use Pydantic 1.8.2 or lower.' | ||
| ) | ||
|
|
There was a problem hiding this comment.
Why is this?
Sorry, something went wrong.
There was a problem hiding this comment.
the method we used has been removed from pydantic v2, will have to find a fix later
Sorry, something went wrong.
|
|
||
| if is_pydantic_v2: | ||
|
|
||
| IncEx: typing_extensions.TypeAlias = ( |
There was a problem hiding this comment.
What does IncEx stand for?
Sorry, something went wrong.
There was a problem hiding this comment.
this is the named used in pydantic function signature. Not even sure what this means
Sorry, something went wrong.
There was a problem hiding this comment.
okay
Sorry, something went wrong.
| json_encoders = {AbstractTensor: lambda x: x} | ||
| if is_pydantic_v2: | ||
|
|
||
| class Config: |
There was a problem hiding this comment.
Should we still have this Config inner class, it is not recommended anymore in v2, right?
Also, where did the orjson stuff and the extra protobuf setting go?
Sorry, something went wrong.
There was a problem hiding this comment.
good question,
basically now in pydantic v2 this way is "deprecated". But at the same time, it is still working. Therefore if we keep it as a class it means we don't have to repeat the config for pydantic v2. Might be easier to maintain ...
Sorry, something went wrong.
There was a problem hiding this comment.
Also, where did the orjson stuff and the extra protobuf setting go?
This is handle differently with pydantic v2 and therefore not needed
Sorry, something went wrong.
There was a problem hiding this comment.
hmm, using deprecated stuff is not great. Does it raise a warning?
Sorry, something went wrong.
There was a problem hiding this comment.
it does indeed raise a warning ...
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
Co-authored-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
There was a problem hiding this comment.
the only thing that feels icky to me is using the deprecated Config inner class
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
I will go with @JohannesMessner proposal and switch to ConfigDict instead of class |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
|
📝 Docs are deployed on https://ft-feat-full-pydantic-v2-support--jina-docs.netlify.app 🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Context
this PR allow support for pydantic v2 and v1 at the same time
Note: it is still very early progress