Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 0 additions & 92 deletions airflow-core/src/airflow/api_fastapi/common/db/dags.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2872,14 +2872,6 @@ paths:
- type: boolean
- type: 'null'
title: Paused
- name: last_dag_run_state
in: query
required: false
schema:
anyOf:
- $ref: '#/components/schemas/DagRunState'
- type: 'null'
title: Last Dag Run State
requestBody:
required: true
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
apply_filters_to_select,
paginated_select,
)
from airflow.api_fastapi.common.db.dags import generate_dag_with_latest_run_query
from airflow.api_fastapi.common.parameters import (
FilterOptionEnum,
FilterParam,
Expand Down Expand Up @@ -301,7 +300,6 @@ def patch_dags(
dag_id_pattern: QueryDagIdPatternSearchWithNone,
exclude_stale: QueryExcludeStaleFilter,
paused: QueryPausedFilter,
last_dag_run_state: QueryLastDagRunStateFilter,
editable_dags_filter: EditableDagsFilterDep,
session: SessionDep,
update_mask: list[str] | None = Query(None),
Expand All @@ -318,18 +316,14 @@ def patch_dags(
except ValidationError as e:
raise RequestValidationError(errors=e.errors())

# todo: this is not used?
update_mask = ["is_paused"]

dags_select, total_entries = paginated_select(
statement=generate_dag_with_latest_run_query(),
statement=select(DagModel),
filters=[
exclude_stale,
paused,
dag_id_pattern,
tags,
owners,
last_dag_run_state,
editable_dags_filter,
],
order_by=None,
Expand Down
5 changes: 0 additions & 5 deletions airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3937,7 +3937,6 @@ export const useDagRunServicePatchDagRun = <
* @param data.dagIdPattern SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.excludeStale
* @param data.paused
* @param data.lastDagRunState
* @returns DAGCollectionResponse Successful Response
* @throws ApiError
*/
Expand All @@ -3953,7 +3952,6 @@ export const useDagServicePatchDags = <
{
dagIdPattern?: string;
excludeStale?: boolean;
lastDagRunState?: DagRunState;
limit?: number;
offset?: number;
owners?: string[];
Expand All @@ -3974,7 +3972,6 @@ export const useDagServicePatchDags = <
{
dagIdPattern?: string;
excludeStale?: boolean;
lastDagRunState?: DagRunState;
limit?: number;
offset?: number;
owners?: string[];
Expand All @@ -3989,7 +3986,6 @@ export const useDagServicePatchDags = <
mutationFn: ({
dagIdPattern,
excludeStale,
lastDagRunState,
limit,
offset,
owners,
Expand All @@ -4002,7 +3998,6 @@ export const useDagServicePatchDags = <
DagService.patchDags({
dagIdPattern,
excludeStale,
lastDagRunState,
limit,
offset,
owners,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,6 @@ export class DagService {
* @param data.dagIdPattern SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.excludeStale
* @param data.paused
* @param data.lastDagRunState
* @returns DAGCollectionResponse Successful Response
* @throws ApiError
*/
Expand All @@ -1595,7 +1594,6 @@ export class DagService {
dag_id_pattern: data.dagIdPattern,
exclude_stale: data.excludeStale,
paused: data.paused,
last_dag_run_state: data.lastDagRunState,
},
body: data.requestBody,
mediaType: "application/json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,6 @@ export type PatchDagsData = {
*/
dagIdPattern?: string | null;
excludeStale?: boolean;
lastDagRunState?: DagRunState | null;
limit?: number;
offset?: number;
owners?: Array<string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,9 @@ def test_patch_dags(
assert response.status_code == expected_status_code
if expected_status_code == 200:
body = response.json()
assert [dag["dag_id"] for dag in body["dags"]] == expected_ids
paused_dag_ids = [dag["dag_id"] for dag in body["dags"] if dag["is_paused"]]
assert paused_dag_ids == expected_paused_ids
assert {dag["dag_id"] for dag in body["dags"]} == set(expected_ids)
paused_dag_ids = {dag["dag_id"] for dag in body["dags"] if dag["is_paused"]}
assert paused_dag_ids == set(expected_paused_ids)
check_last_log(session, dag_id=DAG1_ID, event="patch_dag", logical_date=None)

@mock.patch("airflow.api_fastapi.auth.managers.base_auth_manager.BaseAuthManager.get_authorized_dag_ids")
Expand All @@ -381,7 +381,7 @@ def test_patch_dags_should_call_authorized_dag_ids(self, mock_get_authorized_dag
assert response.status_code == 200
body = response.json()

assert [dag["dag_id"] for dag in body["dags"]] == [DAG1_ID, DAG2_ID]
assert {dag["dag_id"] for dag in body["dags"]} == {DAG1_ID, DAG2_ID}

def test_patch_dags_should_response_401(self, unauthenticated_test_client):
response = unauthenticated_test_client.patch("/dags", json={"is_paused": True})
Expand Down
Loading