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
1 change: 0 additions & 1 deletion airflow/api_fastapi/core_api/datamodels/dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class DAGResponse(BaseModel):
is_active: bool
last_parsed_time: datetime | None
last_expired: datetime | None
default_view: str | None
fileloc: str
description: str | None
timetable_summary: str | None
Expand Down
18 changes: 0 additions & 18 deletions airflow/api_fastapi/core_api/openapi/v1-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8227,11 +8227,6 @@ components:
format: date-time
- type: 'null'
title: Last Expired
default_view:
anyOf:
- type: string
- type: 'null'
title: Default View
fileloc:
type: string
title: Fileloc
Expand Down Expand Up @@ -8387,7 +8382,6 @@ components:
- is_active
- last_parsed_time
- last_expired
- default_view
- fileloc
- description
- timetable_summary
Expand Down Expand Up @@ -8457,11 +8451,6 @@ components:
format: date-time
- type: 'null'
title: Last Expired
default_view:
anyOf:
- type: string
- type: 'null'
title: Default View
fileloc:
type: string
title: Fileloc
Expand Down Expand Up @@ -8544,7 +8533,6 @@ components:
- is_active
- last_parsed_time
- last_expired
- default_view
- fileloc
- description
- timetable_summary
Expand Down Expand Up @@ -8973,11 +8961,6 @@ components:
format: date-time
- type: 'null'
title: Last Expired
default_view:
anyOf:
- type: string
- type: 'null'
title: Default View
fileloc:
type: string
title: Fileloc
Expand Down Expand Up @@ -9065,7 +9048,6 @@ components:
- is_active
- last_parsed_time
- last_expired
- default_view
- fileloc
- description
- timetable_summary
Expand Down
2 changes: 0 additions & 2 deletions airflow/cli/commands/remote_commands/dag_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class Meta:
is_active = auto_field(dump_only=True)
last_parsed_time = auto_field(dump_only=True)
last_expired = auto_field(dump_only=True)
default_view = auto_field(dump_only=True)
fileloc = auto_field(dump_only=True)
file_token = fields.Method("get_token", dump_only=True)
owners = fields.Method("get_owners", dump_only=True)
Expand Down Expand Up @@ -295,7 +294,6 @@ def _get_dagbag_dag_details(dag: DAG) -> dict:
"is_active": dag.get_is_active(),
"last_parsed_time": None,
"last_expired": None,
"default_view": dag.default_view,
"fileloc": dag.fileloc,
"file_token": None,
"owners": dag.owner,
Expand Down
7 changes: 0 additions & 7 deletions airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1687,13 +1687,6 @@ webserver:
type: string
example: ~
default: "False"
dag_default_view:
description: |
Default DAG view. Valid values are: ``grid``, ``graph``, ``duration``, ``gantt``, ``landing_times``
version_added: ~
type: string
example: ~
default: "grid"
dag_orientation:
description: |
Default DAG orientation. Valid values are:
Expand Down
1 change: 0 additions & 1 deletion airflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ def inversed_deprecated_sections(self):
},
"webserver": {
"navbar_color": (re.compile(r"(?i)^#007A87$"), "#fff", "2.1"),
"dag_default_view": (re.compile(r"^tree$"), "grid", "3.0"),
},
"email": {
"email_backend": (
Expand Down
1 change: 0 additions & 1 deletion airflow/dag_processing/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ def update_dags(
dm.is_active = True
dm.has_import_errors = False
dm.last_parsed_time = utcnow()
dm.default_view = dag.default_view or conf.get("webserver", "dag_default_view").lower()
if hasattr(dag, "_dag_display_property_value"):
dm._dag_display_property_value = dag._dag_display_property_value
elif dag.dag_display_name != dag.dag_id:
Expand Down
48 changes: 48 additions & 0 deletions airflow/migrations/versions/0062_3_0_0_remove_dag_default_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

"""
Remove dag.default_view column.

Revision ID: 16f7f5ee874e
Revises: cf87489a35df
Create Date: 2025-03-11 10:39:25.449265

"""

from __future__ import annotations

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "16f7f5ee874e"
down_revision = "cf87489a35df"
branch_labels = None
depends_on = None
airflow_version = "3.0.0"


def upgrade():
with op.batch_alter_table("dag", schema=None) as batch_op:
batch_op.drop_column("default_view")


def downgrade():
with op.batch_alter_table("dag", schema=None) as batch_op:
batch_op.add_column(sa.Column("default_view", sa.VARCHAR(length=25), nullable=True))
18 changes: 0 additions & 18 deletions airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@

log = logging.getLogger(__name__)

DEFAULT_VIEW_PRESETS = ["grid", "graph", "duration", "gantt", "landing_times"]
ORIENTATION_PRESETS = ["LR", "TB", "RL", "BT"]

AssetT = TypeVar("AssetT", bound=BaseAsset)
Expand Down Expand Up @@ -380,8 +379,6 @@ class DAG(TaskSDKDag, LoggingMixin):
:param dagrun_timeout: Specify the duration a DagRun should be allowed to run before it times out or
fails. Task instances that are running when a DagRun is timed out will be marked as skipped.
:param sla_miss_callback: DEPRECATED - The SLA feature is removed in Airflow 3.0, to be replaced with a new implementation in 3.1
:param default_view: Specify DAG default view (grid, graph, duration,
gantt, landing_times), default grid
:param orientation: Specify DAG orientation in graph view (LR, TB, RL, BT), default LR
:param catchup: Perform scheduler catchup (or only run latest)? Defaults to True
:param on_failure_callback: A function or list of functions to be called when a DagRun of this dag fails.
Expand Down Expand Up @@ -428,7 +425,6 @@ class DAG(TaskSDKDag, LoggingMixin):
partial: bool = False
last_loaded: datetime | None = attrs.field(factory=timezone.utcnow)

default_view: str = airflow_conf.get_mandatory_value("webserver", "dag_default_view").lower()
orientation: str = airflow_conf.get_mandatory_value("webserver", "dag_orientation")

# this will only be set at serialization time
Expand Down Expand Up @@ -1901,13 +1897,6 @@ def sync_to_db(self, session=NEW_SESSION):
bundle_version = self.get_bundle_version(session=session)
self.bulk_write_to_db(bundle_name, bundle_version, [self], session=session)

def get_default_view(self):
"""Allow backward compatible jinja2 templates."""
if self.default_view is None:
return airflow_conf.get("webserver", "dag_default_view").lower()
else:
return self.default_view

@staticmethod
@provide_session
def deactivate_unknown_dags(active_dag_ids, session=NEW_SESSION):
Expand Down Expand Up @@ -2084,8 +2073,6 @@ class DagModel(Base):
_dag_display_property_value = Column("dag_display_name", String(2000), nullable=True)
# Description of the dag
description = Column(Text)
# Default view of the DAG inside the webserver
default_view = Column(String(25))
# Timetable summary
timetable_summary = Column(Text, nullable=True)
# Timetable description
Expand Down Expand Up @@ -2235,11 +2222,6 @@ def get_paused_dag_ids(dag_ids: list[str], session: Session = NEW_SESSION) -> se
paused_dag_ids = {paused_dag_id for (paused_dag_id,) in paused_dag_ids}
return paused_dag_ids

def get_default_view(self) -> str:
"""Get the Default DAG View, returns the default config value if DagModel does not have a value."""
# This is for backwards-compatibility with old dags that don't have None as default_view
return self.default_view or airflow_conf.get_mandatory_value("webserver", "dag_default_view").lower()

@property
def safe_dag_id(self):
return self.dag_id.replace(".", "__dot__")
Expand Down
2 changes: 0 additions & 2 deletions airflow/serialization/serialized_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,6 @@ class SerializedDAG(DAG, BaseSerialization):
def __get_constructor_defaults():
param_to_attr = {
"description": "_description",
"default_view": "_default_view",
}
return {
param_to_attr.get(k, k): v.default
Expand Down Expand Up @@ -1917,7 +1916,6 @@ class LazyDeserializedDAG(pydantic.BaseModel):
"max_consecutive_failed_dag_runs",
"owner_links",
"access_control",
"default_view",
}

@property
Expand Down
36 changes: 0 additions & 36 deletions airflow/ui/openapi-gen/requests/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,17 +1589,6 @@ export const $DAGDetailsResponse = {
],
title: "Last Expired",
},
default_view: {
anyOf: [
{
type: "string",
},
{
type: "null",
},
],
title: "Default View",
},
fileloc: {
type: "string",
title: "Fileloc",
Expand Down Expand Up @@ -1884,7 +1873,6 @@ export const $DAGDetailsResponse = {
"is_active",
"last_parsed_time",
"last_expired",
"default_view",
"fileloc",
"description",
"timetable_summary",
Expand Down Expand Up @@ -1976,17 +1964,6 @@ export const $DAGResponse = {
],
title: "Last Expired",
},
default_view: {
anyOf: [
{
type: "string",
},
{
type: "null",
},
],
title: "Default View",
},
fileloc: {
type: "string",
title: "Fileloc",
Expand Down Expand Up @@ -2128,7 +2105,6 @@ export const $DAGResponse = {
"is_active",
"last_parsed_time",
"last_expired",
"default_view",
"fileloc",
"description",
"timetable_summary",
Expand Down Expand Up @@ -2776,17 +2752,6 @@ export const $DAGWithLatestDagRunsResponse = {
],
title: "Last Expired",
},
default_view: {
anyOf: [
{
type: "string",
},
{
type: "null",
},
],
title: "Default View",
},
fileloc: {
type: "string",
title: "Fileloc",
Expand Down Expand Up @@ -2935,7 +2900,6 @@ export const $DAGWithLatestDagRunsResponse = {
"is_active",
"last_parsed_time",
"last_expired",
"default_view",
"fileloc",
"description",
"timetable_summary",
Expand Down
3 changes: 0 additions & 3 deletions airflow/ui/openapi-gen/requests/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ export type DAGDetailsResponse = {
is_active: boolean;
last_parsed_time: string | null;
last_expired: string | null;
default_view: string | null;
fileloc: string;
description: string | null;
timetable_summary: string | null;
Expand Down Expand Up @@ -562,7 +561,6 @@ export type DAGResponse = {
is_active: boolean;
last_parsed_time: string | null;
last_expired: string | null;
default_view: string | null;
fileloc: string;
description: string | null;
timetable_summary: string | null;
Expand Down Expand Up @@ -737,7 +735,6 @@ export type DAGWithLatestDagRunsResponse = {
is_active: boolean;
last_parsed_time: string | null;
last_expired: string | null;
default_view: string | null;
fileloc: string;
description: string | null;
timetable_summary: string | null;
Expand Down
5 changes: 1 addition & 4 deletions airflow/ui/src/layouts/Details/DetailsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => {

const { data: dag } = useDagServiceGetDag({ dagId });

const [dagView, setDagView] = useLocalStorage<"graph" | "grid">(
`dag_view-${dagId}`,
dag && (dag.default_view === "graph" || dag.default_view === "grid") ? dag.default_view : "grid",
);
const [dagView, setDagView] = useLocalStorage<"graph" | "grid">(`dag_view-${dagId}`, "grid");

const { fitView, getZoom } = useReactFlow();

Expand Down
1 change: 0 additions & 1 deletion airflow/ui/src/mocks/handlers/dag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const MOCK_DAG = {
dag_display_name: "tutorial_taskflow_api",
dag_id: "tutorial_taskflow_api",
dag_run_timeout: null,
default_view: "grid",
description: null,
doc_md:
"\n ### TaskFlow API Tutorial Documentation\n This is a simple data pipeline example which demonstrates the use of\n the TaskFlow API using three simple tasks for Extract, Transform, and Load.\n Documentation that goes along with the Airflow TaskFlow API tutorial is\n located\n [here](https://airflow.apache.org/docs/apache-airflow/stable/tutorial_taskflow_api.html)\n ",
Expand Down
4 changes: 0 additions & 4 deletions airflow/ui/src/mocks/handlers/dags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const handlers: Array<HttpHandler> = [
const successDag = {
dag_display_name: "tutorial_taskflow_api_success",
dag_id: "tutorial_taskflow_api_success",
default_view: "grid",
file_token:
".eJw9yUsOgCAMBcC7cAB7JPISizR82kCJcnvjxtUsJlDWxlQwPEvhjU7TV0pk27N2goxU9f7lB80qxxPXJF-uQ1CjY5avI0wO2-EFouohiw.fhdU5u0Pb7lElEd-AUUXqjHSsdo",
fileloc: "/airflow/dags/tutorial_taskflow_api.py",
Expand Down Expand Up @@ -64,7 +63,6 @@ export const handlers: Array<HttpHandler> = [
const failedDag = {
dag_display_name: "tutorial_taskflow_api_failed",
dag_id: "tutorial_taskflow_api_failed",
default_view: "grid",
file_token:
".eJw9yUsOgCAMBcC7cAB7JPISizR82kCJcnvjxtUsJlDWxlQwPEvhjU7TV0pk27N2goxU9f7lB80qxxPXJF-uQ1CjY5avI0wO2-EFouohiw.fhdU5u0Pb7lElEd-AUUXqjHSsdo",
fileloc: "/airflow/dags/tutorial_taskflow_api_failed.py",
Expand Down Expand Up @@ -122,7 +120,6 @@ export const handlers: Array<HttpHandler> = [
const failedDag = {
dag_display_name: "tutorial_taskflow_api_failed",
dag_id: "tutorial_taskflow_api_failed",
default_view: "grid",
description: null,
file_token:
".eJw9yUsOgCAMBcC7cAB7JPISizR82kCJcnvjxtUsJlDWxlQwPEvhjU7TV0pk27N2goxU9f7lB80qxxPXJF-uQ1CjY5avI0wO2-EFouohiw.fhdU5u0Pb7lElEd-AUUXqjHSsdo",
Expand All @@ -149,7 +146,6 @@ export const handlers: Array<HttpHandler> = [
const successDag = {
dag_display_name: "tutorial_taskflow_api_success",
dag_id: "tutorial_taskflow_api_success",
default_view: "grid",
description: null,
file_token:
".eJw9yUsOgCAMBcC7cAB7JPISizR82kCJcnvjxtUsJlDWxlQwPEvhjU7TV0pk27N2goxU9f7lB80qxxPXJF-uQ1CjY5avI0wO2-EFouohiw.fhdU5u0Pb7lElEd-AUUXqjHSsdo",
Expand Down
Loading