Closed alaeddine-13 closed 10 months ago
Patch coverage: 57.14%
and project coverage change: -1.06%
:warning:
Comparison is base (
35b1067
) 77.59% compared to head (3b0000d
) 76.53%. Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Currently this PR depends on an issue with @docarray: @docarray's UpdateMixin, only updates a document if the other document is exactly the same type. However, there are cases where 2 documents are generated from dynamic schemas that are exactly the same. Even though the fields are exactly the same, the update operation will fail because in docarray checks that the schemas belong to the same reference
:memo: Docs are deployed on https://feat-add-return-type-streamer--jina-docs.netlify.app :tada:
closes: https://github.com/jina-ai/jina/issues/6012
GatewayStreamer by default will fetch executor input and output schemas and reconstruct docarray models dynamically. The output schemas will be used to cast the responses at the gateway level. Although the casted responses are nearly identical to the original schemas defined at executor level, they might fail some checks, for instance, if the user defines a doc schema
MyDoc
, the following check will fail:assert isinstance(doc, MyDoc)
similarly, addingdoc
to a DocList[MyDoc] will fail the type checking.This PR allows the user of a GatewayStreamer to specify the return_type that will be used for casting and the output responses received from methods of the gateway streamer will match exactly the specified
return_type
.