Skip to content

Commit 125de64

Browse files
committed
generalize MLAssetSubtypes
1 parent bce5805 commit 125de64

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

metadata-ingestion/src/datahub/ingestion/source/common/subtypes.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,11 @@ class BIAssetSubTypes(StrEnum):
9595

9696

9797
class MLAssetSubTypes(StrEnum):
98-
MLFLOW_TRAINING_RUN = "ML Training Run"
99-
MLFLOW_EXPERIMENT = "ML Experiment"
98+
TRAINING_RUN = "ML Training Run"
99+
EXPERIMENT = "ML Experiment"
100+
MODEL = "ML Model"
101+
TRAINING_JOB = "Training Job"
102+
MODEL_GROUP = "ML Model Group"
103+
ENDPOINT = "Endpoint"
104+
DATASET = "Dataset"
105+
PROJECT = "Project"

metadata-ingestion/src/datahub/ingestion/source/mlflow.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _get_experiment_container_workunit(
228228
platform=str(DataPlatformUrn(platform_name=self.platform)),
229229
id=experiment.name,
230230
),
231-
subtype=MLAssetSubTypes.MLFLOW_EXPERIMENT,
231+
subtype=MLAssetSubTypes.EXPERIMENT,
232232
display_name=experiment.name,
233233
description=experiment.tags.get("mlflow.note.content"),
234234
extra_properties=self._get_experiment_custom_properties(experiment),
@@ -358,7 +358,7 @@ def _get_run_workunits(
358358

359359
yield MetadataChangeProposalWrapper(
360360
entityUrn=str(data_process_instance.urn),
361-
aspect=SubTypesClass(typeNames=[MLAssetSubTypes.MLFLOW_TRAINING_RUN]),
361+
aspect=SubTypesClass(typeNames=[MLAssetSubTypes.TRAINING_RUN]),
362362
).as_workunit()
363363

364364
def _get_mlflow_registered_models(self) -> Iterable[RegisteredModel]:

0 commit comments

Comments
 (0)