acoustic-carpenter-78188
01/26/2024, 10:16 AMfrom flytekit import task, workflow
import os
@workflow
def workflow() -> None:
print([key for key in os.environ])
print(os.environ["DUMMY_KEY"])
return None
Which can be run with
pyflyte run --envvars '{"DUMMY_KEY"="DUMMY_VALUE"}' main.py workflow
or
pyflyte run --env '{"DUMMY_KEY"="DUMMY_VALUE"}' main.py workflow
Both result in failure:
Failed with Unknown Exception <class 'KeyError'> Reason: "Error encountered while executing 'workflow':\n 'DUMMY_KEY'"
"Error encountered while executing 'workflow':\n 'DUMMY_KEY'"
Due to the line at print(os.environ["DUMMY_KEY"]) and no presence of DUMMY_KEY in the list of os.ENVIRON
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
01/26/2024, 10:16 AM