Merged
Conversation
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
Signed-off-by: samsja <sami.jaghouar@hotmail.fr>
|
📝 Docs are deployed on https://ft-feat-support-proto-3--jina-docs.netlify.app 🎉 |
Comment on lines
+3
to
+20
| if __pb__version__.startswith('4'): | ||
| from docarray.proto.pb.docarray_pb2 import ( | ||
| DocumentArrayProto, | ||
| DocumentArrayStackedProto, | ||
| DocumentProto, | ||
| NdArrayProto, | ||
| NodeProto, | ||
| UnionArrayProto, | ||
| ) | ||
| else: | ||
| from docarray.proto.pb2.docarray_pb2 import ( | ||
| DocumentArrayProto, | ||
| DocumentArrayStackedProto, | ||
| DocumentProto, | ||
| NdArrayProto, | ||
| NodeProto, | ||
| UnionArrayProto, | ||
| ) |
Member
There was a problem hiding this comment.
aren't these two exactly the same? or am I blind? 😅
Member
There was a problem hiding this comment.
Oh i see the difference now, nevermind
Member
Author
There was a problem hiding this comment.
this PR should be named "spot the difference"
Member
There was a problem hiding this comment.
nerd version of "where is waldo?"
anna-charlotte
approved these changes
Feb 3, 2023
JohannesMessner
approved these changes
Feb 3, 2023
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
the goal of this pr is to support both proto 3 and proto 4. Atm we only support proto 3.
details.
protobuf>= 3.19.0instead ofprotobuf>=4.21protoc 3 and 4 does not generate the same python code. Therefore if we use proto 3 to generate the
docarray_pb2.pyit will break when using proto 4 and vice versa.The solution to this problem is to generate the
docarray_pb2.pyfrom the proto two times. One with protoc3 and one with protoc4. Then the trick is to check which version of protobuf is installed during import of the proto file. And we serve the correct version