diff --git a/api/requirements-alerts.txt b/api/requirements-alerts.txt index 7456ef3b4..8402d4775 100644 --- a/api/requirements-alerts.txt +++ b/api/requirements-alerts.txt @@ -1,6 +1,6 @@ requests==2.28.1 urllib3==1.26.13 -boto3==1.26.41 +boto3==1.26.45 pyjwt==2.6.0 psycopg2-binary==2.9.5 elasticsearch==8.5.3 @@ -8,7 +8,7 @@ jira==3.4.1 -fastapi==0.88.0 +fastapi==0.89.0 uvicorn[standard]==0.20.0 python-decouple==3.6 pydantic[email]==1.10.4 diff --git a/api/requirements.txt b/api/requirements.txt index 7456ef3b4..8402d4775 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -1,6 +1,6 @@ requests==2.28.1 urllib3==1.26.13 -boto3==1.26.41 +boto3==1.26.45 pyjwt==2.6.0 psycopg2-binary==2.9.5 elasticsearch==8.5.3 @@ -8,7 +8,7 @@ jira==3.4.1 -fastapi==0.88.0 +fastapi==0.89.0 uvicorn[standard]==0.20.0 python-decouple==3.6 pydantic[email]==1.10.4 diff --git a/api/schemas.py b/api/schemas.py index 867e284e9..aeed98880 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -992,13 +992,13 @@ class CreateCardSchema(CardChartSchema): name: Optional[str] = Field(...) is_public: bool = Field(default=True) view_type: Union[MetricTimeseriesViewType, \ - MetricTableViewType, MetricOtherViewType] = Field(MetricTimeseriesViewType.line_chart) - metric_type: MetricType = Field(default=MetricType.timeseries) + MetricTableViewType, MetricOtherViewType] = Field(...) + metric_type: MetricType = Field(...) metric_of: Union[MetricOfTimeseries, MetricOfTable, MetricOfErrors, \ MetricOfPerformance, MetricOfResources, MetricOfWebVitals, \ MetricOfClickMap] = Field(MetricOfTable.user_id) metric_value: List[IssueType] = Field(default=[]) - metric_format: Optional[MetricFormatType] = Field(None) + metric_format: Optional[MetricFormatType] = Field(default=None) default_config: CardConfigSchema = Field(..., alias="config") is_template: bool = Field(default=False) thumbnail: Optional[str] = Field(default=None) @@ -1006,14 +1006,14 @@ class CreateCardSchema(CardChartSchema): # This is used to handle wrong values sent by the UI @root_validator(pre=True) def transform(cls, values): - values["isTemplate"] = values["metricType"] in [MetricType.errors, MetricType.performance, - MetricType.resources, MetricType.web_vital] + values["isTemplate"] = values.get("metricType") in [MetricType.errors, MetricType.performance, + MetricType.resources, MetricType.web_vital] if values.get("metricType") == MetricType.timeseries \ or values.get("metricType") == MetricType.table \ and values.get("metricOf") != MetricOfTable.issues: values["metricValue"] = [] - if values.get("metric_type") == MetricType.funnel.value and \ + if values.get("metricType") == MetricType.funnel.value and \ values.get("series") is not None and len(values["series"]) > 1: values["series"] = [values["series"][0]] @@ -1043,7 +1043,7 @@ class CreateCardSchema(CardChartSchema): assert values.get("metric_value") is None or len(values.get("metric_value")) == 0, \ f"metricValue is only available for metricOf:{MetricOfTable.issues}" elif values.get("metric_type") == MetricType.funnel: - pass + assert len(values["series"]) == 1, f"must have only 1 series for metricType:{MetricType.funnel}" # ignore this for now, let the UI send whatever he wants for metric_of # assert isinstance(values.get("metric_of"), MetricOfTimeseries), \ # f"metricOf must be of type {MetricOfTimeseries} for metricType:{MetricType.funnel}" diff --git a/ee/api/requirements-alerts.txt b/ee/api/requirements-alerts.txt index 003a08914..e88fcba30 100644 --- a/ee/api/requirements-alerts.txt +++ b/ee/api/requirements-alerts.txt @@ -1,6 +1,6 @@ requests==2.28.1 urllib3==1.26.13 -boto3==1.26.41 +boto3==1.26.45 pyjwt==2.6.0 psycopg2-binary==2.9.5 elasticsearch==8.5.3 @@ -8,7 +8,7 @@ jira==3.4.1 -fastapi==0.88.0 +fastapi==0.89.0 uvicorn[standard]==0.20.0 python-decouple==3.6 pydantic[email]==1.10.4 diff --git a/ee/api/requirements-crons.txt b/ee/api/requirements-crons.txt index 44504f728..ed7d49b55 100644 --- a/ee/api/requirements-crons.txt +++ b/ee/api/requirements-crons.txt @@ -1,6 +1,6 @@ requests==2.28.1 urllib3==1.26.13 -boto3==1.26.41 +boto3==1.26.45 pyjwt==2.6.0 psycopg2-binary==2.9.5 elasticsearch==8.5.3 diff --git a/ee/api/requirements.txt b/ee/api/requirements.txt index e9712ded8..4b456f979 100644 --- a/ee/api/requirements.txt +++ b/ee/api/requirements.txt @@ -1,6 +1,6 @@ requests==2.28.1 urllib3==1.26.13 -boto3==1.26.41 +boto3==1.26.45 pyjwt==2.6.0 psycopg2-binary==2.9.5 elasticsearch==8.5.3 @@ -8,7 +8,7 @@ jira==3.4.1 -fastapi==0.88.0 +fastapi==0.89.0 uvicorn[standard]==0.20.0 python-decouple==3.6 pydantic[email]==1.10.4