Skip to content

[feature] KEP-11385: Extend the SDK compiler to support Literal input parameters for both pipeline and component input #12601

@mprahl

Description

@mprahl

Feature Area

/area sdk

Part of KEP-11385.

Acceptance Criteria

  • InputSpec class definition contains a literals field of type Optional[List[str] | List[int] | List[float]] = None
  • Compiler throws an error for Literal parameters that contain elements of multiple types (ie. Literal[1, 2, "a"]). While this behavior is supported by the typing.Literal class, we want to limit KFP to Literals of a single type.
  • Compiler validates hard-coded input values against their Literal parameters. Compiler throws an error if input is invalid
  • Validate these changes by adding the valid and invalid cases outlined in the KEP to the SDK compiler unit test cases.  Only include behavior outlined under the SDK Compiler column.

Hint: changes should be made primarily to  kfp/dsl/structures.py and kfp/dsl/types/type_utils.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions