From 5e1b23553610b57b23f4597d14e98b48c0f9a27b Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Wed, 20 Oct 2021 13:24:42 -0400 Subject: [PATCH] pylint (#17172) --- superset/sql_lab.py | 4 +++- tests/integration_tests/sqllab_tests.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/superset/sql_lab.py b/superset/sql_lab.py index 2017ad6f0172..9efebfb767ab 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -287,7 +287,9 @@ def execute_sql_statement( # pylint: disable=too-many-arguments,too-many-locals return SupersetResultSet(data, cursor_description, db_engine_spec) -def apply_limit_if_exists(database: Database, increased_limit: int, query: Query, sql: str) -> str: +def apply_limit_if_exists( + database: Database, increased_limit: Optional[int], query: Query, sql: str +) -> str: if query.limit and increased_limit: # We are fetching one more than the requested limit in order # to test whether there are more rows than the limit. diff --git a/tests/integration_tests/sqllab_tests.py b/tests/integration_tests/sqllab_tests.py index df09187d557b..6738759b069e 100644 --- a/tests/integration_tests/sqllab_tests.py +++ b/tests/integration_tests/sqllab_tests.py @@ -43,7 +43,8 @@ execute_sql_statements, execute_sql_statement, get_sql_results, - SqlLabException, apply_limit_if_exists, + SqlLabException, + apply_limit_if_exists, ) from superset.sql_parse import CtasMethod from superset.utils.core import ( @@ -1003,7 +1004,6 @@ def test_apply_limit_if_exists_when_incremented_limit_is_none(self): assert final_sql == sql - @pytest.mark.parametrize("spec", [HiveEngineSpec, PrestoEngineSpec]) def test_cancel_query_implicit(spec: BaseEngineSpec) -> None: query = mock.MagicMock()