fix: better generic support in document array stack#1147
Merged
samsja merged 12 commits intofeat-rewrite-v2from Feb 20, 2023
Merged
fix: better generic support in document array stack#1147samsja merged 12 commits intofeat-rewrite-v2from
samsja merged 12 commits intofeat-rewrite-v2from
Conversation
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>
|
📝 Docs are deployed on https://ft-fix-generic--jina-docs.netlify.app 🎉 |
anna-charlotte
approved these changes
Feb 20, 2023
Jackmin801
reviewed
Feb 20, 2023
| def __class_getitem__(cls, item: Type[BaseDocument]): | ||
| def __class_getitem__(cls, item: Union[Type[BaseDocument], TypeVar, str]): | ||
| if not isinstance(item, type): | ||
| return Generic.__class_getitem__.__func__(cls, item) # type: ignore |
Contributor
There was a problem hiding this comment.
How did you know this is what is required?
Member
There was a problem hiding this comment.
is this even doing anything?
Member
Author
There was a problem hiding this comment.
is this even doing anything?
this is not doing anything else than checking the the item is valid Generic. I think it does not harm to keep it
Contributor
There was a problem hiding this comment.
is this even doing anything?
this is not doing anything else than checking the the
itemis valid Generic. I think it does not harm to keep it
Crashed in Python 3.12.0
return Generic.__class_getitem__.__func__(cls, item) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'builtin_function_or_method' object has no attribute '__func__'. Did you mean: '__doc__'?
Jackmin801
approved these changes
Feb 20, 2023
Contributor
Jackmin801
left a comment
There was a problem hiding this comment.
Tried with pydantic generic model. Seems to work
This was referenced Dec 22, 2023
954-Ivory
added a commit
to 954-Ivory/docarray
that referenced
this pull request
Dec 22, 2023
954-Ivory
added a commit
to 954-Ivory/docarray
that referenced
this pull request
Dec 22, 2023
Signed-off-by: 954 <510485871@qq.com>
954-Ivory
added a commit
to 954-Ivory/docarray
that referenced
this pull request
Dec 22, 2023
Signed-off-by: 954 <510485871@qq.com> fix: judge based on Python version Signed-off-by: 954 <510485871@qq.com> fix: format for black Signed-off-by: 954 <510485871@qq.com>
954-Ivory
added a commit
to 954-Ivory/docarray
that referenced
this pull request
Dec 22, 2023
Signed-off-by: 954 <510485871@qq.com>
954-Ivory
added a commit
to 954-Ivory/docarray
that referenced
this pull request
Dec 22, 2023
Signed-off-by: 954 <510485871@qq.com>
JoanFM
pushed a commit
that referenced
this pull request
Dec 22, 2023
Closed
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.
Context
Make AbstractArray a generic compatbile with type var and string
fix this : #1146
this work now