aminghadersohi commented on code in PR #44706:
URL: https://github.com/apache/superset/pull/44706#discussion_r4140675161


##########
superset/db_engine_specs/db2.py:
##########
@@ -153,5 +153,10 @@ def get_prequeries(
         """
         if not schema:
             return []
-        escaped = schema.replace('"', '""')
+        # Schema names come from the inspector, where unquoted (upper-case) DB2
+        # names are normalized to lower case. Quoting that name as-is would
+        # select a different, usually non-existent, schema, so convert it back
+        # to the name stored in the catalog first.
+        name = database.get_dialect().denormalize_name(schema)

Review Comment:
   Applied in d782f1e: `get_prequeries` now calls 
`cls.denormalize_name(database.get_dialect(), schema)`, so the 
`requires_name_normalize` gate lives in one place. Added 
`test_get_prequeries_without_name_normalization` to cover the ungated path.



-- 
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