Skip to content

Commit

Permalink
fix failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
ofekisr committed Oct 2, 2021
1 parent 8de7bf7 commit 98ca456
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions superset/sqllab/execution_context_convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@


class ExecutionContextConvertorImpl(ExecutionContextConvertor):
_max_row_in_display_configuration: bool # pylint: disable=invalid-name
_max_row_in_display_configuration: int # pylint: disable=invalid-name

def set_max_row_in_display(self, value: bool) -> None:
def set_max_row_in_display(self, value: int) -> None:
self._max_row_in_display_configuration = value # pylint: disable=invalid-name

def to_payload(
Expand Down
3 changes: 3 additions & 0 deletions superset/sqllab/query_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
from superset.sqllab.exceptions import SqlLabException
from superset.utils import core as utils

MSG_OF_1006 = "Issue 1006 - One or more parameters specified in the query are missing."

if TYPE_CHECKING:
from superset.sqllab.sqllab_execution_context import SqlJsonExecutionContext
from superset.jinja_context import BaseTemplateProcessor
Expand Down Expand Up @@ -98,6 +100,7 @@ def _raise_undefined_parameter_exception(
extra={
"undefined_parameters": list(undefined_parameters),
"template_parameters": execution_context.template_params,
"issue_codes": [{"code": 1006, "message": MSG_OF_1006,}],
},
)

Expand Down
2 changes: 1 addition & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,7 @@ def _create_sql_json_command(
)
execution_context_convertor = ExecutionContextConvertorImpl()
execution_context_convertor.set_max_row_in_display(
bool(config.get("DISPLAY_MAX_ROW"))
int(config.get("DISPLAY_MAX_ROW")) # type: ignore
)
return ExecuteSqlCommand(
execution_context,
Expand Down
1 change: 0 additions & 1 deletion tests/integration_tests/sqllab_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ def test_api_database(self):
)
self.delete_fake_db()

@pytest.mark.ofek
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@mock.patch.dict(
"superset.extensions.feature_flag_manager._feature_flags",
Expand Down

0 comments on commit 98ca456

Please sign in to comment.