-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Error in workflow compilation logic for special variable names #5511
Comments
According to the Flyte documentation, Flyte supports defining task inputs and outputs using the Describe the bugWhen defining a Expected behaviorThere are two potential options for handling this:
Reproduction Steps
Example Codeimport logging
from flytekit import ContainerTask, kwtypes, task, workflow
logger = logging.getLogger(__file__)
calculate_ellipse_area_shell = ContainerTask(
name="ellipse-area-metadata-shell",
input_data_dir="/var/inputs",
output_data_dir="/var/outputs",
inputs=kwtypes(**{"my.value": float, "c": float}),
outputs=kwtypes(area=float, metadata=str),
image="ghcr.io/flyteorg/rawcontainers-shell:v2",
command=[
"./calculate-ellipse-area.sh"
],
)
@task
def report_all_calculated_areas(
area_shell: float,
metadata_shell: str,
):
logger.info(f"shell: area={area_shell}, metadata={metadata_shell}")
@workflow
def wf(a: float, b: float):
area_shell, metadata_shell = calculate_ellipse_area_shell(**{"my.value": a, "c": b})
report_all_calculated_areas(
area_shell=area_shell,
metadata_shell=metadata_shell,
) Actual Behavior
Sources:This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not. Mention @RunLLM to ask follow-up questions. See runllm.com for more! |
agreed. Workflow should fail at compile time at step 1. |
I believe this is resolved as per flyteorg/flytekit#2538 Thanks! |
Thank you! |
Describe the bug
Compile-time validation is inconsistent between workflow run and workflow re-run. Minimal repro:
Special attention on the lines:
inputs=kwtypes(**{"my.value": float, "c": float})
andcalculate_ellipse_area_shell(**{"my.value": a, "c": b})
Actual behavior:
Failed to run the Node: Failed to create the execution: failed to compile workflow for [resource_type:WORKFLOW project:"x" domain:"development" name:".flytegen.ellipse-area-metadata-shell" version:"x"] with err failed to compile workflow with err Collected Errors: 1 Error 0: Code: SyntaxError, Node Id: ellipse-area-metadata-shell, Description: Failed to parse element [my.value], err [unexpected number of matches [2] [[[my my] [value value]]]].
Expected behavior
This is a tricky bug because there are two options.
Option 1: Special characters in task inputs names are NOT okay
Rationale: flyte inputs names are "like" python variable names, which should not use special characters like
.
(seemy.value
in the repro codeExpected behavior: The workflow should actually fail at compile time at step 1. (e.g. perform extra validation)
Option 2: Special characters in task inputs names ARE okay
Rationale: flyte inputs names are a string value, and have no restriction on them unlike in python. For example, a flyte inputs name like
0myvar
starts with 0, which is invalid python. However, this kind of input is valid Flyte task definition, and users today may be doing so. Introducing extra validation will break these users.Expected behavior: Rerunning the task should not lead to any errors (step 2).
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: