Skip to content

Commit

Permalink
Dont use mutable default value for class variable
Browse files Browse the repository at this point in the history
  • Loading branch information
schustmi committed Nov 27, 2021
1 parent 84e2fe1 commit 4ed49d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/zenml/steps/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ class _FunctionExecutor(BaseExecutor):
"""Base TFX Executor class which is compatible with ZenML steps"""

_FUNCTION = staticmethod(lambda: None)
materializers: ClassVar[Dict[str, Type["BaseMaterializer"]]] = {}
materializers: ClassVar[
Optional[Dict[str, Type["BaseMaterializer"]]]
] = None

def resolve_materializer_with_registry(
self, param_name: str, artifact: BaseArtifact
Expand Down Expand Up @@ -348,7 +350,7 @@ def Do(
output_artifacts = {k: v[0] for k, v in output_dict.items()}
context = StepContext(
step_name=getattr(self, PARAM_STEP_NAME),
output_materializers=self.materializers,
output_materializers=self.materializers or {},
output_artifacts=output_artifacts,
)
function_params[arg] = context
Expand Down

0 comments on commit 4ed49d4

Please sign in to comment.