korbit-ai[bot] commented on code in PR #32525:
URL: https://github.com/apache/superset/pull/32525#discussion_r1984120222


##########
superset/models/core.py:
##########
@@ -537,13 +537,7 @@
         self.update_params_from_encrypted_extra(params)
 
         if DB_CONNECTION_MUTATOR:
-            if not source and request and request.referrer:
-                if "/superset/dashboard/" in request.referrer:
-                    source = utils.QuerySource.DASHBOARD
-                elif "/explore/" in request.referrer:
-                    source = utils.QuerySource.CHART
-                elif "/sqllab/" in request.referrer:
-                    source = utils.QuerySource.SQL_LAB
+            source = source or get_query_source_from_request()

Review Comment:
   @villebro Thank you for explaining the need for a dual logic to account for 
the sync and async use-cases. This analysis makes sense. It could be beneficial 
to consider encapsulating the dual logic (synchronous and asynchronous cases) 
in a separate method or class, so as to keep this logic in a centralized place 
to minimize any future confusion or errors. You could possibly also improve 
code readability by adding more detailed comments to explain the need for dual 
logic.



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