|
33 | 33 | VersionTagClass,
|
34 | 34 | DataProcessInstanceRunEventClass,
|
35 | 35 | DataProcessInstancePropertiesClass,
|
36 |
| - DataProcessInstanceRelationshipsClass, |
37 | 36 | ContainerPropertiesClass,
|
38 | 37 | TimeStampClass,
|
39 | 38 | DataProcessRunStatusClass,
|
|
44 | 43 | MLTrainingRunPropertiesClass,
|
45 | 44 | DataProcessInstanceRunResultClass,
|
46 | 45 | )
|
47 |
| -from datahub.metadata.urns import DatasetUrn, DataPlatformUrn, MlModelUrn, MlModelGroupUrn, DataProcessInstanceUrn, DataPlatformInstanceUrn |
| 46 | +from datahub.metadata.urns import DataPlatformUrn |
48 | 47 | from datahub.api.entities.dataprocess.dataprocess_instance import (
|
49 | 48 | DataProcessInstance,
|
50 | 49 | )
|
@@ -161,7 +160,7 @@ def get_report(self) -> SourceReport:
|
161 | 160 | def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]:
|
162 | 161 | yield from self._get_tags_workunits()
|
163 | 162 | yield from self._get_ml_model_workunits()
|
164 |
| - # yield from self._get_experiment_workunits() |
| 163 | + yield from self._get_experiment_workunits() |
165 | 164 |
|
166 | 165 | def _get_tags_workunits(self) -> Iterable[MetadataWorkUnit]:
|
167 | 166 | for stage_info in self.registered_model_stages_info:
|
@@ -208,20 +207,17 @@ def _get_experiment_custom_properties(self, experiment):
|
208 | 207 | return experiment_custom_props
|
209 | 208 |
|
210 | 209 | def _get_experiment_container_workunit(self, experiment: Experiment) -> List[MetadataWorkUnit]:
|
211 |
| - experiment = Container( |
| 210 | + experiment_container = Container( |
212 | 211 | key=ContainerKeyWithId(
|
213 | 212 | platform=str(DataPlatformUrn.create_from_id("mlflow")),
|
214 |
| - id=experiment.name |
| 213 | + id=experiment.name, |
215 | 214 | ),
|
216 | 215 | subtype="ML Experiment",
|
217 | 216 | name=experiment.name,
|
218 | 217 | description=experiment.tags.get('mlflow.note.content')
|
219 |
| - ) # TODO: urn should be experiment id |
220 |
| - |
221 |
| - # print("experiment.key.id:", experiment.key.id) # this should be same as container key as urn |
222 |
| - # print("experiment.key.as_urn(): ", experiment.key.as_urn()) |
| 218 | + ) # TODO: this generates a urn as guid, should we change this to use experiment.id? |
223 | 219 |
|
224 |
| - workunits = [mcp.as_workunit() for mcp in experiment.generate_mcp()] |
| 220 | + workunits = [mcp.as_workunit() for mcp in experiment_container.generate_mcp()] |
225 | 221 | return workunits
|
226 | 222 |
|
227 | 223 |
|
@@ -253,15 +249,7 @@ def _get_run_workunits(self, experiment: Experiment, run: Run) -> List[MetadataW
|
253 | 249 | data_process_instance = DataProcessInstance.from_container(
|
254 | 250 | container_key=experiment_key,
|
255 | 251 | id=run.info.run_name
|
256 |
| - ) |
257 |
| - |
258 |
| - # TODO: urn should be run id |
259 |
| - # print("dpi id", run.info.run_name) |
260 |
| - # print("experiment_key.id:", experiment_key.id) |
261 |
| - # print("run id", run.info.run_id) |
262 |
| - # print("data_proceess_instance.urn:", str(data_process_instance.urn)) |
263 |
| - # print("--------------------") |
264 |
| - |
| 252 | + ) # TODO: this generates a urn as guid, should we change this to use run.info.run_id? |
265 | 253 | workunits = []
|
266 | 254 |
|
267 | 255 | run_custom_props = self._get_run_custom_properties(run)
|
@@ -290,6 +278,7 @@ def _get_run_workunits(self, experiment: Experiment, run: Run) -> List[MetadataW
|
290 | 278 | hyperParams=hyperparams,
|
291 | 279 | trainingMetrics=metrics,
|
292 | 280 | outputUrls=[run.info.artifact_uri],
|
| 281 | + id=run.info.run_id, |
293 | 282 | )
|
294 | 283 | ).as_workunit()
|
295 | 284 | )
|
|
0 commit comments