Skip to content

Commit

Permalink
Fixed GUI bug (#143)
Browse files Browse the repository at this point in the history
* server/app/get_data.py

* changed logic for artifact retrieval
  • Loading branch information
varkha-d-sharma authored Feb 6, 2024
1 parent afd4d5f commit a3b9ff8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions server/app/get_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,24 @@ def get_all_artifact_ids(mlmdfilepath):
artifact_ids = {}
query = cmfquery.CmfQuery(mlmdfilepath)
names = query.get_pipeline_names()
execution_ids = get_all_exe_ids(mlmdfilepath)
for name in names:
df = pd.DataFrame()
artifacts = query.get_all_artifacts_by_context(name)
df = pd.concat([df, artifacts], sort=True, ignore_index=True)
exe_ids = execution_ids[name]['id'].tolist()
for id in exe_ids:
artifacts = query.get_all_artifacts_for_execution(id)
df = pd.concat([df, artifacts], sort=True, ignore_index=True)
df.sort_values("id", inplace=True)
df.drop_duplicates(subset="id",keep='first', inplace=True)
if df.empty:
return
else:
artifact_ids[name] = {}
for art_type in df['type']:
filtered_values = df.loc[df['type'] == art_type, ['id', 'name']]
artifact_ids[name][art_type] = filtered_values
#print("artifact_ids")
#print(artifact_ids)
return artifact_ids

def get_artifacts(mlmdfilepath, pipeline_name, art_type, artifact_ids):
Expand Down

0 comments on commit a3b9ff8

Please sign in to comment.