flytekit.extend.Interface

class flytekit.extend.Interface(inputs=None, outputs=None, output_tuple_name=None, docstring=None)[source]

A Python native interface object, like inspect.signature but simpler.

Methods

Parameters:
  • inputs (Union[Optional[Dict[str, Type]], Optional[Dict[str, Tuple[Type, Any]]]])

  • outputs (Union[Optional[Dict[str, Type]], Optional[Dict[str, Optional[Type]]]])

  • output_tuple_name (Optional[str])

  • docstring (Optional[Docstring])

remove_inputs(vars)[source]

This method is useful in removing some variables from the Flyte backend inputs specification, as these are implicit local only inputs or will be supplied by the library at runtime. For example, spark-session etc It creates a new instance of interface with the requested variables removed

Parameters:

vars (List[str] | None)

Return type:

Interface

with_inputs(extra_inputs)[source]

Use this to add additional inputs to the interface. This is useful for adding additional implicit inputs that are added without the user requesting for them

Parameters:

extra_inputs (Dict[str, Type])

Return type:

Interface

with_outputs(extra_outputs)[source]

This method allows addition of extra outputs are expected from a task specification

Parameters:

extra_outputs (Dict[str, Type])

Return type:

Interface

Attributes

default_inputs_as_kwargs
docstring
inputs
inputs_with_defaults
output_names
output_tuple
output_tuple_name
outputs