-
Hello! Consider the following task definitions: from pyzeebe import ZeebeWorker, create_insecure_channel
channel = create_insecure_channel(hostname="localhost", port=26500)
worker = ZeebeWorker(channel)
@worker.task(task_type="example")
def example_task_var(input: str) -> dict:
return {"output": f"Hello world, {input}!"}
@worker.task(task_type="extended_example")
def example_task_var_and_kwargs(input: str, **kwargs) -> dict:
return {"output": f"Hello world, {input}!"} From these, I would expect the following: # This is fine and expected
assert task1.config.variables_to_fetch == ["input"], task1.config.variables_to_fetch
# Here, while we can't specify all the possible variables. We do know about 'input'.
assert task2.config.variables_to_fetch == ["input"], task2.config.variables_to_fetch However, it returns empty:
Any ideas on what might be reasoning behind this choice?Here's the source code: Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi. It's empty because of pyzeebe retrieve all variables when |
Beta Was this translation helpful? Give feedback.
Hi. It's empty because of pyzeebe retrieve all variables when
kwargs
is present (andvariables_to_fetch
is passed to ActivateJobsRequest, because of emptyfetchVariable
retrieves all variables). See https://github.com/camunda-community-hub/pyzeebe/blob/master/pyzeebe/function_tools/parameter_tools.py#L10