villebro commented on code in PR #32525:
URL: https://github.com/apache/superset/pull/32525#discussion_r1984119913


##########
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:
   @korbit-ai I agree this isn't ideal. However, the reason why there's an 
explicit source that then falls back to the request referrer, is because these 
code paths are called both from synchronous flask request lifecycle AND 
asynchronously via Celery. When called via a Celery task, the source is passed 
along as a parameter, as there's no active flask request during that flow. For 
this reason we have this 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