diff --git a/apiserver/mongo/initialize/pre_populate.py b/apiserver/mongo/initialize/pre_populate.py index c3b7cce..a038b51 100644 --- a/apiserver/mongo/initialize/pre_populate.py +++ b/apiserver/mongo/initialize/pre_populate.py @@ -876,10 +876,10 @@ class PrePopulate: "30795571a4704717a80de8705897ytuyg", ] - auth_user = cls.auth_user_cls.from_json(json.dumps(user)) + auth_user = cls.auth_user_cls.from_json(json.dumps(user), created=True) auth_user.company = company_id auth_user.save() - be_user = cls.user_cls.from_json(json.dumps(be_users[uid])) + be_user = cls.user_cls.from_json(json.dumps(be_users[uid]), created=True) be_user.company = company_id be_user.save() diff --git a/apiserver/schema/services/events.conf b/apiserver/schema/services/events.conf index f445e15..f2a253d 100644 --- a/apiserver/schema/services/events.conf +++ b/apiserver/schema/services/events.conf @@ -767,7 +767,7 @@ get_multi_task_metrics { type: array items {type: string} } - model_metrics { + model_events { description: If not set or set to false then passed ids are task ids otherwise model ids type: boolean default: false diff --git a/apiserver/tests/automated/test_task_events.py b/apiserver/tests/automated/test_task_events.py index df81218..3cc3963 100644 --- a/apiserver/tests/automated/test_task_events.py +++ b/apiserver/tests/automated/test_task_events.py @@ -285,6 +285,15 @@ class TestTaskEvents(TestService): self._assert_log_events(task=task, expected_total=1) + metrics = self.api.events.get_multi_task_metrics( + tasks=[model], + event_type="training_stats_scalar", + model_events=True, + ).metrics + self.assertEqual([m.metric for m in metrics], [f"Metric{i}" for i in range(5)]) + variants = [f"Variant{i}" for i in range(5)] + self.assertTrue(all(m.variants == variants for m in metrics)) + def test_error_events(self): task = self._temp_task() events = [