From 1269cc2f88265103b16ea24021875aec06002d25 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Thu, 17 Jun 2021 14:55:50 +0300 Subject: [PATCH] fix(examples): calendar chart metric should be metrics (#15173) * fix(examples): calendar chart metric should be metrics * fix presto test --- superset/examples/random_time_series.py | 2 +- tests/dashboards/api_tests.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/superset/examples/random_time_series.py b/superset/examples/random_time_series.py index 29c9db3458..1109c110f1 100644 --- a/superset/examples/random_time_series.py +++ b/superset/examples/random_time_series.py @@ -69,7 +69,7 @@ def load_random_time_series_data( "row_limit": config["ROW_LIMIT"], "since": "2019-01-01", "until": "2019-02-01", - "metric": "count", + "metrics": ["count"], "viz_type": "cal_heatmap", "domain_granularity": "month", "subdomain_granularity": "day", diff --git a/tests/dashboards/api_tests.py b/tests/dashboards/api_tests.py index 0cb027e188..f6becf56e6 100644 --- a/tests/dashboards/api_tests.py +++ b/tests/dashboards/api_tests.py @@ -37,6 +37,7 @@ from superset.models.dashboard import Dashboard from superset.models.core import FavStar, FavStarClassName from superset.models.reports import ReportSchedule, ReportScheduleType from superset.models.slice import Slice +from superset.utils.core import backend from superset.views.base import generate_download_headers from tests.base_api_tests import ApiOwnersTestCaseMixin @@ -182,7 +183,8 @@ class TestDashboardApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixi result = data["result"] actual_dataset_ids = set([dataset["id"] for dataset in result]) self.assertEqual(actual_dataset_ids, expected_dataset_ids) - self.assertEqual(result[0]["column_types"], [0, 1, 2]) + expected_values = [0, 1] if backend() == "presto" else [0, 1, 2] + self.assertEqual(result[0]["column_types"], expected_values) @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices") def test_get_dashboard_datasets_not_found(self):