From ce1abc98df307b770d68603c8652d0dfe4a6deae Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Mon, 21 Dec 2020 13:39:13 -0800 Subject: [PATCH] chore: rename variable for clarity (#12159) --- .../components/ErrorMessage/ParameterErrorMessage.tsx | 10 +++++----- superset/views/core.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx index efc94dc6f87..145200d9bfd 100644 --- a/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/ParameterErrorMessage.tsx @@ -79,14 +79,14 @@ function ParameterErrorMessage({ ([undefinedParameter, templateKeys]) => (
  • {tn( - '%(suggestion)s instead of "%(undefined)s?"', - '%(first_suggestions)s or %(last_suggestion)s instead of "%(undefined)s"?', + '%(suggestion)s instead of "%(undefinedParameter)s?"', + '%(firstSuggestions)s or %(lastSuggestion)s instead of "%(undefinedParameter)s"?', templateKeys.length, { suggestion: templateKeys.join(', '), - first_suggestions: templateKeys.slice(0, -1).join(', '), - last_suggestion: templateKeys[templateKeys.length - 1], - undefined: undefinedParameter, + firstSuggestions: templateKeys.slice(0, -1).join(', '), + lastSuggestion: templateKeys[templateKeys.length - 1], + undefinedParameter, }, )}
  • diff --git a/superset/views/core.py b/superset/views/core.py index c092b0add90..28953406e1b 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2521,21 +2521,21 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods if is_feature_enabled("ENABLE_TEMPLATE_PROCESSING"): # pylint: disable=protected-access ast = template_processor._env.parse(rendered_query) - undefined = find_undeclared_variables(ast) # type: ignore - if undefined: + undefined_parameters = find_undeclared_variables(ast) # type: ignore + if undefined_parameters: query.status = QueryStatus.FAILED session.commit() raise SupersetTemplateParamsErrorException( message=ngettext( "The parameter %(parameters)s in your query is undefined.", "The following parameters in your query are undefined: %(parameters)s.", - len(undefined), - parameters=utils.format_list(undefined), + len(undefined_parameters), + parameters=utils.format_list(undefined_parameters), ) + " " + PARAMETER_MISSING_ERR, extra={ - "undefined_parameters": list(undefined), + "undefined_parameters": list(undefined_parameters), "template_parameters": template_params, }, )