Skip to content

Commit

Permalink
fix order by eval error
Browse files Browse the repository at this point in the history
  • Loading branch information
cfahlgren1 authored and rishsriv committed Feb 4, 2024
1 parent 85950ce commit 45d3167
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eval/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def normalize_table(
# get all columns in the ORDER BY clause, by looking at the text between ORDER BY and the next semicolon, comma, or parantheses
pattern = re.compile(r"(?<=ORDER BY)(.*?)(?=;|,|\)|$)", re.IGNORECASE)
order_by_columns = re.findall(pattern, order_by_clause)
order_by_columns = order_by_columns[0].split()
order_by_columns = (
order_by_columns[0].split() if order_by_columns else []
)
order_by_columns = [
col.strip().rsplit(".", 1)[-1] for col in order_by_columns
]
Expand Down

0 comments on commit 45d3167

Please sign in to comment.