This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new e69c6a7 fix: filter condition of TaskInstance does not work #17535
(#17548)
e69c6a7 is described below
commit e69c6a7a13f66c4c343efa848b9b8ac2ad93b1f5
Author: luoyuliuyin <[email protected]>
AuthorDate: Fri Aug 13 07:43:19 2021 +0800
fix: filter condition of TaskInstance does not work #17535 (#17548)
Make sure that after clicking the All Instances button in the Task Instance
panel, the results will be filtered by dag_id and task_id
closes https://github.com/apache/airflow/issues/17535
---
airflow/www/static/js/dag.js | 2 +-
tests/www/views/test_views.py | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/airflow/www/static/js/dag.js b/airflow/www/static/js/dag.js
index 604b0e7..92a5968 100644
--- a/airflow/www/static/js/dag.js
+++ b/airflow/www/static/js/dag.js
@@ -85,7 +85,7 @@ function updateModalUrls() {
}
updateButtonUrl(buttons.ti, {
- flt1_dag_id_equals: dagId,
+ _flt_3_dag_id: dagId,
_flt_3_task_id: taskId,
_oc_TaskInstanceModelView: executionDate,
});
diff --git a/tests/www/views/test_views.py b/tests/www/views/test_views.py
index a15f708..41aa338 100644
--- a/tests/www/views/test_views.py
+++ b/tests/www/views/test_views.py
@@ -116,6 +116,23 @@ def test_task_start_date_filter(admin_client, url,
content):
@pytest.mark.parametrize(
+ "url, content",
+ [
+ (
+ "/taskinstance/list/?_flt_3_dag_id=test_dag",
+ "List Task Instance",
+ )
+ ],
+ ids=["instance"],
+)
+def test_task_dag_id_equals_filter(admin_client, url, content):
+ resp = admin_client.get(url)
+ # We aren't checking the logic of the dag_id filter itself (that is built
+ # in to FAB) but simply that dag_id filter was run
+ check_content_in_response(content, resp)
+
+
[email protected](
"test_url, expected_url",
[
("", "/home"),