Skip to content

Commit

Permalink
Sorting param names in error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Oct 31, 2019
1 parent e20b2b5 commit 5213b52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redash/models/parameterized_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def missing_params_error(self):
if not missing_params:
return None

parameter_names = ', '.join('"{}"'.format(name) for name in missing_params)
parameter_names = ', '.join('"{}"'.format(name) for name in sorted(missing_params))
if len(missing_params) > 1:
message = 'Parameters {} are missing.'.format(parameter_names)
else:
Expand All @@ -241,7 +241,7 @@ def text(self):

class InvalidParameterError(Exception):
def __init__(self, parameter_errors):
parameter_names = ', '.join('"{}"'.format(name) for name in parameter_errors.keys())
parameter_names = ', '.join('"{}"'.format(name) for name in sorted(parameter_errors.keys()))
if len(parameter_errors) > 1:
message = 'Parameters {} are invalid.'.format(parameter_names)
else:
Expand Down

0 comments on commit 5213b52

Please sign in to comment.