-
Notifications
You must be signed in to change notification settings - Fork 234
feat: reduce and update methods for DocumentArray and BaseDocument #1076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Joan Fontanals Martinez <[email protected]>
Signed-off-by: Joan Fontanals Martinez <[email protected]>
Signed-off-by: Joan Fontanals Martinez <[email protected]>
f9c9360 to
663869c
Compare
Signed-off-by: Joan Fontanals Martinez <[email protected]>
663869c to
5c439b8
Compare
Signed-off-by: Joan Fontanals Martinez <[email protected]>
45f4793 to
a517a33
Compare
Signed-off-by: Joan Fontanals Martinez <[email protected]>
cbf692d to
d89ae6c
Compare
Signed-off-by: Joan Fontanals Martinez <[email protected]>
d89ae6c to
5bb4262
Compare
Signed-off-by: Joan Fontanals Martinez <[email protected]>
docarray/base_document/document.py
Outdated
| elif ( | ||
| isinstance(field_type, _GenericAlias) | ||
| and field_type.__origin__ is list | ||
| ): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what Python version are u referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
|
📝 Docs are deployed on https://ft-feat-reduce-v2--jina-docs.netlify.app 🎉 |
Goals:
Implement
reducemethods inutils