feat: reduce and update methods for DocumentArray and BaseDocument#1076
feat: reduce and update methods for DocumentArray and BaseDocument#1076JoanFM merged 12 commits intofeat-rewrite-v2from
Conversation
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
f9c9360 to
663869c
Compare
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
663869c to
5c439b8
Compare
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
45f4793 to
a517a33
Compare
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
cbf692d to
d89ae6c
Compare
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
d89ae6c to
5bb4262
Compare
Signed-off-by: Joan Fontanals Martinez <joan.martinez@jina.ai>
docarray/base_document/document.py
Outdated
| elif ( | ||
| isinstance(field_type, _GenericAlias) | ||
| and field_type.__origin__ is list | ||
| ): |
There was a problem hiding this comment.
I am wondering if this will work with newer python version where you can pass list instead of List as a valid type hint ?
There was a problem hiding this comment.
what Python version are u referring to?
There was a problem hiding this comment.
in python 3.9 you can do
class A:
b: list[inŧ]instead of
class A:
b: List[int]I am almost sure they have maintain compatibility with older version but the fact that we are using a private object from the typing library tell me that we are not 100% sure we will support this new way.
Maybe there is a way not to use the _GenericAlias since it is private ?
There was a problem hiding this comment.
Oh actually we can use
from typing_inspect import is_generic_typewe already rely on this library for some type hint things and they make sure that their function are compatible with every python version
There was a problem hiding this comment.
can u propose a PR on top of mine to do this? I am not sure what u are intending to tell. I did trial and error until I found the working formula
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
|
📝 Docs are deployed on https://ft-feat-reduce-v2--jina-docs.netlify.app 🎉 |
Goals:
Implement
reducemethods inutils