Azure / azure-functions-durable-python

Python library for using the Durable Functions bindings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please support the underscore character as a binding name

danielniccoli opened this issue · comments

The following code will result in the error: The binding name hello_city is invalid. Please assign a valid name to the binding.

# Orchestrator
@myApp.orchestration_trigger(context_name="context")
def hello_orchestrator(context):
    result1 = yield context.call_activity("hello", "Seattle")
    result2 = yield context.call_activity("hello", "Tokyo")
    result3 = yield context.call_activity("hello", "London")

    return [result1, result2, result3]

# Activity
@myApp.activity_trigger(input_name="hello_city")
def hello(hello_city: str):
    return f"Hello {hello_city}"

PEP8 suggests the use of snake_case. Hence underscores should be supported when writing durable functions in Python. Please add support for snake_case in binding names.