Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sorting not working for columns with special characters #436

Merged
merged 2 commits into from
May 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rd_ui/app/scripts/ng_smart_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@
function sortDataRow(array, column) {
var sortAlgo = (scope.sortAlgorithm && angular.isFunction(scope.sortAlgorithm)) === true ? scope.sortAlgorithm : filter('orderBy');
if (column) {
return arrayUtility.sort(array, sortAlgo, column.sortPredicate, column.reverse);
var predicate = function(o) {
return o[column.sortPredicate];
};
return arrayUtility.sort(array, sortAlgo, predicate, column.reverse);
} else {
return array;
}
Expand Down
2 changes: 1 addition & 1 deletion redash/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def execute_query(self, query, data_source_id, metadata):

logging.debug("Annotation: %s", annotation)

annotated_query = "/* {} */ {}".format(annotation, query)
annotated_query = u"/* {} */ {}".format(annotation, query)
else:
annotated_query = query

Expand Down