Skip to content

Error due to output binding checks in dispatcher.py #608

@priyaananthasankar

Description

@priyaananthasankar

The Durable Orchestration trigger typically has a function.json that looks like this

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "name": "context",
      "type": "orchestrationTrigger",
      "direction": "in",
      "dataType": "string"
    }
  ],
  "disabled": false
}

This does not have output binding and so it fails in dispatcher.py with this error message:
f'function {fi.name!r} without a $return binding '

Added these checks but these are causing regression in HTTP Triggers and other further scenarios for Durable

#if call_result is not None and not fi.has_return:
            #    raise RuntimeError(
            #        f'function {fi.name!r} without a $return binding '
            #        f'returned a non-None value')
 

And we have added an additional check in lines 344-349 where if the return type is None, we just define a dummy return binding and send it back

else:
                ret_binding_name = "ret_binding_name"
                ret_pytype = typing.Any
                return_value = bindings.to_outgoing_proto(
                    ret_binding_name, call_result,
                    pytype=ret_pytype)

Need a fix in dispatcher.py that does not give the error with the given function.json above.

How to reproduce: Use the function.json above

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions