Skip to content

Commit

Permalink
Fix: metrics wasn't handling non ORM join correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr authored and justinclift committed Oct 25, 2024
1 parent d8dde6c commit 7ecd629
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redash/metrics/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sqlalchemy.engine import Engine
from sqlalchemy.event import listens_for
from sqlalchemy.orm.util import _ORMJoin
from sqlalchemy.sql.selectable import Alias
from sqlalchemy.sql.selectable import Alias, Join

from redash import statsd_client

Expand All @@ -18,7 +18,7 @@ def _table_name_from_select_element(elt):
if isinstance(t, Alias):
t = t.original.froms[0]

while isinstance(t, _ORMJoin):
while isinstance(t, _ORMJoin) or isinstance(t, Join):
t = t.left

return t.name
Expand Down

0 comments on commit 7ecd629

Please sign in to comment.