Skip to content

[Core feature] Flytekit should support using output with Non-Any type as the input with Any type. #5366

Closed as not planned
@Mecoli1219

Description

@Mecoli1219

Motivation: Why do you think this is important?

Intuitively, Any type should take every possible type as the input. Flytekit today supports using all Python types as the input, but it doesn't support

  1. the non-Any output from another task.
  2. the non-Any input from the workflow.

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

The following scenarios should succeed:

Scenario 1:

@task()
def foo(a: Any) -> int:
    if type(a) == int:
        return a + 1
    return 0

@workflow
def wf(a: int) -> int:
    return foo(a=a)

Scenario 2:

@workflow
def wf1(a: Any) -> int:
    a1 = foo(a=a)
    return foo(a=a1)

Describe alternatives you've considered

Adding some tags as type hints for the transformer?

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

Metadata

Metadata

Labels

enhancementNew feature or requestflytekitFlyteKit Python related issuestale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions