in google_cloud_automlops/AutoMLOps.py [0:0]
def pipeline(func: Optional[Callable] = None,
*,
name: Optional[str] = None,
description: Optional[str] = None):
"""Decorator for Python-function based pipelines in AutoMLOps.
Example usage:
from google_cloud_automlops import AutoMLOps
@AutoMLOps.pipeline
def pipeline(bq_table: str,
output_model_directory: str,
project: str,
region: str,
):
dataset_task = create_dataset(
bq_table=bq_table,
project=project)
...
Args:
func: The python function to create a pipeline from. The function should have type
annotations for all its arguments, indicating how it is intended to be used (e.g. as an
input/output Artifact object, a plain parameter, or a path to a file).
name: The name of the pipeline.
description: Short description of what the pipeline does.
"""
if func is None:
return functools.partial(
pipeline,
name=name,
description=description)
else:
global pipeline_glob
pipeline_glob = BasePipeline(func=func,
name=name,
description=description,
comps_dict=components_dict)
return