diff --git a/superset/sqllab/execution_context_convertor.py b/superset/sqllab/execution_context_convertor.py index dbeb2afdcf834..6d52355d20f75 100644 --- a/superset/sqllab/execution_context_convertor.py +++ b/superset/sqllab/execution_context_convertor.py @@ -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( diff --git a/superset/sqllab/query_render.py b/superset/sqllab/query_render.py index 9119af3c565eb..b03b21d83ce3a 100644 --- a/superset/sqllab/query_render.py +++ b/superset/sqllab/query_render.py @@ -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 @@ -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,}], }, ) diff --git a/superset/views/core.py b/superset/views/core.py index 26a53d4e4ad09..c9bcac7f3a17a 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -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, diff --git a/tests/integration_tests/sqllab_tests.py b/tests/integration_tests/sqllab_tests.py index 66fca3e859c23..b6dea6cf8531c 100644 --- a/tests/integration_tests/sqllab_tests.py +++ b/tests/integration_tests/sqllab_tests.py @@ -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",