Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update API output #7

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions mlflow_oidc_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def get_current_user():
{
"name": mlflow_client.get_experiment(permission.experiment_id).name,
"id": permission.experiment_id,
"permission": permission.permission
"permission": permission.permission,
}
for permission in user.experiment_permissions
]
Expand Down Expand Up @@ -420,19 +420,31 @@ def get_users():


def get_experiments():
# return all experiments
list_experiments = mlflow_client.search_experiments()
experiments = [experiment.name for experiment in list_experiments]
# return as json
return jsonify({"experiments": experiments})
experiments = [
{
"name": experiment.name,
"id": experiment.experiment_id,
"tags": experiment.tags,
}
for experiment in list_experiments
]
return jsonify(experiments)


def get_models():
# return all models
registered_models = mlflow_client.search_registered_models()
models = [model.name for model in registered_models]
# return as json
return jsonify({"models": models})
models = [
{
"name": model.name,
"tags": model.tags,
"description": model.description,
"latest_versions": model.latest_versions,
"aliases": model.aliases,
}
for model in registered_models
]
return jsonify(models)


def get_user_experiments(username):
Expand Down
Loading