Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset _has_been_called to False ahead of pipeline.connect #385

Merged
merged 4 commits into from
Feb 2, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/zenml/orchestrators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@
logger = get_logger(__name__)


def reset_step_flags(zenml_pipeline: "BasePipeline") -> None:
"""Reset the _has_been_called flag ahead of a pipeline run, to make sure
a pipeline instance can be called more than once."""
for step in zenml_pipeline.steps.values():
step._has_been_called = False


def create_tfx_pipeline(
zenml_pipeline: "BasePipeline", stack: "Stack"
zenml_pipeline: "BasePipeline", stack: "Stack"
) -> tfx_pipeline.Pipeline:
"""Creates a tfx pipeline from a ZenML pipeline."""
# Connect the inputs/outputs of all steps in the pipeline
reset_step_flags(zenml_pipeline)
zenml_pipeline.connect(**zenml_pipeline.steps)

tfx_components = [step.component for step in zenml_pipeline.steps.values()]
Expand All @@ -51,7 +59,7 @@ def create_tfx_pipeline(


def execute_step(
tfx_launcher: launcher.Launcher,
tfx_launcher: launcher.Launcher,
) -> Optional[data_types.ExecutionInfo]:
"""Executes a tfx component.

Expand Down