35
35
DataProcessInstancePropertiesClass ,
36
36
DataProcessInstanceRelationshipsClass ,
37
37
ContainerPropertiesClass ,
38
- AuditStampClass ,
39
38
TimeStampClass ,
40
39
DataProcessRunStatusClass ,
41
40
SubTypesClass ,
@@ -161,9 +160,10 @@ def get_report(self) -> SourceReport:
161
160
return self .report
162
161
163
162
def get_workunits_internal (self ) -> Iterable [MetadataWorkUnit ]:
163
+ print ("get_workunits_internal" )
164
164
yield from self ._get_tags_workunits ()
165
- yield from self ._get_experiment_workunits ()
166
165
yield from self ._get_ml_model_workunits ()
166
+ # yield from self._get_experiment_workunits()
167
167
168
168
def _get_tags_workunits (self ) -> Iterable [MetadataWorkUnit ]:
169
169
for stage_info in self .registered_model_stages_info :
@@ -218,7 +218,7 @@ def _get_experiment_container_workunit(self, experiment: Experiment) -> List[Met
218
218
subtype = "ML Experiment" ,
219
219
name = experiment .name ,
220
220
description = experiment .tags .get ('mlflow.note.content' )
221
- )
221
+ ) # TODO: urn should be experiment id
222
222
223
223
print ("experiment.key.id:" , experiment .key .id ) # this should be same as container key as urn
224
224
print ("experiment.key.as_urn(): " , experiment .key .as_urn ())
@@ -247,7 +247,6 @@ def _convert_run_result_type(self, status: str) -> DataProcessInstanceRunResultC
247
247
return DataProcessInstanceRunResultClass (type = "SKIPPED" , nativeResultType = "mlflow" )
248
248
249
249
def _get_run_workunits (self , experiment : Experiment , run : Run ) -> List [MetadataWorkUnit ]:
250
- # TODO: this does not map to the correct experiment
251
250
experiment_key = ContainerKeyWithId (
252
251
platform = str (DataPlatformUrn .create_from_id ("mlflow" )),
253
252
id = experiment .name
@@ -258,6 +257,7 @@ def _get_run_workunits(self, experiment: Experiment, run: Run) -> List[MetadataW
258
257
id = run .info .run_name
259
258
)
260
259
260
+ # TODO: urn should be run id
261
261
262
262
print ("dpi id" , run .info .run_name )
263
263
print ("experiment_key.id:" , experiment_key .id )
@@ -398,6 +398,7 @@ def _get_ml_group_workunit(
398
398
versionTag = self ._get_latest_version (registered_model )
399
399
),
400
400
)
401
+ print ("ml_model_group_properties: " , ml_model_group_properties )
401
402
wu = self ._create_workunit (
402
403
urn = ml_model_group_urn ,
403
404
aspect = ml_model_group_properties ,
@@ -452,30 +453,15 @@ def _get_ml_model_properties_workunit(
452
453
ml_model_group_urn = self ._make_ml_model_group_urn (registered_model )
453
454
ml_model_urn = self ._make_ml_model_urn (model_version )
454
455
456
+ hyperparams = None
457
+ training_metrics = None
458
+ training_jobs = None
459
+
455
460
if run :
456
461
# Use the same metrics and hyperparams from the run
457
462
hyperparams = self ._get_run_params (run )
458
463
training_metrics = self ._get_run_metrics (run )
459
-
460
- # Create proper relationship with the run
461
-
462
- # get experiment name from experiment id
463
- experiment_id = run .info .experiment_id
464
- experiment = self .client .get_experiment (experiment_id )
465
- experiment_key = ContainerKeyWithId (
466
- platform = str (DataPlatformUrn .create_from_id ("mlflow" )),
467
- id = experiment .name
468
- )
469
-
470
- data_process_instance = DataProcessInstance .from_container (
471
- container_key = experiment_key ,
472
- id = run .info .run_name
473
- )
474
- training_jobs = [str (data_process_instance .urn )]
475
- else :
476
- hyperparams = None
477
- training_metrics = None
478
- training_jobs = None
464
+ # training_jobs = [str(builder.make_data_process_instance_urn(run.info.run_id))]
479
465
480
466
created_time = model_version .creation_timestamp
481
467
created_actor = f"urn:li:platformResource:{ model_version .user_id } " if model_version .user_id else None
0 commit comments