pierrejeambrun commented on code in PR #63665:
URL: https://github.com/apache/airflow/pull/63665#discussion_r2967031368
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py:
##########
@@ -768,6 +768,34 @@ class TestPatchDags(TestDagEndpoint):
[DAG1_ID],
[DAG1_ID],
),
+ (
+ {"tags": ["tag_2"], "tags_match_mode": "any"},
+ {"is_paused": True},
+ 200,
+ [DAG1_ID],
+ [DAG1_ID],
+ ),
+ (
+ {"tags": ["tag_2", "example"], "tags_match_mode": "all"},
+ {"is_paused": True},
+ 200,
+ [DAG1_ID],
+ [DAG1_ID],
+ ),
+ (
+ {"tags": ["dummy"], "tags_match_mode": "any"},
+ {"is_paused": True},
+ 200,
+ [],
+ [],
+ ),
+ (
+ {"owners": ["test_owner"], "exclude_stale": False},
Review Comment:
Can you add a test case for what you are trying to solve. (match any tags,
multiple tags, and multiple dags patched)?
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py:
##########
@@ -340,6 +339,20 @@ def patch_dags(
except ValidationError as e:
raise RequestValidationError(errors=e.errors())
+ has_filters = any(
+ [
+ dag_id_pattern.value is not None,
+ tags.value is not None and tags.value.tags,
+ owners.value,
+ ]
Review Comment:
It's hard to justify why 'paused' or `exclude_stale` are excluded from this
check. (Only some filters contribute to the check which can seem confusing,
can't unpause all paused dags)
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py:
##########
Review Comment:
Here we need to iterate through the pages to get all of them.
--
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]