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

[flytekit] Update calling task in task behavior #6024

Open
2 tasks done
wild-endeavor opened this issue Nov 18, 2024 · 0 comments
Open
2 tasks done

[flytekit] Update calling task in task behavior #6024

wild-endeavor opened this issue Nov 18, 2024 · 0 comments
Labels
backlogged For internal use. Reserved for contributor team workflow. enhancement New feature or request flytekit FlyteKit Python related issue

Comments

@wild-endeavor
Copy link
Contributor

wild-endeavor commented Nov 18, 2024

User Code

If you have something like this

from flytekit import task, workflow

@task
def outer():
    inner()
    print("outer")

@task
def inner():
    print("inner")

@workflow
def wf():
    outer()

Current Behavior

It works in recent versions of flytekit.

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

This pattern should not work without an active decision from the user. We want to actively discourage accidentally doing this for a variety of reasons. One is that the behavior is different from when calling a task within a wf - all the procedures and logic behind a normal task run applies. When you call a task within a task, the idea is that it's executing as if flyte doesn't exist - you're just invoking the underlying function.

Proposal from @cosmicBboy

  • when calling a task within a task, raise a deprecation warning saying “this will run as a local function within the parent task, saying this will raise an error in flytekit version X.Y.Z, use <task>. python_function() explicitly to call as a local function”.
  • when we release version X.Y.Z raise an error, add migration guide to the release notes / blogs for that release.

We should probably give this at least a few months, maybe half a year, before making it an error.

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@wild-endeavor wild-endeavor added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Nov 18, 2024
@wild-endeavor wild-endeavor added the flytekit FlyteKit Python related issue label Nov 18, 2024
@eapolinario eapolinario added backlogged For internal use. Reserved for contributor team workflow. and removed untriaged This issues has not yet been looked at by the Maintainers labels Nov 21, 2024
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
Status: Backlog
Development

No branches or pull requests

2 participants