feat: allow da bulk access to return da for document#803
Merged
JohannesMessner merged 4 commits intoNov 17, 2022
Conversation
Member
|
What happens in the following case? from docarray import Text
class Mmdoc(BaseDocument):
text: DocumentArray[Text]
da = DocumentArray[Mmdoc](
(Mmdoc(text=DocumentArray([Text(text='hello') for _ in range(5)]) for _ in range(10)))
)
assert da.text == ???From reading the code it looks like it would return a list of DocumentArrays. Is this already supported? If yes, can we have a test for it? |
Member
Author
|
Yes this will return a list of document array. Is this the behavior we want to have ? I believe yes |
9ece60c to
808acf9
Compare
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
808acf9 to
efa4513
Compare
JohannesMessner
approved these changes
Nov 17, 2022
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
since #790 we can already do
never the less it always return a list of item for the field, even if the field is suppose to contain
Document. In this case this should return aDocumentArrayinstead of aListofDocumentWhat this pr do
When the nested field is a Document it returns a
DocumentArrayinstead of aListofDocument