feat: make DocList an actual Python List#1457
Conversation
f7a713f to
162bc1f
Compare
Signed-off-by: Joan Fontanals Martinez <[email protected]>
162bc1f to
ba6f5f9
Compare
| @@ -139,7 +142,7 @@ def _del_from_indices(self: T, item: Iterable[int]) -> None: | |||
| # each delete | |||
| del self._data[ix] | |||
samsja
left a comment
There was a problem hiding this comment.
but here we still have the _data things this looks weird no ?
|
this line is the problem docarray/docarray/index/abstract.py Line 424 in 8df9e7f after this change, it's always true we could do this if not isinstance(docs, DocList) and isinstance(docs, List): |
Signed-off-by: Joan Fontanals Martinez <[email protected]>
cefa41b to
65b89d5
Compare
…y/docarray into feat-make-doclist-a-list
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
| return super().__getitem__(item) | ||
|
|
||
| @classmethod | ||
| def __class_getitem__(cls, item: Union[Type[BaseDoc], TypeVar, str]): |
There was a problem hiding this comment.
I'd rather have this redefined at different inheritance levels
There was a problem hiding this comment.
not sure to understand how it will look like
There was a problem hiding this comment.
I do not quite understand this need? what super has another _class_getitem?
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
Signed-off-by: samsja <[email protected]>
|
📝 Docs are deployed on https://ft-feat-make-doclist-a-list--jina-docs.netlify.app 🎉 |
jupyterjazz
left a comment
There was a problem hiding this comment.
Nice! I'll try out fastapi integration now
| """Return all v @classmethod | ||
| def __class_getitem__(cls, item: Union[Type[BaseDoc], TypeVar, str]):alues of the fields from all docs this doc_list contains | ||
| @classmethod | ||
| def __class_getitem__(cls, item: Union[Type[BaseDoc], TypeVar, str]): | ||
| :param field: name of the fields to extract | ||
| :return: Returns a list of the field value for each document | ||
| in the doc_list like container |
There was a problem hiding this comment.
note for myself to correct this docstring in my fastapi PR
This PR needs to make sure that
DocListis a List, thus fixing the issue that I cannot callschemaof aBaseDochaving nestedDocList.