BaseMaterializer
. All other materializers inherit from this class, and this class defines the interface of all materializers.artifact
object. The most important property of an artifact
object is the uri
. The uri
is created by ZenML at pipeline run time and points to the directory of a file system (the artifact store).handle_input
and handle_return
functions are important.handle_input
is responsible for reading the artifact from the artifact store.handle_return
is responsible for writing the artifact to the artifact store.ASSOCIATED_TYPES
and ASSOCIATED_ARTIFACT_TYPES
.ASSOCIATED_TYPES
is the data type that is being stored. ZenML uses this information to call the right materializer at the right time. i.e. If a ZenML step returns a pd.DataFrame
, ZenML will try to find any materializer that has pd.DataFrame
(or its subclasses) in its ASSOCIATED_TYPES
.ASSOCIATED_ARTIFACT_TYPES
simply define what type
of artifacts are being stored. This can be DataArtifact
, StatisticsArtifact
, DriftArtifact
, etc. This is simply a tag to query certain artifact types in the post-execution workflow.BaseMaterializer
BaseMaterializer
by sub-classing it.MyObject
that flows between two steps in a pipeline:MyObj
between steps (how could it? We just created this!). Therefore, we can create our own materializer:fileio
handler to ensure your materialization logic works across artifact stores (local and remote like S3 buckets).{OUTPUT_NAME: MATERIALIZER_CLASS}
to the with_return_materializers
function.with_return_materializers
need only be called on step1
, all downstream steps will use the same materializer by default.