giftig commented on code in PR #21535:
URL: https://github.com/apache/superset/pull/21535#discussion_r1188656030


##########
tests/unit_tests/sql_parse_tests.py:
##########
@@ -525,6 +558,16 @@ def test_extract_tables_reusing_aliases() -> None:
 with q1 as ( select key from q2 where key = '5'),
 q2 as ( select key from src where key = '5')
 select * from (select key from q1) a
+"""
+        )
+        == {Table("q2"), Table("src")}
+    )

Review Comment:
   Having said that, we're using different databases. It wouldn't surprise me 
at all if postgres and sqlite handled CTEs slightly differently. If that's the 
case this endeavour is slightly doomed though; we'd need a lot more logic here 
to handle various different databases.
   
   Arguably it's impossible to maintain this without somehow asking the 
database for the table list instead of trying to work it out ourselves. 
Unfortunately for the db my team really cares about, trino, that's not readily 
possible.



##########
tests/unit_tests/sql_parse_tests.py:
##########
@@ -525,6 +558,16 @@ def test_extract_tables_reusing_aliases() -> None:
 with q1 as ( select key from q2 where key = '5'),
 q2 as ( select key from src where key = '5')
 select * from (select key from q1) a
+"""
+        )
+        == {Table("q2"), Table("src")}
+    )

Review Comment:
   Having said that, we're using different databases. It wouldn't surprise me 
at all if postgres and sqlite handled CTEs slightly differently. If that's the 
case this endeavour is slightly doomed though; we'd need a lot more logic here 
to handle various different databases.
   
   Arguably it's impossible to maintain this without somehow asking the 
database for the table list instead of trying to work it out ourselves. 
Unfortunately for the db my team really cares about, trino, that's not readily 
possible either.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to