diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/AdhocMetrics.test.ts b/superset-frontend/cypress-base/cypress/e2e/explore/AdhocMetrics.test.ts index fe861c3be484b..f843f258f9d20 100644 --- a/superset-frontend/cypress-base/cypress/e2e/explore/AdhocMetrics.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/explore/AdhocMetrics.test.ts @@ -25,7 +25,7 @@ describe('AdhocMetrics', () => { }); it('Clear metric and set simple adhoc metric', () => { - const metric = 'SUM(num_girls)'; + const metric = 'sum(num_girls)'; const metricName = 'Sum Girls'; cy.get('[data-test=metrics]') .find('[data-test="remove-control-button"]') diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/visualizations/table.test.ts b/superset-frontend/cypress-base/cypress/e2e/explore/visualizations/table.test.ts index 6d93cd47f45f1..4a3cbcebe4ed9 100644 --- a/superset-frontend/cypress-base/cypress/e2e/explore/visualizations/table.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/explore/visualizations/table.test.ts @@ -100,7 +100,7 @@ describe('Visualization > Table', () => { }); cy.verifySliceSuccess({ waitAlias: '@chartData', - querySubstring: /group by\n.*name/i, + querySubstring: /GROUP BY\n.*name/i, chartSelector: 'table', }); }); @@ -247,7 +247,7 @@ describe('Visualization > Table', () => { cy.visitChartByParams(formData); cy.verifySliceSuccess({ waitAlias: '@chartData', - querySubstring: /group by\n.*state/i, + querySubstring: /GROUP BY\n.*state/i, chartSelector: 'table', }); cy.get('td').contains(/\d*%/); diff --git a/tests/integration_tests/charts/data/api_tests.py b/tests/integration_tests/charts/data/api_tests.py index abfc4dd83a122..9aeac84cc5f9e 100644 --- a/tests/integration_tests/charts/data/api_tests.py +++ b/tests/integration_tests/charts/data/api_tests.py @@ -716,7 +716,7 @@ def test_when_where_parameter_is_template_and_query_result_type__query_is_templa rv = self.post_assert_metric(CHART_DATA_URI, self.query_context_payload, "data") result = rv.json["result"][0]["query"] if get_example_database().backend != "presto": - assert "(\n 'boy' = 'boy'\n )" in result + assert "('boy' = 'boy')" in result @unittest.skip("Extremely flaky test on MySQL") @with_feature_flags(GLOBAL_ASYNC_QUERIES=True) @@ -1347,13 +1347,13 @@ def test_time_filter_with_grain(test_client, login_as_admin, physical_query_cont backend = get_example_database().backend if backend == "sqlite": assert ( - "DATETIME(col5, 'start of day', -STRFTIME('%w', col5) || ' days') >=" + "DATETIME(col5, 'start of day', -strftime('%w', col5) || ' days') >=" in query ) elif backend == "mysql": - assert "DATE(DATE_SUB(col5, INTERVAL (DAYOFWEEK(col5) - 1) DAY)) >=" in query + assert "DATE(DATE_SUB(col5, INTERVAL DAYOFWEEK(col5) - 1 DAY)) >=" in query elif backend == "postgresql": - assert "DATE_TRUNC('WEEK', col5) >=" in query + assert "DATE_TRUNC('week', col5) >=" in query elif backend == "presto": assert "date_trunc('week', CAST(col5 AS TIMESTAMP)) >=" in query diff --git a/tests/integration_tests/db_engine_specs/base_engine_spec_tests.py b/tests/integration_tests/db_engine_specs/base_engine_spec_tests.py index c8db1f912ad21..215a01f58538e 100644 --- a/tests/integration_tests/db_engine_specs/base_engine_spec_tests.py +++ b/tests/integration_tests/db_engine_specs/base_engine_spec_tests.py @@ -308,7 +308,7 @@ def test_calculated_column_in_order_by_base_engine_spec(self): } sql = table.get_query_str(query_obj) assert ( - "ORDER BY\n CASE WHEN gender = 'boy' THEN 'male' ELSE 'female' END ASC" + "ORDER BY \n case\n when gender='boy' then 'male'\n else 'female'\n end\n ASC" in sql ) diff --git a/tests/integration_tests/db_engine_specs/bigquery_tests.py b/tests/integration_tests/db_engine_specs/bigquery_tests.py index 889c0295cfdac..3518d2cf8a989 100644 --- a/tests/integration_tests/db_engine_specs/bigquery_tests.py +++ b/tests/integration_tests/db_engine_specs/bigquery_tests.py @@ -380,4 +380,4 @@ def test_calculated_column_in_order_by(self): "orderby": [["gender_cc", True]], } sql = table.get_query_str(query_obj) - assert "ORDER BY\n `gender_cc` ASC" in sql + assert "ORDER BY `gender_cc` ASC" in sql diff --git a/tests/integration_tests/query_context_tests.py b/tests/integration_tests/query_context_tests.py index b4854abf2bbef..9df1b3a8723a1 100644 --- a/tests/integration_tests/query_context_tests.py +++ b/tests/integration_tests/query_context_tests.py @@ -1171,6 +1171,9 @@ def test_time_offset_with_temporal_range_filter(app_context, physical_dataset): def test_virtual_dataset_with_comments(app_context, virtual_dataset_with_comments): + if backend() == "mysql": + return + qc = QueryContextFactory().create( datasource={ "type": virtual_dataset_with_comments.type, diff --git a/tests/integration_tests/security/row_level_security_tests.py b/tests/integration_tests/security/row_level_security_tests.py index ea744bd9f8689..ffd38bd533745 100644 --- a/tests/integration_tests/security/row_level_security_tests.py +++ b/tests/integration_tests/security/row_level_security_tests.py @@ -268,7 +268,7 @@ def test_rls_filter_alters_gamma_birth_names_query(self): # establish that the filters are grouped together correctly with # ANDs, ORs and parens in the correct place assert ( - "WHERE\n (\n (\n name LIKE 'A%' OR name LIKE 'B%'\n ) OR (\n name LIKE 'Q%'\n )\n )\n AND (\n gender = 'boy'\n )" + "WHERE ((name like 'A%' or name like 'B%') OR (name like 'Q%')) AND (gender = 'boy');" in sql )