Skip to content

[sdk] Executor crashes with TypeError when using Input[List[Dataset]] with dsl.Collected #12546

@wassimbensalem

Description

@wassimbensalem

Environment

  • KFP version: N/A (SDK bug, not server-specific)
  • KFP SDK version: 2.15.2 (and likely earlier versions)
  • All dependencies version:
  • kfp==2.15.2
  • kfp-pipeline-spec==2.15.2
  • kfp-server-api==2.15.2

Steps to reproduce

When a component uses Input[List[Dataset]] with dsl.Collected, the executor crashes at runtime.

Code:


from kfp import dsl
from kfp.dsl import Input
from typing import List
from kfp.dsl.types.artifact_types import Dataset

@dsl.component
def aggregate_predictions(input_predictions_list: Input[List[Dataset]]) -> str:
    return f"Processed {len(input_predictions_list)} datasets"

@dsl.pipeline
def my_pipeline():
    predict_op = some_component_that_outputs_predictions()
    collected = dsl.Collected(predict_op.outputs["output_predictions"])
    aggregate_predictions(input_predictions_list=collected)  # ← Crashes here

Error:

TypeError: list() takes no keyword arguments

###Root Cause:

The executor tries to instantiate List[Dataset] by calling list(**kwargs), but Python's list() doesn't accept keyword arguments. The code extracts List[Dataset] as the artifact class instead of extracting the inner type (Dataset).

Expected result

The component should receive a Python list of Dataset instances, where each item is a properly instantiated Dataset artifact object.


Impacted by this bug? Give it a 👍.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions