Skip to content
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

[Core feature] Flytekit create automatic bindings for Task default values #5321

Closed
2 tasks done
kumare3 opened this issue May 3, 2024 · 3 comments · Fixed by flyteorg/flytekit#2401
Closed
2 tasks done
Assignees
Labels
backlogged For internal use. Reserved for contributor team workflow. enhancement New feature or request flytekit FlyteKit Python related issue

Comments

@kumare3
Copy link
Contributor

kumare3 commented May 3, 2024

Motivation: Why do you think this is important?

Currently this will not work, as rotation is not provided

@task(cache=True, cache_version="1")
def rotate_image(img: FlyteFile, rotation: int = 180) -> FlyteFile:
    img.download()
    with Image.open(img.path) as im:
        rotated = im.rotate(rotation)
        rotated.save("/tmp/rotated.jpeg")
    return FlyteFile("/tmp/rotated.jpeg")


@workflow
def wf(img: FlyteFile = "testdir/maradona.jpeg") -> FlyteFile:
    return rotate_image(img=img)

Goal: What should the final outcome look like, ideally?

Ideally we should automatically create a node binding in the workflow where the default value in the task inputs should be added to the node in the workflow

Describe alternatives you've considered

NA

Propose: Link/Inline OR Additional context

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes

Tasks

Preview Give feedback
No tasks being tracked yet.
@kumare3 kumare3 added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels May 3, 2024
@Future-Outlier Future-Outlier self-assigned this May 3, 2024
@Future-Outlier
Copy link
Member

Will start it after 5/12, thank you

Copy link

runllm bot commented May 3, 2024

The issue you're describing relates to the current limitation in Flyte where default values for task inputs are not automatically recognized and used in workflows. This is a known limitation, as discussed in GitHub issue #2426, where the Flyte type system does not automatically bind default values or None for optional variables unless explicitly provided. This behavior is intentional to ensure explicitness in workflow definitions.

Your proposed feature to automatically create node bindings for default task input values in workflows would require changes to the FlyteIDL and the core handling of task and workflow interfaces. This feature could simplify workflow definitions by reducing the need for explicit default value bindings at the workflow level, aligning task behavior more closely with standard Python function behavior.

Would you like more detail on how this could be implemented or the current discussions around this feature?

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!

@MortalHappiness
Copy link
Member

#take

@wild-endeavor wild-endeavor added backlogged For internal use. Reserved for contributor team workflow. flytekit FlyteKit Python related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels May 9, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 9, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 9, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 15, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 15, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 15, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 15, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 16, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 16, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 17, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 17, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 25, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 26, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 26, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 26, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 29, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 29, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 29, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue May 29, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 4, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 4, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 4, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 4, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 6, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 6, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 6, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 6, 2024
MortalHappiness added a commit to MortalHappiness/flytekit that referenced this issue Jun 6, 2024
wild-endeavor pushed a commit to flyteorg/flytekit that referenced this issue Jun 6, 2024
flyteorg/flyte#5321

if the key is not in `kwargs` but in `interface.inputs_with_defaults`, add the value in `interface.inputs_with_defaults` to `kwargs`.

Signed-off-by: Chi-Sheng Liu <[email protected]>
bgedik pushed a commit to bgedik/flytekit that referenced this issue Jul 3, 2024
flyteorg/flyte#5321

if the key is not in `kwargs` but in `interface.inputs_with_defaults`, add the value in `interface.inputs_with_defaults` to `kwargs`.

Signed-off-by: Chi-Sheng Liu <[email protected]>
Signed-off-by: bugra.gedik <[email protected]>
fiedlerNr9 pushed a commit to flyteorg/flytekit that referenced this issue Jul 25, 2024
flyteorg/flyte#5321

if the key is not in `kwargs` but in `interface.inputs_with_defaults`, add the value in `interface.inputs_with_defaults` to `kwargs`.

Signed-off-by: Chi-Sheng Liu <[email protected]>
Signed-off-by: Jan Fiedler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. enhancement New feature or request flytekit FlyteKit Python related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants