in postgres you cannot order by a non-grouped column without doing an aggregate

This commit is contained in:
burnettk 2022-12-13 23:21:32 -05:00
parent 36c509532a
commit 7e39994c91
1 changed files with 2 additions and 2 deletions

View File

@ -1025,11 +1025,11 @@ def process_instance_list(
elif attribute in instance_metadata_aliases:
if order_by_option.startswith("-"):
order_by_query_array.append(
instance_metadata_aliases[attribute].value.desc()
func.max(instance_metadata_aliases[attribute].value).desc()
)
else:
order_by_query_array.append(
instance_metadata_aliases[attribute].value.asc()
func.max(instance_metadata_aliases[attribute].value).asc()
)
process_instances = (