From dc320f524fcb0a1241e65cc17ecaf9b35bdb8774 Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Mon, 11 Aug 2025 11:41:11 +0530 Subject: [PATCH 1/8] issue fix 53738 --- .../airflow/api_fastapi/common/parameters.py | 56 ++++++++++++++++++- .../core_api/routes/public/dags.py | 7 +++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py index 5494fe0d304d2..ba04fb932940c 100644 --- a/airflow-core/src/airflow/api_fastapi/common/parameters.py +++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py @@ -60,6 +60,9 @@ from airflow.typing_compat import Self from airflow.utils.state import DagRunState, TaskInstanceState from airflow.utils.types import DagRunType +from airflow.models.serialized_dag import SerializedDagModel +from airflow.api_fastapi.core_api.datamodels.dags import DAGResponse +from airflow.serialization.serialized_objects import LazyDeserializedDAG if TYPE_CHECKING: from sqlalchemy.sql import ColumnElement, Select @@ -443,8 +446,59 @@ def to_orm(self, select: Select) -> Select: @classmethod def depends(cls, owners: list[str] = Query(default_factory=list)) -> _OwnersFilter: - return cls().set_value(owners) + return cls().set_value(owners) + +class TimetableTypes(str, Enum): + """Different timetable types.""" + + cron = "airflow.timetables.trigger.CronTriggerTimetable" + multiple_cron = "airflow.timetables.trigger.MultipleCronTriggerTimetable" + delta = "airflow.timetables.trigger.DeltaTriggerTimetable" + delta_data_interval = "airflow.timetables.trigger.DeltaDataIntervalTimetable" + cron_data_interval = "airflow.timetables.trigger.CronDataIntervalTimetable" + events = "airflow.timetables.events.EventsTimetable" + assets = "airflow.timetables.assets.AssetOrTimeSchedule" + no_trigger_defined= "airflow.timetables.simple.NullTimetable" + dataset = "airflow.timetables.dataset.DatasetTriggerTimetable" + +class _TimetableTypesFilter(BaseParam[list[TimetableTypes]]): + """Filter on timetable type.""" + + def filter_from_dags(self,dags:list[DAGResponse],timetable_type: list[TimetableTypes],session)->list[DAGResponse]: + filtered_dags=[] + dags_from_iterator=dict() + + for dag in dags: + dags_from_iterator[dag.dag_id]=dag + + serialized_dags_select = ( + select(SerializedDagModel) + .join(DagModel, SerializedDagModel.dag_id == DagModel.dag_id) + .where(SerializedDagModel.dag_id.in_(dags_from_iterator.keys())) + ) + + serialized_dags_results = session.scalars(serialized_dags_select).all() + + for serialized_dag_model in serialized_dags_results: + if serialized_dag_model.data: + lazy_dag = LazyDeserializedDAG(data=serialized_dag_model.data) + timetable_class = type(lazy_dag.timetable) + if f"{timetable_class.__module__}.{timetable_class.__qualname__}" in timetable_type: + filtered_dags.append(dags_from_iterator[serialized_dag_model.dag_id]) + + return filtered_dags + + def to_orm(self, select: Select) -> Select: + pass + @classmethod + def depends( + cls, + timetable_type: list[TimetableTypes] = Query(default_factory=list), + ) -> _TimetableTypesFilter: + return cls().set_value(timetable_type) + + def _safe_parse_datetime(date_to_check: str) -> datetime: """ diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py index 2af6073d60586..29dac4c80f602 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py @@ -72,6 +72,7 @@ from airflow.models import DagModel from airflow.models.dag_favorite import DagFavorite from airflow.models.dagrun import DagRun +from airflow.api_fastapi.common.parameters import TimetableTypes,_TimetableTypesFilter dags_router = AirflowRouter(tags=["DAG"], prefix="/dags") @@ -121,6 +122,7 @@ def get_dags( readable_dags_filter: ReadableDagsFilterDep, session: SessionDep, is_favorite: QueryFavoriteFilter, + timetable_type: list[TimetableTypes] = Query(None) ) -> DAGCollectionResponse: """Get all DAGs.""" query = generate_dag_with_latest_run_query( @@ -155,6 +157,11 @@ def get_dags( dags = session.scalars(dags_select) + if timetable_type: + filter_instance = _TimetableTypesFilter().depends(timetable_type=timetable_type) + dags = filter_instance.filter_from_dags(dags,timetable_type, session) + total_entries=len(dags) + return DAGCollectionResponse( dags=dags, total_entries=total_entries, From 3e111e8663f3d0dfde581a0333a82811f3223bc8 Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Tue, 12 Aug 2025 09:41:08 +0530 Subject: [PATCH 2/8] changed TimetableTypesFilter --- .../airflow/api_fastapi/common/parameters.py | 20 ++++--------------- .../core_api/routes/public/dags.py | 4 ++-- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py index ba04fb932940c..0856d542bd56f 100644 --- a/airflow-core/src/airflow/api_fastapi/common/parameters.py +++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py @@ -448,23 +448,11 @@ def to_orm(self, select: Select) -> Select: def depends(cls, owners: list[str] = Query(default_factory=list)) -> _OwnersFilter: return cls().set_value(owners) -class TimetableTypes(str, Enum): - """Different timetable types.""" - - cron = "airflow.timetables.trigger.CronTriggerTimetable" - multiple_cron = "airflow.timetables.trigger.MultipleCronTriggerTimetable" - delta = "airflow.timetables.trigger.DeltaTriggerTimetable" - delta_data_interval = "airflow.timetables.trigger.DeltaDataIntervalTimetable" - cron_data_interval = "airflow.timetables.trigger.CronDataIntervalTimetable" - events = "airflow.timetables.events.EventsTimetable" - assets = "airflow.timetables.assets.AssetOrTimeSchedule" - no_trigger_defined= "airflow.timetables.simple.NullTimetable" - dataset = "airflow.timetables.dataset.DatasetTriggerTimetable" - -class _TimetableTypesFilter(BaseParam[list[TimetableTypes]]): + +class _TimetableTypesFilter(BaseParam[list[str]]): """Filter on timetable type.""" - def filter_from_dags(self,dags:list[DAGResponse],timetable_type: list[TimetableTypes],session)->list[DAGResponse]: + def filter_from_dags(self,dags:list[DAGResponse],timetable_type: list[str],session)->list[DAGResponse]: filtered_dags=[] dags_from_iterator=dict() @@ -494,7 +482,7 @@ def to_orm(self, select: Select) -> Select: @classmethod def depends( cls, - timetable_type: list[TimetableTypes] = Query(default_factory=list), + timetable_type: list[str] = Query(default_factory=list), ) -> _TimetableTypesFilter: return cls().set_value(timetable_type) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py index 29dac4c80f602..d271e6b2f5b37 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py @@ -72,7 +72,7 @@ from airflow.models import DagModel from airflow.models.dag_favorite import DagFavorite from airflow.models.dagrun import DagRun -from airflow.api_fastapi.common.parameters import TimetableTypes,_TimetableTypesFilter +from airflow.api_fastapi.common.parameters import _TimetableTypesFilter dags_router = AirflowRouter(tags=["DAG"], prefix="/dags") @@ -122,7 +122,7 @@ def get_dags( readable_dags_filter: ReadableDagsFilterDep, session: SessionDep, is_favorite: QueryFavoriteFilter, - timetable_type: list[TimetableTypes] = Query(None) + timetable_type: list[str] = Query(None) ) -> DAGCollectionResponse: """Get all DAGs.""" query = generate_dag_with_latest_run_query( From 2050650b66c3c79b7113eb058191c70378454a31 Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Wed, 13 Aug 2025 11:50:01 +0530 Subject: [PATCH 3/8] implemented query time filtering --- .../airflow/api_fastapi/common/parameters.py | 56 ++++++++----------- .../openapi/v2-rest-api-generated.yaml | 8 +++ .../core_api/routes/public/dags.py | 10 +--- 3 files changed, 35 insertions(+), 39 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py index 0856d542bd56f..77e415860eea9 100644 --- a/airflow-core/src/airflow/api_fastapi/common/parameters.py +++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py @@ -34,7 +34,7 @@ from fastapi import Depends, HTTPException, Query, status from pendulum.parsing.exceptions import ParserError from pydantic import AfterValidator, BaseModel, NonNegativeInt -from sqlalchemy import Column, and_, case, func, not_, or_, select +from sqlalchemy import Column, and_, case, func, not_, or_, select, text from sqlalchemy.inspection import inspect from airflow._shared.timezones import timezone @@ -55,14 +55,12 @@ from airflow.models.dagrun import DagRun from airflow.models.hitl import HITLDetail from airflow.models.pool import Pool +from airflow.models.serialized_dag import SerializedDagModel from airflow.models.taskinstance import TaskInstance from airflow.models.variable import Variable from airflow.typing_compat import Self from airflow.utils.state import DagRunState, TaskInstanceState from airflow.utils.types import DagRunType -from airflow.models.serialized_dag import SerializedDagModel -from airflow.api_fastapi.core_api.datamodels.dags import DAGResponse -from airflow.serialization.serialized_objects import LazyDeserializedDAG if TYPE_CHECKING: from sqlalchemy.sql import ColumnElement, Select @@ -446,38 +444,32 @@ def to_orm(self, select: Select) -> Select: @classmethod def depends(cls, owners: list[str] = Query(default_factory=list)) -> _OwnersFilter: - return cls().set_value(owners) + return cls().set_value(owners) class _TimetableTypesFilter(BaseParam[list[str]]): """Filter on timetable type.""" - def filter_from_dags(self,dags:list[DAGResponse],timetable_type: list[str],session)->list[DAGResponse]: - filtered_dags=[] - dags_from_iterator=dict() - - for dag in dags: - dags_from_iterator[dag.dag_id]=dag - - serialized_dags_select = ( - select(SerializedDagModel) - .join(DagModel, SerializedDagModel.dag_id == DagModel.dag_id) - .where(SerializedDagModel.dag_id.in_(dags_from_iterator.keys())) - ) - - serialized_dags_results = session.scalars(serialized_dags_select).all() - - for serialized_dag_model in serialized_dags_results: - if serialized_dag_model.data: - lazy_dag = LazyDeserializedDAG(data=serialized_dag_model.data) - timetable_class = type(lazy_dag.timetable) - if f"{timetable_class.__module__}.{timetable_class.__qualname__}" in timetable_type: - filtered_dags.append(dags_from_iterator[serialized_dag_model.dag_id]) - - return filtered_dags - def to_orm(self, select: Select) -> Select: - pass + if self.skip_none is False: + raise ValueError(f"Cannot set 'skip_none' to False on a {type(self)}") + + if not self.value: # No filter provided + return select + + select = select.join(SerializedDagModel, SerializedDagModel.dag_id == DagModel.dag_id) + + # JSON path for timetable type + json_path = "$.dag.timetable.__type" + + conditions = [ + text(f"json_extract(serialized_dag.data, '{json_path}') = :timetable_type_{i}").bindparams( + **{f"timetable_type_{i}": t_type} + ) + for i, t_type in enumerate(self.value) + ] + + return select.where(or_(*conditions)) @classmethod def depends( @@ -485,8 +477,7 @@ def depends( timetable_type: list[str] = Query(default_factory=list), ) -> _TimetableTypesFilter: return cls().set_value(timetable_type) - - + def _safe_parse_datetime(date_to_check: str) -> datetime: """ @@ -647,6 +638,7 @@ def depends_float( ] QueryTagsFilter = Annotated[_TagsFilter, Depends(_TagsFilter.depends)] QueryOwnersFilter = Annotated[_OwnersFilter, Depends(_OwnersFilter.depends)] +QueryTimeTableTypesFilter = Annotated[_TimetableTypesFilter, Depends(_TimetableTypesFilter.depends)] # DagRun QueryLastDagRunStateFilter = Annotated[ diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml index b06dd3cb515bc..c2f2379e108d3 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml @@ -2958,6 +2958,14 @@ paths: - type: boolean - type: 'null' title: Is Favorite + - name: timetable_type + in: query + required: false + schema: + type: array + items: + type: string + title: Timetable Type responses: '200': description: Successful Response diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py index d271e6b2f5b37..b426402d5b0e9 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py @@ -47,6 +47,7 @@ QueryOwnersFilter, QueryPausedFilter, QueryTagsFilter, + QueryTimeTableTypesFilter, RangeFilter, SortParam, _transform_dag_run_states, @@ -72,7 +73,6 @@ from airflow.models import DagModel from airflow.models.dag_favorite import DagFavorite from airflow.models.dagrun import DagRun -from airflow.api_fastapi.common.parameters import _TimetableTypesFilter dags_router = AirflowRouter(tags=["DAG"], prefix="/dags") @@ -122,7 +122,7 @@ def get_dags( readable_dags_filter: ReadableDagsFilterDep, session: SessionDep, is_favorite: QueryFavoriteFilter, - timetable_type: list[str] = Query(None) + timetable_type: QueryTimeTableTypesFilter, ) -> DAGCollectionResponse: """Get all DAGs.""" query = generate_dag_with_latest_run_query( @@ -148,6 +148,7 @@ def get_dags( readable_dags_filter, bundle_name, bundle_version, + timetable_type, ], order_by=order_by, offset=offset, @@ -157,11 +158,6 @@ def get_dags( dags = session.scalars(dags_select) - if timetable_type: - filter_instance = _TimetableTypesFilter().depends(timetable_type=timetable_type) - dags = filter_instance.filter_from_dags(dags,timetable_type, session) - total_entries=len(dags) - return DAGCollectionResponse( dags=dags, total_entries=total_entries, From 301ed72bd208171029c6d80b408fa3c0f55c9a48 Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Thu, 21 Aug 2025 11:32:13 +0530 Subject: [PATCH 4/8] add timetable_type column to dag table for filtering DAGs --- airflow-core/docs/img/airflow_erd.sha256 | 2 +- airflow-core/docs/img/airflow_erd.svg | 3850 +++++++++-------- airflow-core/docs/migrations-ref.rst | 4 +- .../airflow/api_fastapi/common/parameters.py | 15 +- .../src/airflow/dag_processing/collection.py | 2 +- .../0083_3_1_0_add_timetable_type_to_dag.py | 46 + airflow-core/src/airflow/models/dag.py | 2 + airflow-core/src/airflow/utils/db.py | 2 +- 8 files changed, 1983 insertions(+), 1940 deletions(-) create mode 100644 airflow-core/src/airflow/migrations/versions/0083_3_1_0_add_timetable_type_to_dag.py diff --git a/airflow-core/docs/img/airflow_erd.sha256 b/airflow-core/docs/img/airflow_erd.sha256 index 377d8d3967e75..f13df5b62893f 100644 --- a/airflow-core/docs/img/airflow_erd.sha256 +++ b/airflow-core/docs/img/airflow_erd.sha256 @@ -1 +1 @@ -edfee8a534905c0b5e545c665421d6c17aa516b13578da8ffcf7ad9e66b15232 \ No newline at end of file +aa64825da66af439738fad35272dffbd671f23f3b89d35e00e1bba08b36082a0 \ No newline at end of file diff --git a/airflow-core/docs/img/airflow_erd.svg b/airflow-core/docs/img/airflow_erd.svg index 7d1c3d5b9c2fc..41192dd058cd0 100644 --- a/airflow-core/docs/img/airflow_erd.svg +++ b/airflow-core/docs/img/airflow_erd.svg @@ -4,2344 +4,2348 @@ - - + + %3 - - + + -dag_priority_parsing_request - -dag_priority_parsing_request - -id - - [VARCHAR(32)] - NOT NULL - -bundle_name - - [VARCHAR(250)] - NOT NULL - -relative_fileloc - - [VARCHAR(2000)] - NOT NULL +log + +log + +id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + +dttm + + [TIMESTAMP] + +event + + [VARCHAR(60)] + +extra + + [TEXT] + +logical_date + + [TIMESTAMP] + +map_index + + [INTEGER] + +owner + + [VARCHAR(500)] + +owner_display_name + + [VARCHAR(500)] + +run_id + + [VARCHAR(250)] + +task_id + + [VARCHAR(250)] + +try_number + + [INTEGER] - + -log - -log - -id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - -dttm - - [TIMESTAMP] - -event - - [VARCHAR(60)] - -extra - - [TEXT] - -logical_date - - [TIMESTAMP] - -map_index - - [INTEGER] - -owner - - [VARCHAR(500)] - -owner_display_name - - [VARCHAR(500)] - -run_id - - [VARCHAR(250)] - -task_id - - [VARCHAR(250)] - -try_number - - [INTEGER] +dag_priority_parsing_request + +dag_priority_parsing_request + +id + + [VARCHAR(32)] + NOT NULL + +bundle_name + + [VARCHAR(250)] + NOT NULL + +relative_fileloc + + [VARCHAR(2000)] + NOT NULL variable - -variable - -id - - [INTEGER] - NOT NULL - -description - - [TEXT] - -is_encrypted - - [BOOLEAN] - -key - - [VARCHAR(250)] - -val - - [TEXT] + +variable + +id + + [INTEGER] + NOT NULL + +description + + [TEXT] + +is_encrypted + + [BOOLEAN] + +key + + [VARCHAR(250)] + +val + + [TEXT] job - -job - -id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - -end_date - - [TIMESTAMP] - -executor_class - - [VARCHAR(500)] - -hostname - - [VARCHAR(500)] - -job_type - - [VARCHAR(30)] - -latest_heartbeat - - [TIMESTAMP] - -start_date - - [TIMESTAMP] - -state - - [VARCHAR(20)] - -unixname - - [VARCHAR(1000)] + +job + +id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + +end_date + + [TIMESTAMP] + +executor_class + + [VARCHAR(500)] + +hostname + + [VARCHAR(500)] + +job_type + + [VARCHAR(30)] + +latest_heartbeat + + [TIMESTAMP] + +start_date + + [TIMESTAMP] + +state + + [VARCHAR(20)] + +unixname + + [VARCHAR(1000)] connection - -connection - -id - - [INTEGER] - NOT NULL - -conn_id - - [VARCHAR(250)] - NOT NULL - -conn_type - - [VARCHAR(500)] - NOT NULL - -description - - [TEXT] - -extra - - [TEXT] - -host - - [VARCHAR(500)] - -is_encrypted - - [BOOLEAN] - -is_extra_encrypted - - [BOOLEAN] - -login - - [TEXT] - -password - - [TEXT] - -port - - [INTEGER] - -schema - - [VARCHAR(500)] + +connection + +id + + [INTEGER] + NOT NULL + +conn_id + + [VARCHAR(250)] + NOT NULL + +conn_type + + [VARCHAR(500)] + NOT NULL + +description + + [TEXT] + +extra + + [TEXT] + +host + + [VARCHAR(500)] + +is_encrypted + + [BOOLEAN] + +is_extra_encrypted + + [BOOLEAN] + +login + + [TEXT] + +password + + [TEXT] + +port + + [INTEGER] + +schema + + [VARCHAR(500)] callback_request - -callback_request - -id - - [INTEGER] - NOT NULL - -callback_data - - [JSONB] - NOT NULL - -callback_type - - [VARCHAR(20)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -priority_weight - - [INTEGER] - NOT NULL + +callback_request + +id + + [INTEGER] + NOT NULL + +callback_data + + [JSONB] + NOT NULL + +callback_type + + [VARCHAR(20)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +priority_weight + + [INTEGER] + NOT NULL slot_pool - -slot_pool - -id - - [INTEGER] - NOT NULL - -description - - [TEXT] - -include_deferred - - [BOOLEAN] - NOT NULL - -pool - - [VARCHAR(256)] - -slots - - [INTEGER] + +slot_pool + +id + + [INTEGER] + NOT NULL + +description + + [TEXT] + +include_deferred + + [BOOLEAN] + NOT NULL + +pool + + [VARCHAR(256)] + +slots + + [INTEGER] import_error - -import_error - -id - - [INTEGER] - NOT NULL - -bundle_name - - [VARCHAR(250)] - -filename - - [VARCHAR(1024)] - -stacktrace - - [TEXT] - -timestamp - - [TIMESTAMP] + +import_error + +id + + [INTEGER] + NOT NULL + +bundle_name + + [VARCHAR(250)] + +filename + + [VARCHAR(1024)] + +stacktrace + + [TEXT] + +timestamp + + [TIMESTAMP] asset_alias - -asset_alias - -id - - [INTEGER] - NOT NULL - -group - - [VARCHAR(1500)] - NOT NULL - -name - - [VARCHAR(1500)] - NOT NULL + +asset_alias + +id + + [INTEGER] + NOT NULL + +group + + [VARCHAR(1500)] + NOT NULL + +name + + [VARCHAR(1500)] + NOT NULL asset_alias_asset - -asset_alias_asset - -alias_id - - [INTEGER] - NOT NULL - -asset_id - - [INTEGER] - NOT NULL + +asset_alias_asset + +alias_id + + [INTEGER] + NOT NULL + +asset_id + + [INTEGER] + NOT NULL asset_alias--asset_alias_asset - -0..N -1 + +0..N +1 asset_alias_asset_event - -asset_alias_asset_event - -alias_id - - [INTEGER] - NOT NULL - -event_id - - [INTEGER] - NOT NULL + +asset_alias_asset_event + +alias_id + + [INTEGER] + NOT NULL + +event_id + + [INTEGER] + NOT NULL asset_alias--asset_alias_asset_event - -0..N -1 + +0..N +1 dag_schedule_asset_alias_reference - -dag_schedule_asset_alias_reference - -alias_id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL + +dag_schedule_asset_alias_reference + +alias_id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL asset_alias--dag_schedule_asset_alias_reference - -0..N -1 + +0..N +1 asset - -asset - -id - - [INTEGER] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -extra - - [JSON] - NOT NULL - -group - - [VARCHAR(1500)] - NOT NULL - -name - - [VARCHAR(1500)] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL - -uri - - [VARCHAR(1500)] - NOT NULL + +asset + +id + + [INTEGER] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +extra + + [JSON] + NOT NULL + +group + + [VARCHAR(1500)] + NOT NULL + +name + + [VARCHAR(1500)] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL + +uri + + [VARCHAR(1500)] + NOT NULL asset--asset_alias_asset - -0..N -1 + +0..N +1 asset_trigger - -asset_trigger - -asset_id - - [INTEGER] - NOT NULL - -trigger_id - - [INTEGER] - NOT NULL + +asset_trigger + +asset_id + + [INTEGER] + NOT NULL + +trigger_id + + [INTEGER] + NOT NULL asset--asset_trigger - -0..N -1 + +0..N +1 asset_active - -asset_active - -name - - [VARCHAR(1500)] - NOT NULL - -uri - - [VARCHAR(1500)] - NOT NULL + +asset_active + +name + + [VARCHAR(1500)] + NOT NULL + +uri + + [VARCHAR(1500)] + NOT NULL asset--asset_active - -1 -1 + +1 +1 asset--asset_active - -1 -1 + +1 +1 dag_schedule_asset_reference - -dag_schedule_asset_reference - -asset_id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL + +dag_schedule_asset_reference + +asset_id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL asset--dag_schedule_asset_reference - -0..N -1 + +0..N +1 task_outlet_asset_reference - -task_outlet_asset_reference - -asset_id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -task_id - - [VARCHAR(250)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL + +task_outlet_asset_reference + +asset_id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +task_id + + [VARCHAR(250)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL asset--task_outlet_asset_reference - -0..N -1 + +0..N +1 task_inlet_asset_reference - -task_inlet_asset_reference - -asset_id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -task_id - - [VARCHAR(250)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL + +task_inlet_asset_reference + +asset_id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +task_id + + [VARCHAR(250)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL asset--task_inlet_asset_reference - -0..N -1 + +0..N +1 asset_dag_run_queue - -asset_dag_run_queue - -asset_id - - [INTEGER] - NOT NULL - -target_dag_id - - [VARCHAR(250)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL + +asset_dag_run_queue + +asset_id + + [INTEGER] + NOT NULL + +target_dag_id + + [VARCHAR(250)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL asset--asset_dag_run_queue - -0..N -1 + +0..N +1 asset_event - -asset_event - -id - - [INTEGER] - NOT NULL - -asset_id - - [INTEGER] - NOT NULL - -extra - - [JSON] - NOT NULL - -source_dag_id - - [VARCHAR(250)] - -source_map_index - - [INTEGER] - -source_run_id - - [VARCHAR(250)] - -source_task_id - - [VARCHAR(250)] - -timestamp - - [TIMESTAMP] - NOT NULL + +asset_event + +id + + [INTEGER] + NOT NULL + +asset_id + + [INTEGER] + NOT NULL + +extra + + [JSON] + NOT NULL + +source_dag_id + + [VARCHAR(250)] + +source_map_index + + [INTEGER] + +source_run_id + + [VARCHAR(250)] + +source_task_id + + [VARCHAR(250)] + +timestamp + + [TIMESTAMP] + NOT NULL asset_event--asset_alias_asset_event - -0..N -1 + +0..N +1 dagrun_asset_event - -dagrun_asset_event - -dag_run_id - - [INTEGER] - NOT NULL - -event_id - - [INTEGER] - NOT NULL + +dagrun_asset_event + +dag_run_id + + [INTEGER] + NOT NULL + +event_id + + [INTEGER] + NOT NULL asset_event--dagrun_asset_event - -0..N -1 + +0..N +1 trigger - -trigger - -id - - [INTEGER] - NOT NULL - -classpath - - [VARCHAR(1000)] - NOT NULL - -created_date - - [TIMESTAMP] - NOT NULL - -kwargs - - [TEXT] - NOT NULL - -triggerer_id - - [INTEGER] + +trigger + +id + + [INTEGER] + NOT NULL + +classpath + + [VARCHAR(1000)] + NOT NULL + +created_date + + [TIMESTAMP] + NOT NULL + +kwargs + + [TEXT] + NOT NULL + +triggerer_id + + [INTEGER] trigger--asset_trigger - -0..N -1 + +0..N +1 task_instance - -task_instance - -id - - [UUID] - NOT NULL - -context_carrier - - [JSONB] - -custom_operator_name - - [VARCHAR(1000)] - -dag_id - - [VARCHAR(250)] - NOT NULL - -dag_version_id - - [UUID] - -duration - - [DOUBLE_PRECISION] - -end_date - - [TIMESTAMP] - -executor - - [VARCHAR(1000)] - -executor_config - - [BYTEA] - -external_executor_id - - [VARCHAR(250)] - -hostname - - [VARCHAR(1000)] - -last_heartbeat_at - - [TIMESTAMP] - -map_index - - [INTEGER] - NOT NULL - -max_tries - - [INTEGER] - -next_kwargs - - [JSONB] - -next_method - - [VARCHAR(1000)] - -operator - - [VARCHAR(1000)] - -pid - - [INTEGER] - -pool - - [VARCHAR(256)] - NOT NULL - -pool_slots - - [INTEGER] - NOT NULL - -priority_weight - - [INTEGER] - -queue - - [VARCHAR(256)] - -queued_by_job_id - - [INTEGER] - -queued_dttm - - [TIMESTAMP] - -rendered_map_index - - [VARCHAR(250)] - -run_id - - [VARCHAR(250)] - NOT NULL - -scheduled_dttm - - [TIMESTAMP] - -span_status - - [VARCHAR(250)] - NOT NULL - -start_date - - [TIMESTAMP] - -state - - [VARCHAR(20)] - -task_display_name - - [VARCHAR(2000)] - -task_id - - [VARCHAR(250)] - NOT NULL - -trigger_id - - [INTEGER] - -trigger_timeout - - [TIMESTAMP] - -try_number - - [INTEGER] - -unixname - - [VARCHAR(1000)] - -updated_at - - [TIMESTAMP] + +task_instance + +id + + [UUID] + NOT NULL + +context_carrier + + [JSONB] + +custom_operator_name + + [VARCHAR(1000)] + +dag_id + + [VARCHAR(250)] + NOT NULL + +dag_version_id + + [UUID] + +duration + + [DOUBLE_PRECISION] + +end_date + + [TIMESTAMP] + +executor + + [VARCHAR(1000)] + +executor_config + + [BYTEA] + +external_executor_id + + [VARCHAR(250)] + +hostname + + [VARCHAR(1000)] + +last_heartbeat_at + + [TIMESTAMP] + +map_index + + [INTEGER] + NOT NULL + +max_tries + + [INTEGER] + +next_kwargs + + [JSONB] + +next_method + + [VARCHAR(1000)] + +operator + + [VARCHAR(1000)] + +pid + + [INTEGER] + +pool + + [VARCHAR(256)] + NOT NULL + +pool_slots + + [INTEGER] + NOT NULL + +priority_weight + + [INTEGER] + +queue + + [VARCHAR(256)] + +queued_by_job_id + + [INTEGER] + +queued_dttm + + [TIMESTAMP] + +rendered_map_index + + [VARCHAR(250)] + +run_id + + [VARCHAR(250)] + NOT NULL + +scheduled_dttm + + [TIMESTAMP] + +span_status + + [VARCHAR(250)] + NOT NULL + +start_date + + [TIMESTAMP] + +state + + [VARCHAR(20)] + +task_display_name + + [VARCHAR(2000)] + +task_id + + [VARCHAR(250)] + NOT NULL + +trigger_id + + [INTEGER] + +trigger_timeout + + [TIMESTAMP] + +try_number + + [INTEGER] + +unixname + + [VARCHAR(1000)] + +updated_at + + [TIMESTAMP] trigger--task_instance - -0..N -{0,1} + +0..N +{0,1} deadline - -deadline - -id - - [UUID] - NOT NULL - -callback - - [JSON] - NOT NULL - -callback_state - - [VARCHAR(20)] - -dagrun_id - - [INTEGER] - -deadline_time - - [TIMESTAMP] - NOT NULL - -trigger_id - - [INTEGER] + +deadline + +id + + [UUID] + NOT NULL + +callback + + [JSON] + NOT NULL + +callback_state + + [VARCHAR(20)] + +dagrun_id + + [INTEGER] + +deadline_time + + [TIMESTAMP] + NOT NULL + +trigger_id + + [INTEGER] trigger--deadline - -0..N -{0,1} + +0..N +{0,1} hitl_detail - -hitl_detail - -ti_id - - [UUID] - NOT NULL - -body - - [TEXT] - -chosen_options - - [JSON] - -defaults - - [JSON] - -multiple - - [BOOLEAN] - -options - - [JSON] - NOT NULL - -params - - [JSON] - NOT NULL - -params_input - - [JSON] - NOT NULL - -respondents - - [JSON] - -response_at - - [TIMESTAMP] - -subject - - [TEXT] - NOT NULL - -user_id - - [VARCHAR(128)] + +hitl_detail + +ti_id + + [UUID] + NOT NULL + +body + + [TEXT] + +chosen_options + + [JSON] + +defaults + + [JSON] + +multiple + + [BOOLEAN] + +options + + [JSON] + NOT NULL + +params + + [JSON] + NOT NULL + +params_input + + [JSON] + NOT NULL + +respondents + + [JSON] + +response_at + + [TIMESTAMP] + +subject + + [TEXT] + NOT NULL + +user_id + + [VARCHAR(128)] task_instance--hitl_detail - -1 -1 + +1 +1 task_map - -task_map - -dag_id - - [VARCHAR(250)] - NOT NULL - -map_index - - [INTEGER] - NOT NULL - -run_id - - [VARCHAR(250)] - NOT NULL - -task_id - - [VARCHAR(250)] - NOT NULL - -keys - - [JSONB] - -length - - [INTEGER] - NOT NULL + +task_map + +dag_id + + [VARCHAR(250)] + NOT NULL + +map_index + + [INTEGER] + NOT NULL + +run_id + + [VARCHAR(250)] + NOT NULL + +task_id + + [VARCHAR(250)] + NOT NULL + +keys + + [JSONB] + +length + + [INTEGER] + NOT NULL task_instance--task_map - -0..N -1 + +0..N +1 task_instance--task_map - -0..N -1 + +0..N +1 task_instance--task_map - -0..N -1 + +0..N +1 task_instance--task_map - -0..N -1 + +0..N +1 task_reschedule - -task_reschedule - -id - - [INTEGER] - NOT NULL - -duration - - [INTEGER] - NOT NULL - -end_date - - [TIMESTAMP] - NOT NULL - -reschedule_date - - [TIMESTAMP] - NOT NULL - -start_date - - [TIMESTAMP] - NOT NULL - -ti_id - - [UUID] - NOT NULL + +task_reschedule + +id + + [INTEGER] + NOT NULL + +duration + + [INTEGER] + NOT NULL + +end_date + + [TIMESTAMP] + NOT NULL + +reschedule_date + + [TIMESTAMP] + NOT NULL + +start_date + + [TIMESTAMP] + NOT NULL + +ti_id + + [UUID] + NOT NULL task_instance--task_reschedule - -0..N -1 + +0..N +1 xcom - -xcom - -dag_run_id - - [INTEGER] - NOT NULL - -key - - [VARCHAR(512)] - NOT NULL - -map_index - - [INTEGER] - NOT NULL - -task_id - - [VARCHAR(250)] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -run_id - - [VARCHAR(250)] - NOT NULL - -timestamp - - [TIMESTAMP] - NOT NULL - -value - - [JSONB] + +xcom + +dag_run_id + + [INTEGER] + NOT NULL + +key + + [VARCHAR(512)] + NOT NULL + +map_index + + [INTEGER] + NOT NULL + +task_id + + [VARCHAR(250)] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +run_id + + [VARCHAR(250)] + NOT NULL + +timestamp + + [TIMESTAMP] + NOT NULL + +value + + [JSONB] task_instance--xcom - -0..N -1 + +0..N +1 task_instance--xcom - -0..N -1 + +0..N +1 task_instance--xcom - -0..N -1 + +0..N +1 task_instance--xcom - -0..N -1 + +0..N +1 task_instance_note - -task_instance_note - -ti_id - - [UUID] - NOT NULL - -content - - [VARCHAR(1000)] - -created_at - - [TIMESTAMP] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL - -user_id - - [VARCHAR(128)] + +task_instance_note + +ti_id + + [UUID] + NOT NULL + +content + + [VARCHAR(1000)] + +created_at + + [TIMESTAMP] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL + +user_id + + [VARCHAR(128)] task_instance--task_instance_note - -1 -1 + +1 +1 task_instance_history - -task_instance_history - -task_instance_id - - [UUID] - NOT NULL - -context_carrier - - [JSONB] - -custom_operator_name - - [VARCHAR(1000)] - -dag_id - - [VARCHAR(250)] - NOT NULL - -dag_version_id - - [UUID] - -duration - - [DOUBLE_PRECISION] - -end_date - - [TIMESTAMP] - -executor - - [VARCHAR(1000)] - -executor_config - - [BYTEA] - -external_executor_id - - [VARCHAR(250)] - -hostname - - [VARCHAR(1000)] - -map_index - - [INTEGER] - NOT NULL - -max_tries - - [INTEGER] - -next_kwargs - - [JSONB] - -next_method - - [VARCHAR(1000)] - -operator - - [VARCHAR(1000)] - -pid - - [INTEGER] - -pool - - [VARCHAR(256)] - NOT NULL - -pool_slots - - [INTEGER] - NOT NULL - -priority_weight - - [INTEGER] - -queue - - [VARCHAR(256)] - -queued_by_job_id - - [INTEGER] - -queued_dttm - - [TIMESTAMP] - -rendered_map_index - - [VARCHAR(250)] - -run_id - - [VARCHAR(250)] - NOT NULL - -scheduled_dttm - - [TIMESTAMP] - -span_status - - [VARCHAR(250)] - NOT NULL - -start_date - - [TIMESTAMP] - -state - - [VARCHAR(20)] - -task_display_name - - [VARCHAR(2000)] - -task_id - - [VARCHAR(250)] - NOT NULL - -trigger_id - - [INTEGER] - -trigger_timeout - - [TIMESTAMP] - -try_number - - [INTEGER] - NOT NULL - -unixname - - [VARCHAR(1000)] - -updated_at - - [TIMESTAMP] + +task_instance_history + +task_instance_id + + [UUID] + NOT NULL + +context_carrier + + [JSONB] + +custom_operator_name + + [VARCHAR(1000)] + +dag_id + + [VARCHAR(250)] + NOT NULL + +dag_version_id + + [UUID] + +duration + + [DOUBLE_PRECISION] + +end_date + + [TIMESTAMP] + +executor + + [VARCHAR(1000)] + +executor_config + + [BYTEA] + +external_executor_id + + [VARCHAR(250)] + +hostname + + [VARCHAR(1000)] + +map_index + + [INTEGER] + NOT NULL + +max_tries + + [INTEGER] + +next_kwargs + + [JSONB] + +next_method + + [VARCHAR(1000)] + +operator + + [VARCHAR(1000)] + +pid + + [INTEGER] + +pool + + [VARCHAR(256)] + NOT NULL + +pool_slots + + [INTEGER] + NOT NULL + +priority_weight + + [INTEGER] + +queue + + [VARCHAR(256)] + +queued_by_job_id + + [INTEGER] + +queued_dttm + + [TIMESTAMP] + +rendered_map_index + + [VARCHAR(250)] + +run_id + + [VARCHAR(250)] + NOT NULL + +scheduled_dttm + + [TIMESTAMP] + +span_status + + [VARCHAR(250)] + NOT NULL + +start_date + + [TIMESTAMP] + +state + + [VARCHAR(20)] + +task_display_name + + [VARCHAR(2000)] + +task_id + + [VARCHAR(250)] + NOT NULL + +trigger_id + + [INTEGER] + +trigger_timeout + + [TIMESTAMP] + +try_number + + [INTEGER] + NOT NULL + +unixname + + [VARCHAR(1000)] + +updated_at + + [TIMESTAMP] task_instance--task_instance_history - -0..N -1 + +0..N +1 task_instance--task_instance_history - -0..N -1 + +0..N +1 task_instance--task_instance_history - -0..N -1 + +0..N +1 task_instance--task_instance_history - -0..N -1 + +0..N +1 rendered_task_instance_fields - -rendered_task_instance_fields - -dag_id - - [VARCHAR(250)] - NOT NULL - -map_index - - [INTEGER] - NOT NULL - -run_id - - [VARCHAR(250)] - NOT NULL - -task_id - - [VARCHAR(250)] - NOT NULL - -k8s_pod_yaml - - [JSON] - -rendered_fields - - [JSON] - NOT NULL + +rendered_task_instance_fields + +dag_id + + [VARCHAR(250)] + NOT NULL + +map_index + + [INTEGER] + NOT NULL + +run_id + + [VARCHAR(250)] + NOT NULL + +task_id + + [VARCHAR(250)] + NOT NULL + +k8s_pod_yaml + + [JSON] + +rendered_fields + + [JSON] + NOT NULL task_instance--rendered_task_instance_fields - -0..N -1 + +0..N +1 task_instance--rendered_task_instance_fields - -0..N -1 + +0..N +1 task_instance--rendered_task_instance_fields - -0..N -1 + +0..N +1 task_instance--rendered_task_instance_fields - -0..N -1 + +0..N +1 dag_bundle - -dag_bundle - -name - - [VARCHAR(250)] - NOT NULL - -active - - [BOOLEAN] - -last_refreshed - - [TIMESTAMP] - -signed_url_template - - [VARCHAR(200)] - -template_params - - [JSON] - -version - - [VARCHAR(200)] + +dag_bundle + +name + + [VARCHAR(250)] + NOT NULL + +active + + [BOOLEAN] + +last_refreshed + + [TIMESTAMP] + +signed_url_template + + [VARCHAR(200)] + +template_params + + [JSON] + +version + + [VARCHAR(200)] dag - -dag - -dag_id - - [VARCHAR(250)] - NOT NULL - -asset_expression - - [JSON] - -bundle_name - - [VARCHAR(250)] - NOT NULL - -bundle_version - - [VARCHAR(200)] - -dag_display_name - - [VARCHAR(2000)] - -deadline - - [JSON] - -description - - [TEXT] - -fileloc - - [VARCHAR(2000)] - -has_import_errors - - [BOOLEAN] - -has_task_concurrency_limits - - [BOOLEAN] - NOT NULL - -is_paused - - [BOOLEAN] - -is_stale - - [BOOLEAN] - -last_expired - - [TIMESTAMP] - -last_parsed_time - - [TIMESTAMP] - -max_active_runs - - [INTEGER] - -max_active_tasks - - [INTEGER] - NOT NULL - -max_consecutive_failed_dag_runs - - [INTEGER] - NOT NULL - -next_dagrun - - [TIMESTAMP] - -next_dagrun_create_after - - [TIMESTAMP] - -next_dagrun_data_interval_end - - [TIMESTAMP] - -next_dagrun_data_interval_start - - [TIMESTAMP] - -owners - - [VARCHAR(2000)] - -relative_fileloc - - [VARCHAR(2000)] - -timetable_description - - [VARCHAR(1000)] - -timetable_summary - - [TEXT] + +dag + +dag_id + + [VARCHAR(250)] + NOT NULL + +asset_expression + + [JSON] + +bundle_name + + [VARCHAR(250)] + NOT NULL + +bundle_version + + [VARCHAR(200)] + +dag_display_name + + [VARCHAR(2000)] + +deadline + + [JSON] + +description + + [TEXT] + +fileloc + + [VARCHAR(2000)] + +has_import_errors + + [BOOLEAN] + +has_task_concurrency_limits + + [BOOLEAN] + NOT NULL + +is_paused + + [BOOLEAN] + +is_stale + + [BOOLEAN] + +last_expired + + [TIMESTAMP] + +last_parsed_time + + [TIMESTAMP] + +max_active_runs + + [INTEGER] + +max_active_tasks + + [INTEGER] + NOT NULL + +max_consecutive_failed_dag_runs + + [INTEGER] + NOT NULL + +next_dagrun + + [TIMESTAMP] + +next_dagrun_create_after + + [TIMESTAMP] + +next_dagrun_data_interval_end + + [TIMESTAMP] + +next_dagrun_data_interval_start + + [TIMESTAMP] + +owners + + [VARCHAR(2000)] + +relative_fileloc + + [VARCHAR(2000)] + +timetable_description + + [VARCHAR(1000)] + +timetable_summary + + [TEXT] + +timetable_type + + [VARCHAR(255)] dag_bundle--dag - -0..N -1 + +0..N +1 - + dag--dag_schedule_asset_alias_reference - -0..N -1 + +0..N +1 - + dag--dag_schedule_asset_reference - -0..N -1 + +0..N +1 - + dag--task_outlet_asset_reference - -0..N -1 + +0..N +1 - + dag--task_inlet_asset_reference - -0..N -1 + +0..N +1 - + dag--asset_dag_run_queue - -0..N -1 - - - -dag_version - -dag_version - -id - - [UUID] - NOT NULL - -bundle_name - - [VARCHAR(250)] - -bundle_version - - [VARCHAR(250)] - -created_at - - [TIMESTAMP] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -last_updated - - [TIMESTAMP] - NOT NULL - -version_number - - [INTEGER] - NOT NULL - - - -dag--dag_version - -0..N -1 + +0..N +1 - + dag_schedule_asset_name_reference - -dag_schedule_asset_name_reference - -dag_id - - [VARCHAR(250)] - NOT NULL - -name - - [VARCHAR(1500)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL + +dag_schedule_asset_name_reference + +dag_id + + [VARCHAR(250)] + NOT NULL + +name + + [VARCHAR(1500)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL - + dag--dag_schedule_asset_name_reference - -0..N -1 + +0..N +1 - + dag_schedule_asset_uri_reference - -dag_schedule_asset_uri_reference - -dag_id - - [VARCHAR(250)] - NOT NULL - -uri - - [VARCHAR(1500)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL + +dag_schedule_asset_uri_reference + +dag_id + + [VARCHAR(250)] + NOT NULL + +uri + + [VARCHAR(1500)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL - + dag--dag_schedule_asset_uri_reference - -0..N -1 + +0..N +1 + + + +dag_version + +dag_version + +id + + [UUID] + NOT NULL + +bundle_name + + [VARCHAR(250)] + +bundle_version + + [VARCHAR(250)] + +created_at + + [TIMESTAMP] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +last_updated + + [TIMESTAMP] + NOT NULL + +version_number + + [INTEGER] + NOT NULL + + + +dag--dag_version + +0..N +1 dag_tag - -dag_tag - -dag_id - - [VARCHAR(250)] - NOT NULL - -name - - [VARCHAR(100)] - NOT NULL + +dag_tag + +dag_id + + [VARCHAR(250)] + NOT NULL + +name + + [VARCHAR(100)] + NOT NULL dag--dag_tag - -0..N -1 + +0..N +1 dag_owner_attributes - -dag_owner_attributes - -dag_id - - [VARCHAR(250)] - NOT NULL - -owner - - [VARCHAR(500)] - NOT NULL - -link - - [VARCHAR(500)] - NOT NULL + +dag_owner_attributes + +dag_id + + [VARCHAR(250)] + NOT NULL + +owner + + [VARCHAR(500)] + NOT NULL + +link + + [VARCHAR(500)] + NOT NULL dag--dag_owner_attributes - -0..N -1 + +0..N +1 dag_warning - -dag_warning - -dag_id - - [VARCHAR(250)] - NOT NULL - -warning_type - - [VARCHAR(50)] - NOT NULL - -message - - [TEXT] - NOT NULL - -timestamp - - [TIMESTAMP] - NOT NULL + +dag_warning + +dag_id + + [VARCHAR(250)] + NOT NULL + +warning_type + + [VARCHAR(50)] + NOT NULL + +message + + [TEXT] + NOT NULL + +timestamp + + [TIMESTAMP] + NOT NULL dag--dag_warning - -0..N -1 + +0..N +1 dag_favorite - -dag_favorite - -dag_id - - [VARCHAR(250)] - NOT NULL - -user_id - - [VARCHAR(250)] - NOT NULL + +dag_favorite + +dag_id + + [VARCHAR(250)] + NOT NULL + +user_id + + [VARCHAR(250)] + NOT NULL dag--dag_favorite - -0..N -1 + +0..N +1 dag_version--task_instance - -0..N -{0,1} + +0..N +{0,1} dag_run - -dag_run - -id - - [INTEGER] - NOT NULL - -backfill_id - - [INTEGER] - -bundle_version - - [VARCHAR(250)] - -clear_number - - [INTEGER] - NOT NULL - -conf - - [JSONB] - -context_carrier - - [JSONB] - -created_dag_version_id - - [UUID] - -creating_job_id - - [INTEGER] - -dag_id - - [VARCHAR(250)] - NOT NULL - -data_interval_end - - [TIMESTAMP] - -data_interval_start - - [TIMESTAMP] - -end_date - - [TIMESTAMP] - -last_scheduling_decision - - [TIMESTAMP] - -log_template_id - - [INTEGER] - -logical_date - - [TIMESTAMP] - -queued_at - - [TIMESTAMP] - -run_after - - [TIMESTAMP] - NOT NULL - -run_id - - [VARCHAR(250)] - NOT NULL - -run_type - - [VARCHAR(50)] - NOT NULL - -scheduled_by_job_id - - [INTEGER] - -span_status - - [VARCHAR(250)] - NOT NULL - -start_date - - [TIMESTAMP] - -state - - [VARCHAR(50)] - -triggered_by - - [VARCHAR(50)] - -triggering_user_name - - [VARCHAR(512)] - -updated_at - - [TIMESTAMP] + +dag_run + +id + + [INTEGER] + NOT NULL + +backfill_id + + [INTEGER] + +bundle_version + + [VARCHAR(250)] + +clear_number + + [INTEGER] + NOT NULL + +conf + + [JSONB] + +context_carrier + + [JSONB] + +created_dag_version_id + + [UUID] + +creating_job_id + + [INTEGER] + +dag_id + + [VARCHAR(250)] + NOT NULL + +data_interval_end + + [TIMESTAMP] + +data_interval_start + + [TIMESTAMP] + +end_date + + [TIMESTAMP] + +last_scheduling_decision + + [TIMESTAMP] + +log_template_id + + [INTEGER] + +logical_date + + [TIMESTAMP] + +queued_at + + [TIMESTAMP] + +run_after + + [TIMESTAMP] + NOT NULL + +run_id + + [VARCHAR(250)] + NOT NULL + +run_type + + [VARCHAR(50)] + NOT NULL + +scheduled_by_job_id + + [INTEGER] + +span_status + + [VARCHAR(250)] + NOT NULL + +start_date + + [TIMESTAMP] + +state + + [VARCHAR(50)] + +triggered_by + + [VARCHAR(50)] + +triggering_user_name + + [VARCHAR(512)] + +updated_at + + [TIMESTAMP] dag_version--dag_run - -0..N -{0,1} + +0..N +{0,1} dag_code - -dag_code - -id - - [UUID] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -dag_version_id - - [UUID] - NOT NULL - -fileloc - - [VARCHAR(2000)] - NOT NULL - -last_updated - - [TIMESTAMP] - NOT NULL - -source_code - - [TEXT] - NOT NULL - -source_code_hash - - [VARCHAR(32)] - NOT NULL + +dag_code + +id + + [UUID] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +dag_version_id + + [UUID] + NOT NULL + +fileloc + + [VARCHAR(2000)] + NOT NULL + +last_updated + + [TIMESTAMP] + NOT NULL + +source_code + + [TEXT] + NOT NULL + +source_code_hash + + [VARCHAR(32)] + NOT NULL dag_version--dag_code - -0..N -1 + +0..N +1 serialized_dag - -serialized_dag - -id - - [UUID] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -dag_hash - - [VARCHAR(32)] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -dag_version_id - - [UUID] - NOT NULL - -data - - [JSON] - -data_compressed - - [BYTEA] - -last_updated - - [TIMESTAMP] - NOT NULL + +serialized_dag + +id + + [UUID] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +dag_hash + + [VARCHAR(32)] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +dag_version_id + + [UUID] + NOT NULL + +data + + [JSON] + +data_compressed + + [BYTEA] + +last_updated + + [TIMESTAMP] + NOT NULL dag_version--serialized_dag - -0..N -1 + +0..N +1 dag_run--dagrun_asset_event - -0..N -1 + +0..N +1 dag_run--task_instance - -0..N -1 + +0..N +1 dag_run--task_instance - -0..N -1 + +0..N +1 dag_run--deadline - -0..N -{0,1} + +0..N +{0,1} backfill_dag_run - -backfill_dag_run - -id - - [INTEGER] - NOT NULL - -backfill_id - - [INTEGER] - NOT NULL - -dag_run_id - - [INTEGER] - -exception_reason - - [VARCHAR(250)] - -logical_date - - [TIMESTAMP] - NOT NULL - -sort_ordinal - - [INTEGER] - NOT NULL + +backfill_dag_run + +id + + [INTEGER] + NOT NULL + +backfill_id + + [INTEGER] + NOT NULL + +dag_run_id + + [INTEGER] + +exception_reason + + [VARCHAR(250)] + +logical_date + + [TIMESTAMP] + NOT NULL + +sort_ordinal + + [INTEGER] + NOT NULL dag_run--backfill_dag_run - -0..N -{0,1} + +0..N +{0,1} dag_run_note - -dag_run_note - -dag_run_id - - [INTEGER] - NOT NULL - -content - - [VARCHAR(1000)] - -created_at - - [TIMESTAMP] - NOT NULL - -updated_at - - [TIMESTAMP] - NOT NULL - -user_id - - [VARCHAR(128)] + +dag_run_note + +dag_run_id + + [INTEGER] + NOT NULL + +content + + [VARCHAR(1000)] + +created_at + + [TIMESTAMP] + NOT NULL + +updated_at + + [TIMESTAMP] + NOT NULL + +user_id + + [VARCHAR(128)] dag_run--dag_run_note - -1 -1 + +1 +1 log_template - -log_template - -id - - [INTEGER] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -elasticsearch_id - - [TEXT] - NOT NULL - -filename - - [TEXT] - NOT NULL + +log_template + +id + + [INTEGER] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +elasticsearch_id + + [TEXT] + NOT NULL + +filename + + [TEXT] + NOT NULL log_template--dag_run - -0..N -{0,1} + +0..N +{0,1} backfill - -backfill - -id - - [INTEGER] - NOT NULL - -completed_at - - [TIMESTAMP] - -created_at - - [TIMESTAMP] - NOT NULL - -dag_id - - [VARCHAR(250)] - NOT NULL - -dag_run_conf - - [JSON] - NOT NULL - -from_date - - [TIMESTAMP] - NOT NULL - -is_paused - - [BOOLEAN] - -max_active_runs - - [INTEGER] - NOT NULL - -reprocess_behavior - - [VARCHAR(250)] - NOT NULL - -to_date - - [TIMESTAMP] - NOT NULL - -triggering_user_name - - [VARCHAR(512)] - -updated_at - - [TIMESTAMP] - NOT NULL + +backfill + +id + + [INTEGER] + NOT NULL + +completed_at + + [TIMESTAMP] + +created_at + + [TIMESTAMP] + NOT NULL + +dag_id + + [VARCHAR(250)] + NOT NULL + +dag_run_conf + + [JSON] + NOT NULL + +from_date + + [TIMESTAMP] + NOT NULL + +is_paused + + [BOOLEAN] + +max_active_runs + + [INTEGER] + NOT NULL + +reprocess_behavior + + [VARCHAR(250)] + NOT NULL + +to_date + + [TIMESTAMP] + NOT NULL + +triggering_user_name + + [VARCHAR(512)] + +updated_at + + [TIMESTAMP] + NOT NULL backfill--dag_run - -0..N -{0,1} + +0..N +{0,1} backfill--backfill_dag_run - -0..N -1 + +0..N +1 alembic_version - -alembic_version - -version_num - - [VARCHAR(32)] - NOT NULL + +alembic_version + +version_num + + [VARCHAR(32)] + NOT NULL diff --git a/airflow-core/docs/migrations-ref.rst b/airflow-core/docs/migrations-ref.rst index 759db30276e65..efcfca9184f48 100644 --- a/airflow-core/docs/migrations-ref.rst +++ b/airflow-core/docs/migrations-ref.rst @@ -39,7 +39,9 @@ Here's the list of all the Database Migrations that are executed via when you ru +-------------------------+------------------+-------------------+--------------------------------------------------------------+ | Revision ID | Revises ID | Airflow Version | Description | +=========================+==================+===================+==============================================================+ -| ``7582ea3f3dd5`` (head) | ``a169942745c2`` | ``3.1.0`` | Make bundle_name not nullable. | +| ``3e4f92b7c1a2`` (head) | ``7582ea3f3dd5`` | ``3.1.0`` | Add timetable_type column to DAG table. | ++-------------------------+------------------+-------------------+--------------------------------------------------------------+ +| ``7582ea3f3dd5`` | ``a169942745c2`` | ``3.1.0`` | Make bundle_name not nullable. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ | ``a169942745c2`` | ``808787349f22`` | ``3.1.0`` | Remove dag_id from Deadline. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py index 14445a6f26d97..812b87d018b4b 100644 --- a/airflow-core/src/airflow/api_fastapi/common/parameters.py +++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py @@ -34,7 +34,7 @@ from fastapi import Depends, HTTPException, Query, status from pendulum.parsing.exceptions import ParserError from pydantic import AfterValidator, BaseModel, NonNegativeInt -from sqlalchemy import Column, and_, case, func, not_, or_, select, text +from sqlalchemy import Column, and_, case, func, not_, or_, select from sqlalchemy.inspection import inspect from airflow._shared.timezones import timezone @@ -55,7 +55,6 @@ from airflow.models.dagrun import DagRun from airflow.models.hitl import HITLDetail from airflow.models.pool import Pool -from airflow.models.serialized_dag import SerializedDagModel from airflow.models.taskinstance import TaskInstance from airflow.models.variable import Variable from airflow.models.xcom import XComModel @@ -459,17 +458,7 @@ def to_orm(self, select: Select) -> Select: if not self.value: # No filter provided return select - select = select.join(SerializedDagModel, SerializedDagModel.dag_id == DagModel.dag_id) - - # JSON path for timetable type - json_path = "$.dag.timetable.__type" - - conditions = [ - text(f"json_extract(serialized_dag.data, '{json_path}') = :timetable_type_{i}").bindparams( - **{f"timetable_type_{i}": t_type} - ) - for i, t_type in enumerate(self.value) - ] + conditions = [DagModel.timetable_type == t_type for t_type in self.value] return select.where(or_(*conditions)) diff --git a/airflow-core/src/airflow/dag_processing/collection.py b/airflow-core/src/airflow/dag_processing/collection.py index e9264c38d322e..53f07ab433713 100644 --- a/airflow-core/src/airflow/dag_processing/collection.py +++ b/airflow-core/src/airflow/dag_processing/collection.py @@ -508,7 +508,7 @@ def update_dags( ) dm.timetable_summary = dag.timetable.summary dm.timetable_description = dag.timetable.description - + dm.timetable_type = f"{dag.timetable.__class__.__module__}.{dag.timetable.__class__.__name__}" dm.bundle_name = self.bundle_name dm.bundle_version = self.bundle_version diff --git a/airflow-core/src/airflow/migrations/versions/0083_3_1_0_add_timetable_type_to_dag.py b/airflow-core/src/airflow/migrations/versions/0083_3_1_0_add_timetable_type_to_dag.py new file mode 100644 index 0000000000000..d0a257d95997d --- /dev/null +++ b/airflow-core/src/airflow/migrations/versions/0083_3_1_0_add_timetable_type_to_dag.py @@ -0,0 +1,46 @@ +# 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. + +""" +Add timetable_type column to DAG table. + +Revision ID: 3e4f92b7c1a2 +Revises: 7582ea3f3dd5 +Create Date: 2025-08-20 12:30:00 +""" + +from __future__ import annotations + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "3e4f92b7c1a2" +down_revision = "7582ea3f3dd5" +branch_labels = None +depends_on = None +airflow_version = "3.1.0" + + +def upgrade(): + with op.batch_alter_table("dag", schema=None) as batch_op: + batch_op.add_column(sa.Column("timetable_type", sa.String(length=255), nullable=True)) + + +def downgrade(): + with op.batch_alter_table("dag", schema=None) as batch_op: + batch_op.drop_column("timetable_type") diff --git a/airflow-core/src/airflow/models/dag.py b/airflow-core/src/airflow/models/dag.py index 99f881c805506..eda580616710e 100644 --- a/airflow-core/src/airflow/models/dag.py +++ b/airflow-core/src/airflow/models/dag.py @@ -1905,6 +1905,8 @@ class DagModel(Base): timetable_summary = Column(Text, nullable=True) # Timetable description timetable_description = Column(String(1000), nullable=True) + # Timetable Type + timetable_type = Column(String(255), nullable=True) # Asset expression based on asset triggers asset_expression = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=True) # DAG deadline information diff --git a/airflow-core/src/airflow/utils/db.py b/airflow-core/src/airflow/utils/db.py index 6dd01d9ba8e01..2467a62022033 100644 --- a/airflow-core/src/airflow/utils/db.py +++ b/airflow-core/src/airflow/utils/db.py @@ -95,7 +95,7 @@ class MappedClassProtocol(Protocol): "2.10.3": "5f2621c13b39", "3.0.0": "29ce7909c52b", "3.0.3": "fe199e1abd77", - "3.1.0": "7582ea3f3dd5", + "3.1.0": "3e4f92b7c1a2", } From 3cc156a42af463254489eb44c30d9fa603b523ba Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Thu, 28 Aug 2025 15:07:44 +0530 Subject: [PATCH 5/8] Add type_name property which reflects timetable type for DAG filtering --- .../src/airflow/dag_processing/collection.py | 2 +- airflow-core/src/airflow/timetables/base.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/dag_processing/collection.py b/airflow-core/src/airflow/dag_processing/collection.py index 53f07ab433713..d6a161d26c5e2 100644 --- a/airflow-core/src/airflow/dag_processing/collection.py +++ b/airflow-core/src/airflow/dag_processing/collection.py @@ -508,7 +508,7 @@ def update_dags( ) dm.timetable_summary = dag.timetable.summary dm.timetable_description = dag.timetable.description - dm.timetable_type = f"{dag.timetable.__class__.__module__}.{dag.timetable.__class__.__name__}" + dm.timetable_type = dag.timetable.type_name dm.bundle_name = self.bundle_name dm.bundle_version = self.bundle_version diff --git a/airflow-core/src/airflow/timetables/base.py b/airflow-core/src/airflow/timetables/base.py index 47f7344b32b8c..3e3ce4f1f7414 100644 --- a/airflow-core/src/airflow/timetables/base.py +++ b/airflow-core/src/airflow/timetables/base.py @@ -244,6 +244,19 @@ def summary(self) -> str: """ return type(self).__name__ + @property + def type_name(self) -> str: + """ + This is primarily intended for filtering dags based on timetable type. + + This provides an unambiguous identifier for the timetable + implementation by including both the module and class name. + For example: + ``"airflow.timetables.simple.AssetTriggeredTimetable"`` or + ``"airflow.timetables.simple.NullTimetable"`` and other timetable types. + """ + return f"{self.__class__.__module__}.{self.__class__.__name__}" + def infer_manual_data_interval(self, *, run_after: DateTime) -> DataInterval: """ When a DAG run is manually triggered, infer a data interval for it. From 416ad0a232796ecfbb31bc176e1e8aa9710ea9c2 Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Mon, 1 Sep 2025 14:40:35 +0530 Subject: [PATCH 6/8] Remove class filter for timetable type and add test case --- .../airflow/api_fastapi/common/parameters.py | 23 ------------------- .../core_api/routes/public/dags.py | 6 +++-- .../core_api/routes/public/test_dags.py | 15 ++++++++++++ 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py index 812b87d018b4b..4e98d028aa815 100644 --- a/airflow-core/src/airflow/api_fastapi/common/parameters.py +++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py @@ -448,28 +448,6 @@ def depends(cls, owners: list[str] = Query(default_factory=list)) -> _OwnersFilt return cls().set_value(owners) -class _TimetableTypesFilter(BaseParam[list[str]]): - """Filter on timetable type.""" - - def to_orm(self, select: Select) -> Select: - if self.skip_none is False: - raise ValueError(f"Cannot set 'skip_none' to False on a {type(self)}") - - if not self.value: # No filter provided - return select - - conditions = [DagModel.timetable_type == t_type for t_type in self.value] - - return select.where(or_(*conditions)) - - @classmethod - def depends( - cls, - timetable_type: list[str] = Query(default_factory=list), - ) -> _TimetableTypesFilter: - return cls().set_value(timetable_type) - - def _safe_parse_datetime(date_to_check: str) -> datetime: """ Parse datetime and raise error for invalid dates. @@ -629,7 +607,6 @@ def depends_float( ] QueryTagsFilter = Annotated[_TagsFilter, Depends(_TagsFilter.depends)] QueryOwnersFilter = Annotated[_OwnersFilter, Depends(_OwnersFilter.depends)] -QueryTimeTableTypesFilter = Annotated[_TimetableTypesFilter, Depends(_TimetableTypesFilter.depends)] # DagRun QueryLastDagRunStateFilter = Annotated[ diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py index b426402d5b0e9..7002a75696f7a 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py @@ -47,7 +47,6 @@ QueryOwnersFilter, QueryPausedFilter, QueryTagsFilter, - QueryTimeTableTypesFilter, RangeFilter, SortParam, _transform_dag_run_states, @@ -122,7 +121,10 @@ def get_dags( readable_dags_filter: ReadableDagsFilterDep, session: SessionDep, is_favorite: QueryFavoriteFilter, - timetable_type: QueryTimeTableTypesFilter, + timetable_type: Annotated[ + FilterParam[list[str] | None], + Depends(filter_param_factory(DagModel.timetable_type, list[str], FilterOptionEnum.IN)), + ], ) -> DAGCollectionResponse: """Get all DAGs.""" query = generate_dag_with_latest_run_query( diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py index fbb72e02ecca9..c2c6f0bcb889c 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py @@ -75,6 +75,7 @@ def _create_deactivated_paused_dag(self, session=None): relative_fileloc="dag_del_1.py", fileloc="/tmp/dag_del_1.py", timetable_summary="2 2 * * *", + timetable_type="airflow.timetables.trigger.CronTriggerTimetable", is_stale=True, is_paused=True, owners="test_owner,another_test_owner", @@ -260,6 +261,20 @@ class TestGetDags(TestDagEndpoint): ({"bundle_name": "dag_maker"}, 2, [DAG1_ID, DAG2_ID]), ({"bundle_name": "wrong_bundle"}, 0, []), ({"bundle_version": "1.0.0"}, 0, []), + # Timetable type filter + ( + { + "timetable_type": ["airflow.timetables.trigger.CronTriggerTimetable"], + "exclude_stale": False, + }, + 1, + [DAG3_ID], + ), + ( + {"timetable_type": ["airflow.timetables.simple.NullTimetable"], "exclude_stale": False}, + 2, + [DAG1_ID, DAG2_ID], + ), ], ) def test_get_dags(self, test_client, query_params, expected_total_entries, expected_ids): From 5844a10a1a398e12b952c028aa4e0bc248ae2559 Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Tue, 2 Sep 2025 15:51:51 +0530 Subject: [PATCH 7/8] Fix static check for Airflow ERD hash and image --- airflow-core/docs/img/airflow_erd.sha256 | 2 +- airflow-core/docs/img/airflow_erd.svg | 708 +++++++++--------- .../0085_3_1_0_merge_heads_3e4f_a3c7.py | 3 +- airflow-core/src/airflow/utils/db.py | 2 +- 4 files changed, 358 insertions(+), 357 deletions(-) diff --git a/airflow-core/docs/img/airflow_erd.sha256 b/airflow-core/docs/img/airflow_erd.sha256 index c129b4995b134..49d55673ffa89 100644 --- a/airflow-core/docs/img/airflow_erd.sha256 +++ b/airflow-core/docs/img/airflow_erd.sha256 @@ -1 +1 @@ -428253f87794d93ee25007410e878ae5f589ff95785c01be5fea2592b37a5abd \ No newline at end of file +53e3a503c322b09f5badc4d58f5284263dfcaa7a476039638f6d1df8414ce5a5 \ No newline at end of file diff --git a/airflow-core/docs/img/airflow_erd.svg b/airflow-core/docs/img/airflow_erd.svg index 56c7e8c9fa4a0..f9f9cdd4a63e0 100644 --- a/airflow-core/docs/img/airflow_erd.svg +++ b/airflow-core/docs/img/airflow_erd.svg @@ -12,214 +12,214 @@ log - -log - -id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - -dttm - - [TIMESTAMP] - -event - - [VARCHAR(60)] - -extra - - [TEXT] - -logical_date - - [TIMESTAMP] - -map_index - - [INTEGER] - -owner - - [VARCHAR(500)] - -owner_display_name - - [VARCHAR(500)] - -run_id - - [VARCHAR(250)] - -task_id - - [VARCHAR(250)] - -try_number - - [INTEGER] + +log + +id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + +dttm + + [TIMESTAMP] + +event + + [VARCHAR(60)] + +extra + + [TEXT] + +logical_date + + [TIMESTAMP] + +map_index + + [INTEGER] + +owner + + [VARCHAR(500)] + +owner_display_name + + [VARCHAR(500)] + +run_id + + [VARCHAR(250)] + +task_id + + [VARCHAR(250)] + +try_number + + [INTEGER] dag_priority_parsing_request - -dag_priority_parsing_request - -id - - [VARCHAR(32)] - NOT NULL - -bundle_name - - [VARCHAR(250)] - NOT NULL - -relative_fileloc - - [VARCHAR(2000)] - NOT NULL + +dag_priority_parsing_request + +id + + [VARCHAR(32)] + NOT NULL + +bundle_name + + [VARCHAR(250)] + NOT NULL + +relative_fileloc + + [VARCHAR(2000)] + NOT NULL job - -job - -id - - [INTEGER] - NOT NULL - -dag_id - - [VARCHAR(250)] - -end_date - - [TIMESTAMP] - -executor_class - - [VARCHAR(500)] - -hostname - - [VARCHAR(500)] - -job_type - - [VARCHAR(30)] - -latest_heartbeat - - [TIMESTAMP] - -start_date - - [TIMESTAMP] - -state - - [VARCHAR(20)] - -unixname - - [VARCHAR(1000)] + +job + +id + + [INTEGER] + NOT NULL + +dag_id + + [VARCHAR(250)] + +end_date + + [TIMESTAMP] + +executor_class + + [VARCHAR(500)] + +hostname + + [VARCHAR(500)] + +job_type + + [VARCHAR(30)] + +latest_heartbeat + + [TIMESTAMP] + +start_date + + [TIMESTAMP] + +state + + [VARCHAR(20)] + +unixname + + [VARCHAR(1000)] callback_request - -callback_request - -id - - [INTEGER] - NOT NULL - -callback_data - - [JSONB] - NOT NULL - -callback_type - - [VARCHAR(20)] - NOT NULL - -created_at - - [TIMESTAMP] - NOT NULL - -priority_weight - - [INTEGER] - NOT NULL + +callback_request + +id + + [INTEGER] + NOT NULL + +callback_data + + [JSONB] + NOT NULL + +callback_type + + [VARCHAR(20)] + NOT NULL + +created_at + + [TIMESTAMP] + NOT NULL + +priority_weight + + [INTEGER] + NOT NULL import_error - -import_error - -id - - [INTEGER] - NOT NULL - -bundle_name - - [VARCHAR(250)] - -filename - - [VARCHAR(1024)] - -stacktrace - - [TEXT] - -timestamp - - [TIMESTAMP] + +import_error + +id + + [INTEGER] + NOT NULL + +bundle_name + + [VARCHAR(250)] + +filename + + [VARCHAR(1024)] + +stacktrace + + [TEXT] + +timestamp + + [TIMESTAMP] dag_bundle - -dag_bundle - -name - - [VARCHAR(250)] - NOT NULL - -active - - [BOOLEAN] - -last_refreshed - - [TIMESTAMP] - -signed_url_template - - [VARCHAR(200)] - -template_params - - [JSON] - -version - - [VARCHAR(200)] + +dag_bundle + +name + + [VARCHAR(250)] + NOT NULL + +active + + [BOOLEAN] + +last_refreshed + + [TIMESTAMP] + +signed_url_template + + [VARCHAR(200)] + +template_params + + [JSON] + +version + + [VARCHAR(200)] @@ -240,9 +240,9 @@ dag_bundle--dag_bundle_team - -0..N -1 + +0..N +1 @@ -362,9 +362,9 @@ dag_bundle--dag - -0..N -1 + +0..N +1 @@ -748,170 +748,170 @@ team - -team - -id - - [UUID] - NOT NULL - -name - - [VARCHAR(50)] - NOT NULL + +team + +id + + [UUID] + NOT NULL + +name + + [VARCHAR(50)] + NOT NULL team--dag_bundle_team - -0..N -1 + +0..N +1 - + -variable - -variable - -id - - [INTEGER] - NOT NULL - -description - - [TEXT] - -is_encrypted - - [BOOLEAN] - -key - - [VARCHAR(250)] - -team_id - - [UUID] - -val - - [TEXT] +connection + +connection + +id + + [INTEGER] + NOT NULL + +conn_id + + [VARCHAR(250)] + NOT NULL + +conn_type + + [VARCHAR(500)] + NOT NULL + +description + + [TEXT] + +extra + + [TEXT] + +host + + [VARCHAR(500)] + +is_encrypted + + [BOOLEAN] + +is_extra_encrypted + + [BOOLEAN] + +login + + [TEXT] + +password + + [TEXT] + +port + + [INTEGER] + +schema + + [VARCHAR(500)] + +team_id + + [UUID] - + -team--variable - -0..N -{0,1} +team--connection + +0..N +{0,1} - + -connection - -connection - -id - - [INTEGER] - NOT NULL - -conn_id - - [VARCHAR(250)] - NOT NULL - -conn_type - - [VARCHAR(500)] - NOT NULL - -description - - [TEXT] - -extra - - [TEXT] - -host - - [VARCHAR(500)] - -is_encrypted - - [BOOLEAN] - -is_extra_encrypted - - [BOOLEAN] - -login - - [TEXT] - -password - - [TEXT] - -port - - [INTEGER] - -schema - - [VARCHAR(500)] - -team_id - - [UUID] +variable + +variable + +id + + [INTEGER] + NOT NULL + +description + + [TEXT] + +is_encrypted + + [BOOLEAN] + +key + + [VARCHAR(250)] + +team_id + + [UUID] + +val + + [TEXT] - + -team--connection - -0..N -{0,1} +team--variable + +0..N +{0,1} slot_pool - -slot_pool - -id - - [INTEGER] - NOT NULL - -description - - [TEXT] - -include_deferred - - [BOOLEAN] - NOT NULL - -pool - - [VARCHAR(256)] - -slots - - [INTEGER] - -team_id - - [UUID] + +slot_pool + +id + + [INTEGER] + NOT NULL + +description + + [TEXT] + +include_deferred + + [BOOLEAN] + NOT NULL + +pool + + [VARCHAR(256)] + +slots + + [INTEGER] + +team_id + + [UUID] team--slot_pool - -0..N -{0,1} + +0..N +{0,1} @@ -1091,16 +1091,16 @@ asset--dag_schedule_asset_reference - -0..N -1 + +0..N +1 asset--task_outlet_asset_reference - -0..N -1 + +0..N +1 @@ -1112,9 +1112,9 @@ asset--asset_dag_run_queue - -0..N -1 + +0..N +1 @@ -2418,13 +2418,13 @@ alembic_version - -alembic_version - -version_num - - [VARCHAR(32)] - NOT NULL + +alembic_version + +version_num + + [VARCHAR(32)] + NOT NULL diff --git a/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py b/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py index 51a39c7d3b23b..feabf8b536556 100644 --- a/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py +++ b/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py @@ -24,11 +24,12 @@ Create Date: 2025-09-01 13:24:29.575087 """ + from __future__ import annotations # revision identifiers, used by Alembic. revision = "2d6e7c3a3864" -down_revision = ('3e4f92b7c1a2', 'a3c7f2b18d4e') +down_revision = ("3e4f92b7c1a2", "a3c7f2b18d4e") branch_labels = None depends_on = None airflow_version = "3.1.0" diff --git a/airflow-core/src/airflow/utils/db.py b/airflow-core/src/airflow/utils/db.py index 3a5305d1d6174..c1de4d26ad2bd 100644 --- a/airflow-core/src/airflow/utils/db.py +++ b/airflow-core/src/airflow/utils/db.py @@ -110,7 +110,7 @@ class MappedClassProtocol(Protocol): "2.10.3": "5f2621c13b39", "3.0.0": "29ce7909c52b", "3.0.3": "fe199e1abd77", - "3.1.0": "a3c7f2b18d4e", + "3.1.0": "2d6e7c3a3864", } From 44aee7f7ab1eb724a81281a31e295105849ab1df Mon Sep 17 00:00:00 2001 From: Shreyas K J Date: Thu, 4 Sep 2025 10:08:55 +0530 Subject: [PATCH 8/8] Resolve Static checks error --- .../migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py b/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py index feabf8b536556..8873bb0dedc7f 100644 --- a/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py +++ b/airflow-core/src/airflow/migrations/versions/0085_3_1_0_merge_heads_3e4f_a3c7.py @@ -17,7 +17,7 @@ # under the License. """ -merge heads 3e4f, a3c7 +merge heads 3e4f, a3c7. Revision ID: 2d6e7c3a3864 Revises: 3e4f92b7c1a2, a3c7f2b18d4e @@ -36,10 +36,10 @@ def upgrade(): - """Apply merge heads 3e4f, a3c7""" + """Apply merge heads 3e4f, a3c7.""" pass def downgrade(): - """Unapply merge heads 3e4f, a3c7""" + """Unapply merge heads 3e4f, a3c7.""" pass