cuddly-jelly-27016
10/11/2024, 3:50 PM1.13.6
, the workflow/task like below can handle empty dict.
from flytekit import task, workflow
@task
def print_dict(x: dict[str, str]) -> None:
for k, v in x.items():
print(f"{k}: {v}")
@workflow
def print_workflow() -> None:
print_dict(x={})
if name == "__main__":
print(f"Running print_workflow() {print_workflow()}")
With >=1.13.6
, the flyte will throw a TypeTransformerFailedError error:
% pyflyte run workflow.py print_workflow
Running Execution on local.
TypeTransformerFailedError: Failed to convert inputs of task 'workflow.print_dict':
Failed argument 'x': Not all values in '{}' are of type <class 'str'>
Expected behavior
The workflow/task should be able to accept empty dict like they used to in <1.13.6
. Unless this breaking change is intentional?
Additional context to reproduce
The cause of the error is due to this part of the code. Similar error will raise for empty list/tuple/set due to similar logic.
Screenshots
No response
Are you sure this issue hasn't been raised already?
• Yes
Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
10/11/2024, 3:50 PM