Skip to content
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

feat: add config to load more field that the schema #1437

Merged
merged 8 commits into from
Apr 26, 2023
Merged

Conversation

samsja
Copy link
Member

@samsja samsja commented Apr 24, 2023

Context

the goal of this pr is to allow AnyDoc to load any protobuf file without knowing the class beforehand

code example :

from docarray.base_doc.any_doc import AnyDoc

doc = AnyDoc(hello='world')

print(f"doc= \n {doc}")
pt = doc.to_protobuf()
print(f"pt= \n {pt}")
doc2 = AnyDoc.from_protobuf(pt)
print(f"doc2= \n {doc2}")
assert doc2.dict()['hello'] == 'world'

Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
samsja and others added 4 commits April 24, 2023 18:23
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
@github-actions github-actions bot added size/m and removed size/s labels Apr 26, 2023
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
@samsja samsja marked this pull request as ready for review April 26, 2023 07:59
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
@github-actions
Copy link

📝 Docs are deployed on https://ft-fix-proto-anydoc--jina-docs.netlify.app 🎉

@samsja samsja merged commit 83e7384 into main Apr 26, 2023
@samsja samsja deleted the fix-proto-anydoc branch April 26, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants