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


##########
superset/db_engine_specs/__init__.py:
##########
@@ -211,6 +217,11 @@ def get_available_engine_specs() -> 
dict[type[BaseEngineSpec], set[str]]:  # noq
             if sqla_compiler.OPERATORS != operators_snapshot:
                 sqla_compiler.OPERATORS.clear()
                 sqla_compiler.OPERATORS.update(operators_snapshot)
+            if preparer_cls.reserved_words is not reserved_words:
+                preparer_cls.reserved_words = reserved_words
+            if reserved_words != reserved_words_snapshot:
+                reserved_words.clear()
+                reserved_words.update(reserved_words_snapshot)

Review Comment:
   Partly fixed in c1d342e275. The mutation itself happens inside the 
third-party import, so Superset cannot make that atomic without locking all SQL 
compilation. The restore was the part we control, and `clear()` + `update()` 
left a moment where `OPERATORS` and `reserved_words` were empty. The restore 
now removes only the entries the dialect added and then puts the originals 
back, so the shared objects are never empty. Added a test that fails if the 
restore ever empties or drops an original entry.



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