-
Notifications
You must be signed in to change notification settings - Fork 64
Description
π Describe the bug
There is a logical error in the DurableOrchestrationContext
call_http
method.
content
is type hinted as a str
, however it only works with dictionary input.
I noticed this error when turning on type checking within VS Code.
To satisfy the type checker, I tried piping the dictionary object through json.dumps()
, but that led to an error during execution.
π€ Expected behavior
This should work with either dictionary or string input. It only works with dictionary input.
β Steps to reproduce
Construct an arbitrary payload
with key-value pairs.
context.call_http(method='POST', content=payload, uri=my_uri)
succeeds
context.call_http(method='POST', content=json.dumps(payload), uri=my_uri)
fails
Line 239 is responsible for the error: https://github.com/Azure/azure-functions-durable-python/blob/dev/azure/durable_functions/models/DurableOrchestrationContext.py#L239
The line:
if content and content is not isinstance(content, str):
should instead be:
if content and not isinstance(content, str):