flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

Improve error message for missing return

Open pingsutw opened this issue 1 year ago • 0 comments

Tracking issue

NA

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

import os

from click.testing import CliRunner

from flytekit import task, workflow, ImageSpec
from flytekit.clis.sdk_in_container import pyflyte

default = ["pandas", "mypy"]

image = ImageSpec(registry="pingsutw", packages=[*default])


@task(container_image=image)
def t1() -> int:
    return 3 + 2


@task(container_image=os.getenv("IMAGE"))
def t2(a: int) -> int:
    return a + 3


@workflow()
def wf(a: int = 3) -> int:
    t1()
    t2(a=a)


if __name__ == '__main__':
    runner = CliRunner()
    result = runner.invoke(
        pyflyte.main,
        [
            "-vv",
            "register",
            "/Users/kevin/git/flytekit/flyte-example/improve_image_spec.py",
        ]
    )
    print(result.stdout)

Setup process

Screenshots

Before:

Screenshot 2024-07-03 at 1 37 55 AM

After: Screenshot 2024-07-03 at 1 37 46 AM

Check all the applicable boxes

  • [x] I updated the documentation accordingly.
  • [x] All new and existing tests passed.
  • [x] All commits are signed-off.

Related PRs

NA

Docs link

NA

pingsutw avatar Jul 03 '24 08:07 pingsutw