<#5640 [BUG] flytekit fails when uppercase letters...
# flytekit
a
#5640 [BUG] flytekit fails when uppercase letters are used in workflow input names Issue created by ddl-rliu Proposed fix: flyteorg/flytekit#2656 Describe the bug When uppercase letters are used in workflow input names, e.g.
A
, 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:
Copy code
$ 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.
Copy code
$ 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
Copy code
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/flyte