Skip to content

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

Merged
samsja merged 8 commits into
mainfrom
fix-proto-anydoc
Apr 26, 2023
Merged

feat: add config to load more field that the schema#1437
samsja merged 8 commits into
mainfrom
fix-proto-anydoc

Conversation

@samsja

@samsja samsja commented Apr 24, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown

📝 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.

2 participants