feat(chalice): changed insights payload transform

This commit is contained in:
Taha Yassine Kraiem 2023-01-10 17:10:35 +01:00
parent fff0eaf206
commit 51249127fd

View file

@ -1016,8 +1016,10 @@ class CreateCardSchema(CardChartSchema):
if values.get("metricType") == MetricType.funnel.value and \
values.get("series") is not None and len(values["series"]) > 1:
values["series"] = [values["series"][0]]
elif values.get("metricType") not in (MetricType.table.value, MetricType.timeseries.value) and \
values.get("series") is not None and len(values["series"]) > 0:
elif values.get("metricType") not in (MetricType.table.value,
MetricType.timeseries.value,
MetricType.insights.value) \
and values.get("series") is not None and len(values["series"]) > 0:
values["series"] = []
return values