kfp.dsl.types module

Module for input/output types in Pipeline DSL.

Feature stage: [Beta](https://github.com/kubeflow/pipelines/blob/07328e5094ac2981d3059314cc848fbb71437a76/docs/release/feature-stages.md#beta).

class kfp.dsl.types.BaseType[source]

Bases: object

BaseType is a base type for all scalar and artifact types.

to_dict() → Union[Dict[KT, VT], str][source]

to_dict serializes the type instance into a python dictionary or string.

class kfp.dsl.types.Bool[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.Dict[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.Float[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.GCPProjectID[source]

Bases: kfp.dsl.types.BaseType

MetaGCPProjectID: GCP project id

class kfp.dsl.types.GCPRegion[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.GCRPath[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.GCSPath[source]

Bases: kfp.dsl.types.BaseType

exception kfp.dsl.types.InconsistentTypeException[source]

Bases: Exception

InconsistencyTypeException is raised when two types are not consistent.

exception kfp.dsl.types.InconsistentTypeWarning[source]

Bases: Warning

InconsistentTypeWarning is issued when two types are not consistent.

class kfp.dsl.types.Integer[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.List[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.LocalPath[source]

Bases: kfp.dsl.types.BaseType

class kfp.dsl.types.String[source]

Bases: kfp.dsl.types.BaseType

kfp.dsl.types.check_types(checked_type, expected_type)[source]

check_types checks the type consistency.

For each of the attribute in checked_type, there is the same attribute in expected_type with the same value. However, expected_type could contain more attributes that checked_type does not contain. :param checked_type: it describes a type from the

upstream component output
Parameters:expected_type (BaseType/str/dict) – it describes a type from the downstream component input
kfp.dsl.types.verify_type_compatibility(given_type: Union[str, kfp.dsl.types.Dict], expected_type: Union[str, kfp.dsl.types.Dict], error_message_prefix: str = '')[source]

verify_type_compatibility verifies that the given argument type is compatible with the expected input type.

Parameters:
  • given_type (str/dict) – The type of the argument passed to the input
  • expected_type (str/dict) – The declared type of the input