Update optuna_dashboard/_app.py

Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
This commit is contained in:
Hiroki Takizawa
2023-12-06 16:26:02 +09:00
committed by GitHub
co-authored by Shuhei Watanabe
parent 26d29f3c02
commit 895fc0bd04
+2
View File
@@ -460,6 +460,8 @@ def create_app(
response.status = 404 # Not found
return {"reason": f"study_id={study_id} is not found"}
trials = get_trials(storage, study_id)
if len(trials) == 0:
return {"reason": f"study_id={study_id} has no trials"}
param_names = sorted(set(chain.from_iterable([t.params.keys() for t in trials])))
user_attr_names = sorted(set(chain.from_iterable([t.user_attrs.keys() for t in trials])))