MlflowArtifacts

pydantic model mlopus.kedro.MlflowArtifacts[source]

Bases: MlflowRunMixin, HookWithFactory

Hook to set up inputs and collect outputs using MLflow artifacts.

Find here a fully commented example covering all settings that can be customized in this hook.

field collect_on_error: bool = False

Collect available outputs if pipeline fails.

field inputs: Dict[str, PipelineInput] [Optional]

Configure inputs.

field outputs: Dict[str, PipelineOutput] [Optional]

Configure outputs.

class Config

Bases: object

Pydantic class config.

field run_manager: MlflowRunManager | None [Required] (alias 'mlflow')

Instance or dict to be parsed into instance of MlflowRunManager

pydantic model mlopus.kedro.hooks.mlflow_artifacts.PipelineInput[source]

Bases: LoadArtifactSpec, EmptyStrAsMissing

Specification of an artifact to be fetched from MLFlow and placed before a pipeline runs.

field path: Path [Required]

Local path to place the artifact file or dir.

Place artifact file or dir as a symbolic link to the artifacts cache. If false, make a copy instead.

field enabled: bool = True

Enable this input.

field overwrite: bool = True

Overwrite path if exists.

field log_lineage: bool = True

Log lineage info in MLFlow run. See also mlopus.lineage.Lineage.

field pipelines: Optional[List[str]] = None

If specified, enable input for these pipelines only.

class Config

Bases: object

Pydantic class config.

property entity_api: T

Entity metadata with MLFlow API handle.

place(target, **kwargs)

Place artifact on target path.

New in version 1.3.

property run: Run

Get source run metadata.

New in version 1.4.

field schema_: Schema[A, D, L] | Type[Schema[A, D, L]] | str | None [Optional] (alias 'schema')

See schema

field loader_conf: Dict[str, Any] | None = None

See loader

field skip_reqs_check: bool = False

See skip_reqs_check

field subject: ArtifactSubject[T, LA] [Required]

Instance (or dict to be parsed into instance) of RunArtifact or ModelVersionArtifact. See also: subject.

field export_opts: ExportOptions [Optional]

Options for exporting artifact cache.

New in version 1.4.

field mlflow_api: BaseMlflowApi = None

Instance of BaseMlflowApi or a dict of keyword arguments for mlopus.mlflow.get_api().

pydantic model mlopus.kedro.hooks.mlflow_artifacts.PipelineOutput[source]

Bases: LogArtifactSpec, EmptyStrAsMissing

Specification of an artifact to be collected and published to MLFlow after a pipeline runs.

field path: Path [Required]

Path to collect the artifact file or dir from.

field enabled: bool = True

Enable this output.

field log_lineage: bool = True

Log lineage info in MLFlow run. See also mlopus.lineage.Lineage.

field pipelines: Optional[List[str]] = None

If specified, enable output for these pipelines only.

field skip_if_missing: bool = False

Skip output if missing.

class Config

Bases: object

Pydantic class config.

field schema_: Schema[A, D, L] | Type[Schema[A, D, L]] | str | None [Optional] (alias 'schema')

See schema

field dumper_conf: Dict[str, Any] | None = None

See dumper

field skip_reqs_check: bool = False

See skip_reqs_check

field auto_register: bool | Dict[str, Any] = False

See mlopus.artschema.log_run_artifact.auto_register and mlopus.artschema.log_model_version.auto_register

field keep_the_source: bool | None = None

See keep_the_source

field allow_duplication: bool | None = None

See allow_duplication

field use_cache: bool | None = None

See use_cache

field subject: ArtifactSubject[T, LA] [Required]

Instance (or dict to be parsed into instance) of RunArtifact or ModelVersionArtifact. See also: subject.

field mlflow_api: BaseMlflowApi = None

Instance of BaseMlflowApi or a dict of keyword arguments for mlopus.mlflow.get_api().