Skip to content

Commit

Permalink
pylint (#17172)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Oct 20, 2021
1 parent 531aae2 commit 5e1b235
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/sqllab_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5e1b235

Please sign in to comment.