Skip to content

Commit

Permalink
fix failed black
Browse files Browse the repository at this point in the history
  • Loading branch information
ofekisr committed Sep 30, 2021
1 parent 3fd8193 commit 8de7bf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions superset/sqllab/query_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def _raise_undefined_parameter_exception(
self, execution_context: SqlJsonExecutionContext, undefined_parameters: Any
) -> None:
raise SqlQueryRenderException(
execution_context,
SupersetErrorType.MISSING_TEMPLATE_PARAMS_ERROR,
ngettext(
sql_json_execution_context=execution_context,
error_type=SupersetErrorType.MISSING_TEMPLATE_PARAMS_ERROR,
reason_message=ngettext(
"The parameter %(parameters)s in your query is undefined.",
"The following parameters in your query are undefined: %(parameters)s.",
len(undefined_parameters),
Expand All @@ -105,7 +105,7 @@ def _raise_template_exception(
self, ex: Exception, execution_context: SqlJsonExecutionContext
) -> None:
raise SqlQueryRenderException(
execution_context,
sql_json_execution_context=execution_context,
error_type=SupersetErrorType.INVALID_TEMPLATE_PARAMS_ERROR,
reason_message=__(
"The query contains one or more malformed template parameters."
Expand Down Expand Up @@ -142,3 +142,9 @@ def __init__(
@property
def extra(self) -> Optional[Dict[str, Any]]:
return self._extra

def to_dict(self) -> Dict[str, Any]:
rv = super().to_dict()
if self._extra:
rv["extra"] = self._extra
return rv
1 change: 1 addition & 0 deletions tests/integration_tests/sqllab_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ 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 8de7bf7

Please sign in to comment.