Skip to content

Post Execution

zenml.post_execution special

Deprecated post-execution utility functions.

pipeline

Implementation of the post-execution pipeline.

get_pipeline(pipeline, version=None)

(Deprecated) Fetches a pipeline model.

Parameters:

Name Type Description Default
pipeline str

The name of the pipeline.

required
version Optional[str]

Optional pipeline version. Specifies the version of the pipeline to return. If not given, returns the latest version.

None

Returns:

Type Description
Optional[PipelineResponseModel]

The pipeline model.

Source code in zenml/post_execution/pipeline.py
@track(event=AnalyticsEvent.GET_PIPELINE)
def get_pipeline(
    pipeline: str,
    version: Optional[str] = None,
) -> Optional["PipelineResponseModel"]:
    """(Deprecated) Fetches a pipeline model.

    Args:
        pipeline: The name of the pipeline.
        version: Optional pipeline version. Specifies the version of the
            pipeline to return. If not given, returns the latest version.

    Returns:
        The pipeline model.
    """
    logger.warning(
        "`zenml.post_execution.get_pipeline()` is deprecated and will be "
        "removed in a future release. Please use "
        "`zenml.client.Client().get_pipeline()` instead."
    )
    return Client().get_pipeline(name_id_or_prefix=pipeline, version=version)

get_pipelines()

(Deprecated) Fetches all pipelines in the active workspace.

Returns:

Type Description
List[PipelineResponseModel]

A list of pipeline models.

Source code in zenml/post_execution/pipeline.py
@track(event=AnalyticsEvent.GET_PIPELINES)
def get_pipelines() -> List["PipelineResponseModel"]:
    """(Deprecated) Fetches all pipelines in the active workspace.

    Returns:
        A list of pipeline models.
    """
    logger.warning(
        "`zenml.post_execution.get_pipelines()` is deprecated and will be "
        "removed in a future release. Please use "
        "`zenml.client.Client().list_pipelines()` instead."
    )
    return Client().list_pipelines().items

pipeline_run

Implementation of the post-execution pipeline run class.

get_run(name)

(Deprecated) Fetches the run with the given name.

Parameters:

Name Type Description Default
name str

The name of the run to fetch.

required

Returns:

Type Description
PipelineRunResponseModel

The run with the given name.

Source code in zenml/post_execution/pipeline_run.py
def get_run(name: str) -> "PipelineRunResponseModel":
    """(Deprecated) Fetches the run with the given name.

    Args:
        name: The name of the run to fetch.

    Returns:
        The run with the given name.
    """
    logger.warning(
        "`zenml.post_execution.get_run(<name>)` is deprecated and will be "
        "removed in a future release. Please use "
        "`zenml.client.Client().get_pipeline_run(<name>)` instead."
    )
    return Client().get_pipeline_run(name)

get_unlisted_runs()

(Deprecated) Fetches the 50 most recent unlisted runs.

Unlisted runs are runs that are not associated with any pipeline.

Returns:

Type Description
List[PipelineRunResponseModel]

A list of the 50 most recent unlisted runs.

Source code in zenml/post_execution/pipeline_run.py
def get_unlisted_runs() -> List["PipelineRunResponseModel"]:
    """(Deprecated) Fetches the 50 most recent unlisted runs.

    Unlisted runs are runs that are not associated with any pipeline.

    Returns:
        A list of the 50 most recent unlisted runs.
    """
    logger.warning(
        "`zenml.post_execution.get_unlisted_runs()` is deprecated and will be "
        "removed in a future release. Please use "
        "`zenml.client.Client().list_pipeline_runs(unlisted=True)` instead."
    )
    return Client().list_pipeline_runs(unlisted=True).items