You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to use a list for an input/output of a component, if you specify the data type expected within the list such as list[str] or list[int], it returns the following error:
TypeError: Artifacts must have both a schema_title and a schema_version, separated by `@`. Got: list[int]
Where if you provide the an untyped list it works without issue.
Providing the type hinting as list[int] or whatever other datatype you expect is more pythonic as you generally want to avoid untyped lists. I would expect this to work instead of being required to provide a bare, untyped list
By replacing any instances of list[int] with list in the examples above, the pipeline is able to successfully compile.
Traceback (most recent call last):
File "/Users/my_user/code/kfp-component-test/pipelines/test-pipeline.py", line 5, in <module>
@dsl.component()
^^^^^^^^^^^^^^^
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/component_decorator.py", line 126, in component
return component_factory.create_component_from_func(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/component_factory.py", line 589, in create_component_from_func
component_spec = extract_component_interface(func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/component_factory.py", line 451, in extract_component_interface
name_to_input_spec, name_to_output_spec = get_name_to_specs(
^^^^^^^^^^^^^^^^^^
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/component_factory.py", line 302, in get_name_to_specs
name, list(name_to_input_specs))] = make_input_spec(
^^^^^^^^^^^^^^^^
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/component_factory.py", line 406, in make_input_spec
return structures.InputSpec(
^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 8, in __init__
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/structures.py", line 57, in __post_init__
self._validate_type()
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/structures.py", line 131, in _validate_type
type_utils.validate_bundled_artifact_type(self.type)
File "/Users/my_user/code/kfp-component-test/.venv/lib/python3.11/site-packages/kfp/dsl/types/type_utils.py", line 544, in validate_bundled_artifact_type
raise TypeError(
TypeError: Artifacts must have both a schema_title and a schema_version, separated by `@`. Got: list[int]
Impacted by this bug? Give it a 👍.
The text was updated successfully, but these errors were encountered:
When attempting to use a
list
for an input/output of a component, if you specify the data type expected within the list such aslist[str]
orlist[int]
, it returns the following error:Where if you provide the an untyped
list
it works without issue.Environment
2.11
2.11
Steps to reproduce
Example code:
Expected result
Providing the type hinting as
list[int]
or whatever other datatype you expect is more pythonic as you generally want to avoid untyped lists. I would expect this to work instead of being required to provide a bare, untypedlist
By replacing any instances of
list[int]
withlist
in the examples above, the pipeline is able to successfully compile.Materials and Reference
https://www.kubeflow.org/docs/components/pipelines/user-guides/data-handling/parameters/
Full stack trace:
Impacted by this bug? Give it a 👍.
The text was updated successfully, but these errors were encountered: