Skip to content

Commit deaedab

Browse files
authored
Store all pipeline parameters in pipeline config (#4129)
1 parent fa597f2 commit deaedab

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/zenml/config/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def compile(
124124
environment=pipeline_environment,
125125
secrets=pipeline_secrets,
126126
settings=pipeline_settings,
127+
parameters=pipeline._parameters,
127128
merge=False,
128129
)
129130

tests/unit/config/test_compiler.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,3 +686,25 @@ class StubSettings(BaseSettings):
686686
stack=local_stack,
687687
run_configuration=PipelineRunConfiguration(),
688688
)
689+
690+
691+
def test_pipeline_parameters_are_stored_in_config(empty_step, local_stack):
692+
"""Tests that both configured and in-code parameters are stored in the
693+
compiled pipeline configuration.
694+
"""
695+
696+
@pipeline
697+
def _pipeline_with_params(a: int, b: int) -> None:
698+
empty_step()
699+
700+
# Config params
701+
_pipeline_with_params.configure(parameters={"a": 1})
702+
# In-code params
703+
_pipeline_with_params.prepare(b=2)
704+
705+
snapshot = Compiler().compile(
706+
pipeline=_pipeline_with_params,
707+
stack=local_stack,
708+
run_configuration=PipelineRunConfiguration(),
709+
)
710+
assert snapshot.pipeline_configuration.parameters == {"a": 1, "b": 2}

0 commit comments

Comments
 (0)