Skip to content

Commit

Permalink
Include AS statement in SQL build query regardless of sqlalchemy vers…
Browse files Browse the repository at this point in the history
…ion (Point72#205)

Signed-off-by: Adam Glustein <Adam.Glustein@Point72.com>
  • Loading branch information
AdamGlustein committed Apr 29, 2024
1 parent 4621584 commit 7b07bea
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions csp/adapters/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,7 @@ def build_query(self, starttime, endtime):
elif self._rep._use_raw_user_query:
return db.text(self._rep._query)
else: # self._rep._query
if _SQLALCHEMY_2:
from_obj = db.text(f"({self._rep._query})")
else:
from_obj = db.text(f"({self._rep._query}) AS user_query")
from_obj = db.text(f"({self._rep._query}) AS user_query")

time_columns = self._rep._time_accessor.get_time_columns(self._rep._connection)
if time_columns:
Expand Down

0 comments on commit 7b07bea

Please sign in to comment.