Closed gregbugaj closed 1 year ago
Initial implementation allows us to use @safely_encoded
decorator however it has to be a first decorator in the chain. This should be generic decorator and not tied to the @request
decorator.
@requests
@safely_encoded
def encoded(self, docs, **kwargs):
return {}
Additionally we are able to return arraylike
objects from methods decorated with @request
@requests
def encoded(self, docs, **kwargs):
return [{"a":1}, {"b":2}]
Data needs to be safely encoded for transmission where there is a Numpy objects present.
Example return data will throw an Error:
Exception :
Proposed is
@safely_encoded
decorator that will get our data ready for transmission by converting Object to JSON and back to Object.