ashb commented on a change in pull request #10594:
URL: https://github.com/apache/airflow/pull/10594#discussion_r492220849



##########
File path: airflow/api_connexion/endpoints/xcom_endpoint.py
##########
@@ -49,22 +52,28 @@ def get_xcom_entries(
     """
 
     query = session.query(XCom)
-    if dag_id != '~':
+    if dag_id == '~':
+        appbuilder = current_app.appbuilder
+        readable_dag_ids = appbuilder.sm.get_readable_dag_ids(g.user)
+        query = query.filter(XCom.dag_id.in_(readable_dag_ids))
+        query.join(DR, and_(XCom.dag_id.in_(readable_dag_ids), 
XCom.execution_date == DR.execution_date))

Review comment:
       ```suggestion
            query.join(DR, and_(XCom.dag_id == DR.dag_id, XCom.execution_date 
== DR.execution_date))
   ```
   
   This is not your PR causing this -- but I also think that this is missing a 
`query = ` at the start -- I don't _think_ `.join()` mutates the query, but 
returns a new one. I could be wrong on this. (Separate PR to fix it if this 
_doesn't_ work as is)




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

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


Reply via email to