prosoul icon indicating copy to clipboard operation
prosoul copied to clipboard

two metric with the same name looks not possible (UNIQUE constraint failed)

Open mhow2 opened this issue 6 years ago • 3 comments

qmodel_OW2-MRL_CMR-v0.1.json.txt

In the above model (renamed to .txt), if I rename the metric Unanswered Bugs-3 at MRL_Quality > Quality_Unanswered_Bugs_CMR to Unanswered Bugs-2, I get an error UNIQUE constraint failed: prosoul_metric.name

I think it is somehow because Unanswered Bugs-2 already exists somewhere in the model. But yet, it should be possible to have several metric with the same name in others attributes, isn't ?

mhow2 avatar Jun 06 '19 10:06 mhow2

It doesn't seem only related to the current model, but against all models that are loaded in the system. For instance, if you import the following two models one after another, you'll have the same error message and the import will fail. qmodel_OW2-MRL_CMR-v0.1.2.json.txt qmodel_OW2-MRL_CMR-v0.1.5.json.txt

mhow2 avatar Jun 07 '19 09:06 mhow2

The error is due to the fact that the unique id of a metric is its name. If there is more than one Metric with the same name, it could produce errors in the assessment process or in the dashboards.

So I think that the quickest and easiest way is to change the name of the Metrics when necessary.

Thanks!

dlumbrer avatar Jun 07 '19 13:06 dlumbrer

Ok, but is the uniqueness consider others models that are loaded in prosoul ? It seems to, and if yes, I don't understand why. Generally speaking, from the user perspective, you can have a same exact metric (name and data) used in several - but still different - attributes (and in several models loaded). At least it is how we have understood it.

mhow2 avatar Jun 07 '19 14:06 mhow2