You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by jh...@apache.org on 2021/08/13 18:20:39 UTC

[airflow] 19/38: Fixed task instance retrieval in XCom view (#16923)

This is an automated email from the ASF dual-hosted git repository.

jhtimmins pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 84bb0436eae65d2c77415cb129b6072c324a47b4
Author: Pietro <54...@users.noreply.github.com>
AuthorDate: Sun Jul 11 16:54:34 2021 +0200

    Fixed task instance retrieval in XCom view (#16923)
    
    The SQL logical "and" was not implemented correctly and hence the filter was returning wrong results
    
    (cherry picked from commit 9a1fc19a627662122dd8dacee2ef61c3edf97b85)
---
 airflow/www/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index fa89cb1..6b2b2a4 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1328,7 +1328,7 @@ class Airflow(AirflowBaseView):
         dm_db = models.DagModel
         ti_db = models.TaskInstance
         dag = session.query(dm_db).filter(dm_db.dag_id == dag_id).first()
-        ti = session.query(ti_db).filter(ti_db.dag_id == dag_id and ti_db.task_id == task_id).first()
+        ti = session.query(ti_db).filter(and_(ti_db.dag_id == dag_id, ti_db.task_id == task_id)).first()
 
         if not ti:
             flash(f"Task [{dag_id}.{task_id}] doesn't seem to exist at the moment", "error")