acoustic-carpenter-78188
08/09/2024, 11:46 PMA
, it correctly generates a corresponding pyflyte workflow option flag --A
, however the final workflow definition expects the input name a
, which is lower case and thus leads to the following failing behavior:
$ pyflyte run --remote wf.py wf --A 1
Failed with Unknown Exception <class 'flytekit.core.type_engine.TypeTransformerFailedError'>
Reason: Python value cannot be None, expected <class 'int'>/<FlyteLiteral(LiteralType) simple: INTEGER>
Expected behavior
One solution is to implement a fix which allows uppercase letters, however the click
library, specifically click.Option
, automatically lowercases option names. Therefore, a naive workaround may lead to other unintended/strange behaviors.
Another solution, and the one proposed here – flyteorg/flytekit#2656 – is to add validation in flytekit to disallow uppercase letters in workflow input names. So uppercase letters will still cause an error, but the error message is much more sensible/actionable.
$ pyflyte run --remote wf.py wf --A 1
Failed with Unknown Exception <class 'ValueError'> Reason: Input name must be lowercase: 'A'
Additional context to reproduce
from flytekit import task, workflow
@task
def report_all_calculated_areas(
area_shell: float,
):
print(f"shell: area={area_shell}")
@workflow
def wf(A: float):
report_all_calculated_areas(
area_shell=A,
)
pyflyte run --remote wf.py wf --A 1
Screenshots
No response
Are you sure this issue hasn't been raised already?
• Yes
Have you read the Code of Conduct?
• Yes
flyteorg/flyteacoustic-carpenter-78188
08/09/2024, 11:46 PM