diff --git a/airflow-core/README.md b/airflow-core/README.md index edeaa585c67c0..b71d725bc88df 100644 --- a/airflow-core/README.md +++ b/airflow-core/README.md @@ -18,4 +18,4 @@ --> This is a core airflow package that contains the functionality of Apache Airflow components: -scheduler, API server, dag file processor and triggerer. +scheduler, API server, Dag file processor and triggerer. diff --git a/airflow-core/docs/howto/listener-plugin.rst b/airflow-core/docs/howto/listener-plugin.rst index c5a0acd4a6676..754e9b8b4733d 100644 --- a/airflow-core/docs/howto/listener-plugin.rst +++ b/airflow-core/docs/howto/listener-plugin.rst @@ -23,7 +23,7 @@ Airflow has feature that allows to add listener for monitoring and tracking the task state using Plugins. This is a simple example listener plugin of Airflow that helps to track the task -state and collect useful metadata information about the task, Dag run and dag. +state and collect useful metadata information about the task, Dag run and Dag. This is an example plugin for Airflow that allows to create listener plugin of Airflow. This plugin works by using SQLAlchemy's event mechanism. It watches diff --git a/airflow-core/docs/img/airflow_erd.sha256 b/airflow-core/docs/img/airflow_erd.sha256 index be504c724ae4e..5700d8f95fc55 100644 --- a/airflow-core/docs/img/airflow_erd.sha256 +++ b/airflow-core/docs/img/airflow_erd.sha256 @@ -1 +1 @@ -6e452af5ca150404e6bd7553fb6a9adfcd7081ca60dfd09efea0f9aae7460cc6 \ No newline at end of file +c106254b0db4f7be6c268e26a201ee5c4eb45f596e7435f232a5071a75c4b437 \ No newline at end of file diff --git a/airflow-core/docs/img/diagram_basic_airflow_architecture.md5sum b/airflow-core/docs/img/diagram_basic_airflow_architecture.md5sum index d81957047b062..d4aebea715cfe 100644 --- a/airflow-core/docs/img/diagram_basic_airflow_architecture.md5sum +++ b/airflow-core/docs/img/diagram_basic_airflow_architecture.md5sum @@ -1 +1 @@ -2c62bb0602aab89a86375daeab7543ba +89ee5f65e7b3d25d04d9fe12f352c661 diff --git a/airflow-core/docs/img/diagram_basic_airflow_architecture.png b/airflow-core/docs/img/diagram_basic_airflow_architecture.png index ffef80a834cc1..cb3b6fe49094f 100644 Binary files a/airflow-core/docs/img/diagram_basic_airflow_architecture.png and b/airflow-core/docs/img/diagram_basic_airflow_architecture.png differ diff --git a/airflow-core/docs/img/diagram_basic_airflow_architecture.py b/airflow-core/docs/img/diagram_basic_airflow_architecture.py index a523188bb37fe..4ba3710543c1c 100644 --- a/airflow-core/docs/img/diagram_basic_airflow_architecture.py +++ b/airflow-core/docs/img/diagram_basic_airflow_architecture.py @@ -68,7 +68,7 @@ def generate_basic_airflow_diagram(): ): user = User("Airflow User") - dag_files = Custom("DAG files", MULTIPLE_FILES_IMAGE.as_posix()) + dag_files = Custom("Dag files", MULTIPLE_FILES_IMAGE.as_posix()) user >> Edge(color="brown", style="solid", reverse=False, label="author\n\n") >> dag_files with Cluster("Parsing, Scheduling & Executing"): diff --git a/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.md5sum b/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.md5sum index ffd3b442a0288..57b85a5400fe2 100644 --- a/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.md5sum +++ b/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.md5sum @@ -1 +1 @@ -56006541287fe451c20e5fdd373d5456 +2a7c3d3c13ed5ee81516357da8fb7e3d diff --git a/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.png b/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.png index c793e4f801b13..ba9c925b801a2 100644 Binary files a/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.png and b/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.png differ diff --git a/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.py b/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.py index 8a1ba58e2f1ea..d53f94e344d7a 100644 --- a/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.py +++ b/airflow-core/docs/img/diagram_dag_processor_airflow_architecture.py @@ -67,7 +67,7 @@ def generate_dag_processor_airflow_diagram(): operations_user = User("Operations User") deployment_manager = User("Deployment Manager") - with Cluster("Security perimeter with no DAG code execution", graph_attr={"bgcolor": "lightgrey"}): + with Cluster("Security perimeter with no Dag code execution", graph_attr={"bgcolor": "lightgrey"}): with Cluster("Scheduling\n\n"): schedulers = Custom("Scheduler(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) @@ -78,15 +78,15 @@ def generate_dag_processor_airflow_diagram(): metadata_db = Custom("Metadata DB", DATABASE_IMAGE.as_posix()) - dag_author = User("DAG Author") + dag_author = User("Dag Author") - with Cluster("Security perimeter with DAG code execution"): + with Cluster("Security perimeter with Dag code execution"): with Cluster("Execution"): workers = Custom("Worker(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) triggerer = Custom("Triggerer(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) with Cluster("Parsing"): dag_processors = Custom("DAG\nProcessor(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) - dag_files = Custom("DAG files", MULTIPLE_FILES_IMAGE.as_posix()) + dag_files = Custom("Dag files", MULTIPLE_FILES_IMAGE.as_posix()) plugins_and_packages = Custom("Plugin folder\n& installed packages", PACKAGES_IMAGE.as_posix()) diff --git a/airflow-core/docs/img/diagram_distributed_airflow_architecture.md5sum b/airflow-core/docs/img/diagram_distributed_airflow_architecture.md5sum index bcc881d52ccf6..18dab04988bc0 100644 --- a/airflow-core/docs/img/diagram_distributed_airflow_architecture.md5sum +++ b/airflow-core/docs/img/diagram_distributed_airflow_architecture.md5sum @@ -1 +1 @@ -9715885d7403de716a7f5114c47f8027 +8e5ec0bcedec30b8cf12ef73a2e3350b diff --git a/airflow-core/docs/img/diagram_distributed_airflow_architecture.png b/airflow-core/docs/img/diagram_distributed_airflow_architecture.png index 66117d74e0be7..eb1d49a2b9cd9 100644 Binary files a/airflow-core/docs/img/diagram_distributed_airflow_architecture.png and b/airflow-core/docs/img/diagram_distributed_airflow_architecture.png differ diff --git a/airflow-core/docs/img/diagram_distributed_airflow_architecture.py b/airflow-core/docs/img/diagram_distributed_airflow_architecture.py index 7c3ae3c3cd820..76c0ac6d57128 100644 --- a/airflow-core/docs/img/diagram_distributed_airflow_architecture.py +++ b/airflow-core/docs/img/diagram_distributed_airflow_architecture.py @@ -65,10 +65,10 @@ def generate_distributed_airflow_diagram(): graph_attr=graph_attr, edge_attr=edge_attr, ): - dag_author = User("DAG Author") + dag_author = User("Dag Author") deployment_manager = User("Deployment Manager") - dag_files = Custom("DAG files", MULTIPLE_FILES_IMAGE.as_posix(), height="1.8") + dag_files = Custom("Dag files", MULTIPLE_FILES_IMAGE.as_posix(), height="1.8") dag_author >> Edge(color="brown", style="solid", reverse=False, label="author\n\n") >> dag_files with Cluster("Parsing, Scheduling & Executing"): diff --git a/airflow-core/docs/img/diagram_multi_team_airflow_architecture.md5sum b/airflow-core/docs/img/diagram_multi_team_airflow_architecture.md5sum index 10dd3b08f6b4a..138e24275782c 100644 --- a/airflow-core/docs/img/diagram_multi_team_airflow_architecture.md5sum +++ b/airflow-core/docs/img/diagram_multi_team_airflow_architecture.md5sum @@ -1 +1 @@ -d1fa59cecc320e7cfc6f8483850b5dc6 +87c4172c68252332274d33830a8e526b diff --git a/airflow-core/docs/img/diagram_multi_team_airflow_architecture.png b/airflow-core/docs/img/diagram_multi_team_airflow_architecture.png index 70e667207c9b0..a8b0cf81468f8 100644 Binary files a/airflow-core/docs/img/diagram_multi_team_airflow_architecture.png and b/airflow-core/docs/img/diagram_multi_team_airflow_architecture.png differ diff --git a/airflow-core/docs/img/diagram_multi_team_airflow_architecture.py b/airflow-core/docs/img/diagram_multi_team_airflow_architecture.py index 0b576dc3c641c..94a4e07f7a9da 100644 --- a/airflow-core/docs/img/diagram_multi_team_airflow_architecture.py +++ b/airflow-core/docs/img/diagram_multi_team_airflow_architecture.py @@ -111,7 +111,7 @@ def generate_dag_processor_airflow_diagram(): ) deployment_manager_1 = User("Deployment\nManager\nTeam 1") - dag_author_1 = User("DAG Author\nTeam 1") + dag_author_1 = User("Dag Author\nTeam 1") with Cluster("Team 1 Airflow Deployment", graph_attr={"bgcolor": "#AAAABB", "fontsize": "22"}): with Cluster("No DB access"): @@ -120,12 +120,12 @@ def generate_dag_processor_airflow_diagram(): triggerer_1 = Custom("Triggerer(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) with Cluster("Parsing"): dag_processors_1 = Custom("DAG\nProcessor(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) - dag_files_1 = Custom("DAG Bundles\nTeam 1", MULTIPLE_FILES_IMAGE.as_posix()) + dag_files_1 = Custom("Dag Bundles\nTeam 1", MULTIPLE_FILES_IMAGE.as_posix()) plugins_and_packages_1 = Custom("Plugins\n& Packages\nTenant 1", PACKAGES_IMAGE.as_posix()) operations_user_1 = User("Operations User\nTeam 1") deployment_manager_2 = User("Deployment\nManager\nTeam 2") - dag_author_2 = User("DAG Author\nTeam 2") + dag_author_2 = User("Dag Author\nTeam 2") with Cluster("Team 2 Airflow Deployment", graph_attr={"fontsize": "22"}): with Cluster("No DB access"): @@ -134,7 +134,7 @@ def generate_dag_processor_airflow_diagram(): triggerer_2 = Custom("Triggerer(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) with Cluster("Parsing"): dag_processors_2 = Custom("DAG\nProcessor(s)", PYTHON_MULTIPROCESS_LOGO.as_posix()) - dag_files_2 = Custom("DAG Bundles\nTeam 2", MULTIPLE_FILES_IMAGE.as_posix()) + dag_files_2 = Custom("Dag Bundles\nTeam 2", MULTIPLE_FILES_IMAGE.as_posix()) plugins_and_packages_2 = Custom("Plugins\n& Packages\nTeam 2", PACKAGES_IMAGE.as_posix()) operations_user_2 = User("Operations User\nTeam 2") diff --git a/airflow-core/docs/migrations-ref.rst b/airflow-core/docs/migrations-ref.rst index f6291714ffa37..f74e184654e2f 100644 --- a/airflow-core/docs/migrations-ref.rst +++ b/airflow-core/docs/migrations-ref.rst @@ -119,7 +119,7 @@ Here's the list of all the Database Migrations that are executed via when you ru +-------------------------+------------------+-------------------+--------------------------------------------------------------+ | ``2b47dc6bc8df`` | ``d03e4a635aa3`` | ``3.0.0`` | add dag versioning. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ -| ``d03e4a635aa3`` | ``d8cd3297971e`` | ``3.0.0`` | Drop DAG pickling. | +| ``d03e4a635aa3`` | ``d8cd3297971e`` | ``3.0.0`` | Drop Dag pickling. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ | ``d8cd3297971e`` | ``5f57a45b8433`` | ``3.0.0`` | Add last_heartbeat_at directly to TI. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ @@ -154,8 +154,8 @@ Here's the list of all the Database Migrations that are executed via when you ru +-------------------------+------------------+-------------------+--------------------------------------------------------------+ | ``0bfc26bc256e`` | ``d0f1c55954fa`` | ``3.0.0`` | Rename DagModel schedule_interval to timetable_summary. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ -| ``d0f1c55954fa`` | ``044f740568ec`` | ``3.0.0`` | Remove SubDAGs: ``is_subdag`` & ``root_dag_id`` columns from | -| | | | DAG table. | +| ``d0f1c55954fa`` | ``044f740568ec`` | ``3.0.0`` | Remove SubDags: ``is_subdag`` & ``root_dag_id`` columns from | +| | | | Dag table. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ | ``044f740568ec`` | ``5f2621c13b39`` | ``3.0.0`` | Drop ab_user.id foreign key. | +-------------------------+------------------+-------------------+--------------------------------------------------------------+ diff --git a/airflow-core/src/airflow/api/common/delete_dag.py b/airflow-core/src/airflow/api/common/delete_dag.py index a617bcdc5c61c..bf4a38300bd50 100644 --- a/airflow-core/src/airflow/api/common/delete_dag.py +++ b/airflow-core/src/airflow/api/common/delete_dag.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Delete DAGs APIs.""" +"""Delete Dags APIs.""" from __future__ import annotations @@ -42,9 +42,9 @@ @provide_session def delete_dag(dag_id: str, keep_records_in_log: bool = True, session: Session = NEW_SESSION) -> int: """ - Delete a DAG by a dag_id. + Delete a Dag by a dag_id. - :param dag_id: the dag_id of the DAG to delete + :param dag_id: the dag_id of the Dag to delete :param keep_records_in_log: whether keep records of the given dag_id in the Log table in the backend database (for reasons like auditing). The default value is True. diff --git a/airflow-core/src/airflow/api/common/mark_tasks.py b/airflow-core/src/airflow/api/common/mark_tasks.py index fe02e3b462636..bfc6522af6c31 100644 --- a/airflow-core/src/airflow/api/common/mark_tasks.py +++ b/airflow-core/src/airflow/api/common/mark_tasks.py @@ -79,7 +79,7 @@ def set_state( task_dags = {task[0].dag if isinstance(task, tuple) else task.dag for task in tasks} if len(task_dags) > 1: - raise ValueError(f"Received tasks from multiple DAGs: {task_dags}") + raise ValueError(f"Received tasks from multiple Dags: {task_dags}") dag = next(iter(task_dags)) if dag is None: raise ValueError("Received tasks with no DAG") @@ -143,7 +143,7 @@ def find_task_relatives(tasks, downstream, upstream): @provide_session def get_run_ids(dag: DAG, run_id: str, future: bool, past: bool, session: SASession = NEW_SESSION): - """Return DAG executions' run_ids.""" + """Return Dag executions' run_ids.""" current_dagrun = dag.get_dagrun(run_id=run_id, session=session) if current_dagrun.logical_date is None: return [run_id] @@ -162,7 +162,7 @@ def get_run_ids(dag: DAG, run_id: str, future: bool, past: bool, session: SASess end_date = last_dagrun.logical_date if future else current_dagrun.logical_date start_date = current_dagrun.logical_date if not past else first_dagrun.logical_date if not dag.timetable.can_be_scheduled: - # If the DAG never schedules, need to look at existing DagRun if the user wants future or + # If the Dag never schedules, need to look at existing DagRun if the user wants future or # past runs. dag_runs = dag.get_dagruns_between(start_date=start_date, end_date=end_date, session=session) run_ids = sorted({d.run_id for d in dag_runs}) @@ -205,9 +205,9 @@ def set_dag_run_state_to_success( Set for a specific logical date and its task instances to success. - :param dag: the DAG of which to alter state + :param dag: the Dag of which to alter state :param run_id: the run_id to start looking from - :param commit: commit DAG and tasks to be altered to the database + :param commit: commit Dag and tasks to be altered to the database :param session: database session :return: If commit is true, list of tasks that have been updated, otherwise list of tasks that will be updated @@ -266,9 +266,9 @@ def set_dag_run_state_to_failed( Set for a specific logical date and its task instances to failed. - :param dag: the DAG of which to alter state - :param run_id: the DAG run_id to start looking from - :param commit: commit DAG and tasks to be altered to the database + :param dag: the Dag of which to alter state + :param run_id: the Dag run_id to start looking from + :param commit: commit Dag and tasks to be altered to the database :param session: database session :return: If commit is true, list of tasks that have been updated, otherwise list of tasks that will be updated @@ -356,9 +356,9 @@ def __set_dag_run_state_to_running_or_queued( """ Set the dag run for a specific logical date to running. - :param dag: the DAG of which to alter state + :param dag: the Dag of which to alter state :param run_id: the id of the DagRun - :param commit: commit DAG and tasks to be altered to the database + :param commit: commit Dag and tasks to be altered to the database :param session: database session :return: If commit is true, list of tasks that have been updated, otherwise list of tasks that will be updated diff --git a/airflow-core/src/airflow/api/common/trigger_dag.py b/airflow-core/src/airflow/api/common/trigger_dag.py index fa793d221ec58..ce3bfd42f76ac 100644 --- a/airflow-core/src/airflow/api/common/trigger_dag.py +++ b/airflow-core/src/airflow/api/common/trigger_dag.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Triggering DAG runs APIs.""" +"""Triggering Dag runs APIs.""" from __future__ import annotations @@ -53,10 +53,10 @@ def _trigger_dag( session: Session = NEW_SESSION, ) -> DagRun | None: """ - Triggers DAG run. + Triggers Dag run. - :param dag_id: DAG ID - :param dag_bag: DAG Bag model + :param dag_id: Dag ID + :param dag_bag: Dag Bag model :param triggered_by: the entity which triggers the dag_run :param triggering_user_name: the user name who triggers the dag_run :param run_after: the datetime before which dag cannot run @@ -138,9 +138,9 @@ def trigger_dag( session: Session = NEW_SESSION, ) -> DagRun | None: """ - Triggers execution of DAG specified by dag_id. + Triggers execution of Dag specified by dag_id. - :param dag_id: DAG ID + :param dag_id: Dag ID :param triggered_by: the entity which triggers the dag_run :param triggering_user_name: the user name who triggers the dag_run :param run_after: the datetime before which dag won't run diff --git a/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py b/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py index 8e7ef8573f2dc..c09dfefa51b12 100644 --- a/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py +++ b/airflow-core/src/airflow/api_fastapi/auth/managers/base_auth_manager.py @@ -187,8 +187,8 @@ def is_authorized_dag( :param method: the method to perform :param user: the user to performing the action - :param access_entity: the kind of DAG information the authorization request is about. - If not provided, the authorization request is about the DAG itself + :param access_entity: the kind of Dag information the authorization request is about. + If not provided, the authorization request is about the Dag itself :param details: optional details about the DAG """ @@ -347,9 +347,9 @@ def get_authorized_dag_ids( session: Session = NEW_SESSION, ) -> set[str]: """ - Get DAGs the user has access to. + Get Dags the user has access to. - By default, reads all the DAGs and check individually if the user has permissions to access the DAG. + By default, reads all the Dags and check individually if the user has permissions to access the DAG. Can lead to some poor performance. It is recommended to override this method in the auth manager implementation to provide a more efficient implementation. @@ -368,9 +368,9 @@ def filter_authorized_dag_ids( method: ResourceMethod = "GET", ) -> set[str]: """ - Filter DAGs the user has access to. + Filter Dags the user has access to. - :param dag_ids: the list of DAG ids + :param dag_ids: the list of Dag ids :param user: the user :param method: the method to filter on """ diff --git a/airflow-core/src/airflow/api_fastapi/auth/managers/models/resource_details.py b/airflow-core/src/airflow/api_fastapi/auth/managers/models/resource_details.py index aed68f27aa8d4..a44151388c541 100644 --- a/airflow-core/src/airflow/api_fastapi/auth/managers/models/resource_details.py +++ b/airflow-core/src/airflow/api_fastapi/auth/managers/models/resource_details.py @@ -94,7 +94,7 @@ class AccessView(Enum): class DagAccessEntity(Enum): - """Enum of DAG entities the user tries to access.""" + """Enum of Dag entities the user tries to access.""" AUDIT_LOG = "AUDIT_LOG" CODE = "CODE" diff --git a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py index b3ce04a94b8ea..6ce975c4192fb 100644 --- a/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py +++ b/airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py @@ -71,7 +71,7 @@ class SimpleAuthManagerRole(namedtuple("SimpleAuthManagerRole", "name order"), E # VIEWER role gives all read-only permissions VIEWER = "VIEWER", 0 - # USER role gives viewer role permissions + access to DAGs + # USER role gives viewer role permissions + access to Dags USER = "USER", 1 # OP role gives user role permissions + access to connections, config, pools, variables diff --git a/airflow-core/src/airflow/api_fastapi/common/dagbag.py b/airflow-core/src/airflow/api_fastapi/common/dagbag.py index f1c7271b020f6..5db22690dd0e2 100644 --- a/airflow-core/src/airflow/api_fastapi/common/dagbag.py +++ b/airflow-core/src/airflow/api_fastapi/common/dagbag.py @@ -29,7 +29,7 @@ def create_dag_bag() -> DBDagBag: - """Create DagBag to retrieve DAGs from the database.""" + """Create DagBag to retrieve Dags from the database.""" return DBDagBag() diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py index 5dcecc6bb5c80..5ba5f4b48c8ba 100644 --- a/airflow-core/src/airflow/api_fastapi/common/parameters.py +++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py @@ -114,7 +114,7 @@ def depends(cls, offset: NonNegativeInt = 0) -> OffsetFilter: class _FavoriteFilter(BaseParam[bool]): - """Filter DAGs by favorite status.""" + """Filter Dags by favorite status.""" def __init__(self, user_id: str, value: T | None = None, skip_none: bool = True) -> None: super().__init__(skip_none=skip_none) @@ -638,7 +638,7 @@ def depends_float( class _HasAssetScheduleFilter(BaseParam[bool]): - """Filter DAGs that have asset-based scheduling.""" + """Filter Dags that have asset-based scheduling.""" def to_orm(self, select: Select) -> Select: if self.value is None and self.skip_none: @@ -647,22 +647,22 @@ def to_orm(self, select: Select) -> Select: asset_ref_subquery = sql_select(DagScheduleAssetReference.dag_id).distinct() if self.value: - # Filter DAGs that have asset-based scheduling + # Filter Dags that have asset-based scheduling return select.where(DagModel.dag_id.in_(asset_ref_subquery)) - # Filter DAGs that do NOT have asset-based scheduling + # Filter Dags that do NOT have asset-based scheduling return select.where(DagModel.dag_id.notin_(asset_ref_subquery)) @classmethod def depends( cls, - has_asset_schedule: bool | None = Query(None, description="Filter DAGs with asset-based scheduling"), + has_asset_schedule: bool | None = Query(None, description="Filter Dags with asset-based scheduling"), ) -> _HasAssetScheduleFilter: return cls().set_value(has_asset_schedule) class _AssetDependencyFilter(BaseParam[str]): - """Filter DAGs by specific asset dependencies.""" + """Filter Dags by specific asset dependencies.""" def to_orm(self, select: Select) -> Select: if self.value is None and self.skip_none: @@ -681,7 +681,7 @@ def to_orm(self, select: Select) -> Select: def depends( cls, asset_dependency: str | None = Query( - None, description="Filter DAGs by asset dependency (name or URI)" + None, description="Filter Dags by asset dependency (name or URI)" ), ) -> _AssetDependencyFilter: return cls().set_value(asset_dependency) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/assets.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/assets.py index 8261cfa11ea7a..112fe97d8b9c6 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/assets.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/assets.py @@ -26,7 +26,7 @@ class DagScheduleAssetReference(StrictBaseModel): - """DAG schedule reference serializer for assets.""" + """Dag schedule reference serializer for assets.""" dag_id: str created_at: datetime diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_report.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_report.py index aeab3f91af91b..ebd477919988c 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_report.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_report.py @@ -23,7 +23,7 @@ class DagReportResponse(BaseModel): - """DAG Report serializer for responses.""" + """Dag Report serializer for responses.""" file: str duration: timedelta @@ -34,7 +34,7 @@ class DagReportResponse(BaseModel): class DagReportCollectionResponse(BaseModel): - """DAG Report Collection serializer for responses.""" + """Dag Report Collection serializer for responses.""" dag_reports: list[DagReportResponse] total_entries: int diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py index 9a0bb16b91884..c8b5ed710bced 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py @@ -36,7 +36,7 @@ class DAGRunPatchStates(str, Enum): - """Enum for DAG Run states when updating a DAG Run.""" + """Enum for Dag Run states when updating a Dag Run.""" QUEUED = DagRunState.QUEUED SUCCESS = DagRunState.SUCCESS @@ -44,14 +44,14 @@ class DAGRunPatchStates(str, Enum): class DAGRunPatchBody(StrictBaseModel): - """DAG Run Serializer for PATCH requests.""" + """Dag Run Serializer for PATCH requests.""" state: DAGRunPatchStates | None = None note: str | None = Field(None, max_length=1000) class DAGRunClearBody(StrictBaseModel): - """DAG Run serializer for clear endpoint body.""" + """Dag Run serializer for clear endpoint body.""" dry_run: bool = True only_failed: bool = False @@ -62,7 +62,7 @@ class DAGRunClearBody(StrictBaseModel): class DAGRunResponse(BaseModel): - """DAG Run serializer for responses.""" + """Dag Run serializer for responses.""" dag_run_id: str = Field(validation_alias="run_id") dag_id: str @@ -87,14 +87,14 @@ class DAGRunResponse(BaseModel): class DAGRunCollectionResponse(BaseModel): - """DAG Run Collection serializer for responses.""" + """Dag Run Collection serializer for responses.""" dag_runs: list[DAGRunResponse] total_entries: int class TriggerDAGRunPostBody(StrictBaseModel): - """Trigger DAG Run Serializer for POST body.""" + """Trigger Dag Run Serializer for POST body.""" dag_run_id: str | None = None data_interval_start: AwareDatetime | None = None @@ -153,7 +153,7 @@ def validate_dag_run_id(self): class DAGRunsBatchBody(StrictBaseModel): - """List DAG Runs body for batch endpoint.""" + """List Dag Runs body for batch endpoint.""" order_by: str | None = None page_offset: NonNegativeInt = 0 diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_sources.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_sources.py index c41d55f9aa2fb..fdc081a0ab2b7 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_sources.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_sources.py @@ -22,7 +22,7 @@ class DAGSourceResponse(BaseModel): - """DAG Source serializer for responses.""" + """Dag Source serializer for responses.""" content: str | None dag_id: str diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_stats.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_stats.py index 921886b37c4b6..d07646f41a0d9 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_stats.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_stats.py @@ -31,7 +31,7 @@ class DagStatsStateResponse(BaseModel): class DagStatsResponse(BaseModel): - """DAG Stats serializer for responses.""" + """Dag Stats serializer for responses.""" dag_id: str dag_display_name: str = Field(validation_alias=AliasPath("dag_model", "dag_display_name")) @@ -39,7 +39,7 @@ class DagStatsResponse(BaseModel): class DagStatsCollectionResponse(BaseModel): - """DAG Stats Collection serializer for responses.""" + """Dag Stats Collection serializer for responses.""" dags: list[DagStatsResponse] total_entries: int diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_tags.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_tags.py index 901787de1fb0a..1ca8ae611288e 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_tags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_tags.py @@ -23,7 +23,7 @@ class DagTagResponse(BaseModel): - """DAG Tag serializer for responses.""" + """Dag Tag serializer for responses.""" name: str dag_id: str @@ -31,7 +31,7 @@ class DagTagResponse(BaseModel): class DAGTagCollectionResponse(BaseModel): - """DAG Tags Collection serializer for responses.""" + """Dag Tags Collection serializer for responses.""" tags: list[str] total_entries: int diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_versions.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_versions.py index 2475d49031fa1..5c66e5c6819cf 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_versions.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_versions.py @@ -63,7 +63,7 @@ def bundle_url(self) -> str | None: class DAGVersionCollectionResponse(BaseModel): - """DAG Version Collection serializer for responses.""" + """Dag Version Collection serializer for responses.""" dag_versions: list[DagVersionResponse] total_entries: int diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_warning.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_warning.py index 15fe12c1ee08e..ffddc11b2a386 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_warning.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_warning.py @@ -26,7 +26,7 @@ class DAGWarningResponse(BaseModel): - """DAG Warning serializer for responses.""" + """Dag Warning serializer for responses.""" dag_id: str warning_type: DagWarningType @@ -36,7 +36,7 @@ class DAGWarningResponse(BaseModel): class DAGWarningCollectionResponse(BaseModel): - """DAG warning collection serializer for responses.""" + """Dag warning collection serializer for responses.""" dag_warnings: list[DAGWarningResponse] total_entries: int diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py index 0a5f34e8f25f1..b51ff33a8feca 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dags.py @@ -48,7 +48,7 @@ class DAGResponse(BaseModel): - """DAG serializer for responses.""" + """Dag serializer for responses.""" model_config = ConfigDict( alias_generator=AliasGenerator( @@ -84,7 +84,7 @@ class DAGResponse(BaseModel): @field_validator("owners", mode="before") @classmethod def get_owners(cls, v: Any) -> list[str] | None: - """Convert owners attribute to DAG representation.""" + """Convert owners attribute to Dag representation.""" if not (v is None or isinstance(v, str)): return v @@ -122,14 +122,14 @@ class DAGPatchBody(StrictBaseModel): class DAGCollectionResponse(BaseModel): - """DAG Collection serializer for responses.""" + """Dag Collection serializer for responses.""" dags: list[DAGResponse] total_entries: int class DAGDetailsResponse(DAGResponse): - """Specific serializer for DAG Details responses.""" + """Specific serializer for Dag Details responses.""" model_config = ConfigDict( from_attributes=True, diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py index c3cc5a53d8cd1..2b1ecd0879a4f 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py @@ -25,7 +25,7 @@ class CalendarTimeRangeResponse(BaseModel): - """Represents a summary of DAG runs for a specific calendar time range.""" + """Represents a summary of Dag runs for a specific calendar time range.""" date: datetime state: Literal[ diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dag_runs.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dag_runs.py index d99761f745753..8693cca8a388c 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dag_runs.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dag_runs.py @@ -23,7 +23,7 @@ class DAGRunLightResponse(BaseModel): - """DAG Run serializer for responses.""" + """Dag Run serializer for responses.""" id: int dag_id: str diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py index 08588ef7856fd..527583690ee65 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py @@ -23,14 +23,14 @@ class DAGWithLatestDagRunsResponse(DAGResponse): - """DAG with latest dag runs response serializer.""" + """Dag with latest dag runs response serializer.""" asset_expression: dict | None latest_dag_runs: list[DAGRunResponse] class DAGWithLatestDagRunsCollectionResponse(BaseModel): - """DAG with latest dag runs collection response serializer.""" + """Dag with latest dag runs collection response serializer.""" total_entries: int dags: list[DAGWithLatestDagRunsResponse] diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dashboard.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dashboard.py index bf2afa9fcd3c8..3537831ff9d50 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dashboard.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dashboard.py @@ -20,7 +20,7 @@ class DAGRunTypes(BaseModel): - """DAG Run Types for responses.""" + """Dag Run Types for responses.""" backfill: int scheduled: int @@ -29,7 +29,7 @@ class DAGRunTypes(BaseModel): class DAGRunStates(BaseModel): - """DAG Run States for responses.""" + """Dag Run States for responses.""" queued: int running: int @@ -64,7 +64,7 @@ class HistoricalMetricDataResponse(BaseModel): class DashboardDagStatsResponse(BaseModel): - """Dashboard DAG Stats serializer for responses.""" + """Dashboard Dag Stats serializer for responses.""" active_dag_count: int failed_dag_count: int diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py index b523dce96ffaa..6b7ea9607a906 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/grid.py @@ -35,7 +35,7 @@ class LightGridTaskInstanceSummary(BaseModel): class GridTISummaries(BaseModel): - """DAG Run model for the Grid UI.""" + """Dag Run model for the Grid UI.""" run_id: str dag_id: str diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml index 4027378a1c062..423343b00ae3b 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml @@ -103,7 +103,7 @@ paths: tags: - DAG summary: Get Dags - description: Get DAGs with recent DagRun. + description: Get Dags with recent DagRun. operationId: get_dags_ui security: - OAuth2PasswordBearer: [] @@ -257,9 +257,9 @@ paths: anyOf: - type: boolean - type: 'null' - description: Filter DAGs with asset-based scheduling + description: Filter Dags with asset-based scheduling title: Has Asset Schedule - description: Filter DAGs with asset-based scheduling + description: Filter Dags with asset-based scheduling - name: asset_dependency in: query required: false @@ -267,9 +267,9 @@ paths: anyOf: - type: string - type: 'null' - description: Filter DAGs by asset dependency (name or URI) + description: Filter Dags by asset dependency (name or URI) title: Asset Dependency - description: Filter DAGs by asset dependency (name or URI) + description: Filter Dags by asset dependency (name or URI) responses: '200': description: Successful Response @@ -409,7 +409,7 @@ paths: tags: - Dashboard summary: Dag Stats - description: Return basic DAG stats with counts of DAGs in various states. + description: Return basic Dag stats with counts of Dags in various states. operationId: dag_stats responses: '200': @@ -854,7 +854,7 @@ paths: tags: - Calendar summary: Get Calendar - description: Get calendar data for a DAG including historical and planned DAG + description: Get calendar data for a Dag including historical and planned Dag runs. operationId: get_calendar security: @@ -1107,7 +1107,7 @@ components: - state - count title: CalendarTimeRangeResponse - description: Represents a summary of DAG runs for a specific calendar time range. + description: Represents a summary of Dag runs for a specific calendar time range. ConfigResponse: properties: page_size: @@ -1276,7 +1276,7 @@ components: - end_date - state title: DAGRunLightResponse - description: DAG Run serializer for responses. + description: Dag Run serializer for responses. DAGRunResponse: properties: dag_run_id: @@ -1396,7 +1396,7 @@ components: - bundle_version - dag_display_name title: DAGRunResponse - description: DAG Run serializer for responses. + description: Dag Run serializer for responses. DAGRunStates: properties: queued: @@ -1418,7 +1418,7 @@ components: - success - failed title: DAGRunStates - description: DAG Run States for responses. + description: Dag Run States for responses. DAGRunTypes: properties: backfill: @@ -1440,7 +1440,7 @@ components: - manual - asset_triggered title: DAGRunTypes - description: DAG Run Types for responses. + description: Dag Run Types for responses. DAGWithLatestDagRunsCollectionResponse: properties: total_entries: @@ -1456,7 +1456,7 @@ components: - total_entries - dags title: DAGWithLatestDagRunsCollectionResponse - description: DAG with latest dag runs collection response serializer. + description: Dag with latest dag runs collection response serializer. DAGWithLatestDagRunsResponse: properties: dag_id: @@ -1613,7 +1613,7 @@ components: - latest_dag_runs - file_token title: DAGWithLatestDagRunsResponse - description: DAG with latest dag runs response serializer. + description: Dag with latest dag runs response serializer. DagRunState: type: string enum: @@ -1669,7 +1669,7 @@ components: - dag_id - dag_display_name title: DagTagResponse - description: DAG Tag serializer for responses. + description: Dag Tag serializer for responses. DagVersionResponse: properties: id: @@ -1738,7 +1738,7 @@ components: - running_dag_count - queued_dag_count title: DashboardDagStatsResponse - description: Dashboard DAG Stats serializer for responses. + description: Dashboard Dag Stats serializer for responses. EdgeResponse: properties: source_id: @@ -1888,7 +1888,7 @@ components: - dag_id - task_instances title: GridTISummaries - description: DAG Run model for the Grid UI. + description: Dag Run model for the Grid UI. HTTPExceptionResponse: properties: detail: 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 ebeb24e31a3e6..f48083ef601a1 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 @@ -436,7 +436,7 @@ paths: tags: - Asset summary: Materialize Asset - description: Materialize an asset by triggering a DAG run that produces it. + description: Materialize an asset by triggering a Dag run that produces it. operationId: materialize_asset security: - OAuth2PasswordBearer: [] @@ -1715,7 +1715,7 @@ paths: tags: - DagRun summary: Delete Dag Run - description: Delete a DAG Run entry. + description: Delete a Dag Run entry. operationId: delete_dag_run security: - OAuth2PasswordBearer: [] @@ -1770,7 +1770,7 @@ paths: tags: - DagRun summary: Patch Dag Run - description: Modify a DAG Run. + description: Modify a Dag Run. operationId: patch_dag_run security: - OAuth2PasswordBearer: [] @@ -1963,11 +1963,11 @@ paths: tags: - DagRun summary: Get Dag Runs - description: 'Get all DAG Runs. + description: 'Get all Dag Runs. This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for - all DAGs.' + all Dags.' operationId: get_dag_runs security: - OAuth2PasswordBearer: [] @@ -2410,7 +2410,7 @@ paths: tags: - DagRun summary: Get List Dag Runs Batch - description: Get a list of DAG Runs. + description: Get a list of Dag Runs. operationId: get_list_dag_runs_batch security: - OAuth2PasswordBearer: [] @@ -2604,7 +2604,7 @@ paths: tags: - DagReport summary: Get Dag Reports - description: Get DAG report. + description: Get Dag report. operationId: get_dag_reports security: - OAuth2PasswordBearer: [] @@ -2814,7 +2814,7 @@ paths: tags: - DagWarning summary: List Dag Warnings - description: Get a list of DAG warnings. + description: Get a list of Dag warnings. operationId: list_dag_warnings security: - OAuth2PasswordBearer: [] @@ -2892,7 +2892,7 @@ paths: tags: - DAG summary: Get Dags - description: Get all DAGs. + description: Get all Dags. operationId: get_dags security: - OAuth2PasswordBearer: [] @@ -3011,9 +3011,9 @@ paths: anyOf: - type: boolean - type: 'null' - description: Filter DAGs with asset-based scheduling + description: Filter Dags with asset-based scheduling title: Has Asset Schedule - description: Filter DAGs with asset-based scheduling + description: Filter Dags with asset-based scheduling - name: asset_dependency in: query required: false @@ -3021,9 +3021,9 @@ paths: anyOf: - type: string - type: 'null' - description: Filter DAGs by asset dependency (name or URI) + description: Filter Dags by asset dependency (name or URI) title: Asset Dependency - description: Filter DAGs by asset dependency (name or URI) + description: Filter Dags by asset dependency (name or URI) - name: dag_run_start_date_gte in: query required: false @@ -3151,7 +3151,7 @@ paths: tags: - DAG summary: Patch Dags - description: Patch multiple DAGs. + description: Patch multiple Dags. operationId: patch_dags security: - OAuth2PasswordBearer: [] @@ -3514,7 +3514,7 @@ paths: tags: - DAG summary: Favorite Dag - description: Mark the DAG as favorite. + description: Mark the Dag as favorite. operationId: favorite_dag security: - OAuth2PasswordBearer: [] @@ -3558,7 +3558,7 @@ paths: tags: - DAG summary: Unfavorite Dag - description: Unmark the DAG as favorite. + description: Unmark the Dag as favorite. operationId: unfavorite_dag security: - OAuth2PasswordBearer: [] @@ -4810,7 +4810,7 @@ paths: This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to - retrieve XCom entries for all DAGs.' + retrieve XCom entries for all Dags.' operationId: get_xcom_entries security: - OAuth2PasswordBearer: [] @@ -6114,9 +6114,9 @@ paths: This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve - Task Instances for all DAGs + Task Instances for all Dags - and DAG runs.' + and Dag runs.' operationId: get_task_instances security: - OAuth2PasswordBearer: [] @@ -7603,9 +7603,9 @@ paths: /api/v2/parseDagFile/{file_token}: put: tags: - - DAG Parsing + - Dag Parsing summary: Reparse Dag File - description: Request re-parsing a DAG file. + description: Request re-parsing a Dag file. operationId: reparse_dag_file security: - OAuth2PasswordBearer: [] @@ -7654,7 +7654,7 @@ paths: tags: - DAG summary: Get Dag Tags - description: Get all DAG tags. + description: Get all Dag tags. operationId: get_dag_tags security: - OAuth2PasswordBearer: [] @@ -7782,11 +7782,11 @@ paths: tags: - DagVersion summary: Get Dag Versions - description: 'Get all DAG Versions. + description: 'Get all Dag Versions. - This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions - for all DAGs.' + This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions + for all Dags.' operationId: get_dag_versions security: - OAuth2PasswordBearer: [] @@ -9424,7 +9424,7 @@ components: - dags - total_entries title: DAGCollectionResponse - description: DAG Collection serializer for responses. + description: Dag Collection serializer for responses. DAGDetailsResponse: properties: dag_id: @@ -9674,7 +9674,7 @@ components: - concurrency - latest_dag_version title: DAGDetailsResponse - description: Specific serializer for DAG Details responses. + description: Specific serializer for Dag Details responses. DAGPatchBody: properties: is_paused: @@ -9829,7 +9829,7 @@ components: - owners - file_token title: DAGResponse - description: DAG serializer for responses. + description: Dag serializer for responses. DAGRunClearBody: properties: dry_run: @@ -9849,7 +9849,7 @@ components: additionalProperties: false type: object title: DAGRunClearBody - description: DAG Run serializer for clear endpoint body. + description: Dag Run serializer for clear endpoint body. DAGRunCollectionResponse: properties: dag_runs: @@ -9865,7 +9865,7 @@ components: - dag_runs - total_entries title: DAGRunCollectionResponse - description: DAG Run Collection serializer for responses. + description: Dag Run Collection serializer for responses. DAGRunPatchBody: properties: state: @@ -9881,7 +9881,7 @@ components: additionalProperties: false type: object title: DAGRunPatchBody - description: DAG Run Serializer for PATCH requests. + description: Dag Run Serializer for PATCH requests. DAGRunPatchStates: type: string enum: @@ -9889,7 +9889,7 @@ components: - success - failed title: DAGRunPatchStates - description: Enum for DAG Run states when updating a DAG Run. + description: Enum for Dag Run states when updating a Dag Run. DAGRunResponse: properties: dag_run_id: @@ -10009,7 +10009,7 @@ components: - bundle_version - dag_display_name title: DAGRunResponse - description: DAG Run serializer for responses. + description: Dag Run serializer for responses. DAGRunsBatchBody: properties: order_by: @@ -10142,7 +10142,7 @@ components: additionalProperties: false type: object title: DAGRunsBatchBody - description: List DAG Runs body for batch endpoint. + description: List Dag Runs body for batch endpoint. DAGSourceResponse: properties: content: @@ -10168,7 +10168,7 @@ components: - version_number - dag_display_name title: DAGSourceResponse - description: DAG Source serializer for responses. + description: Dag Source serializer for responses. DAGTagCollectionResponse: properties: tags: @@ -10184,7 +10184,7 @@ components: - tags - total_entries title: DAGTagCollectionResponse - description: DAG Tags Collection serializer for responses. + description: Dag Tags Collection serializer for responses. DAGVersionCollectionResponse: properties: dag_versions: @@ -10200,7 +10200,7 @@ components: - dag_versions - total_entries title: DAGVersionCollectionResponse - description: DAG Version Collection serializer for responses. + description: Dag Version Collection serializer for responses. DAGWarningCollectionResponse: properties: dag_warnings: @@ -10216,7 +10216,7 @@ components: - dag_warnings - total_entries title: DAGWarningCollectionResponse - description: DAG warning collection serializer for responses. + description: Dag warning collection serializer for responses. DAGWarningResponse: properties: dag_id: @@ -10242,7 +10242,7 @@ components: - timestamp - dag_display_name title: DAGWarningResponse - description: DAG Warning serializer for responses. + description: Dag Warning serializer for responses. DagProcessorInfoResponse: properties: status: @@ -10371,7 +10371,7 @@ components: - created_at - updated_at title: DagScheduleAssetReference - description: DAG schedule reference serializer for assets. + description: Dag schedule reference serializer for assets. DagStatsCollectionResponse: properties: dags: @@ -10387,7 +10387,7 @@ components: - dags - total_entries title: DagStatsCollectionResponse - description: DAG Stats Collection serializer for responses. + description: Dag Stats Collection serializer for responses. DagStatsResponse: properties: dag_id: @@ -10407,7 +10407,7 @@ components: - dag_display_name - stats title: DagStatsResponse - description: DAG Stats serializer for responses. + description: Dag Stats serializer for responses. DagStatsStateResponse: properties: state: @@ -10438,7 +10438,7 @@ components: - dag_id - dag_display_name title: DagTagResponse - description: DAG Tag serializer for responses. + description: Dag Tag serializer for responses. DagVersionResponse: properties: id: @@ -10492,7 +10492,7 @@ components: - asset conflict - non-existent pool title: DagWarningType - description: 'Enum for DAG warning types. + description: 'Enum for Dag warning types. This is the set of allowable values for the ``warning_type`` field @@ -12392,7 +12392,7 @@ components: required: - logical_date title: TriggerDAGRunPostBody - description: Trigger DAG Run Serializer for POST body. + description: Trigger Dag Run Serializer for POST body. TriggerResponse: properties: id: diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py index 839403352483e..1c590bad10514 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py @@ -351,7 +351,7 @@ def materialize_asset( user: GetUserDep, session: SessionDep, ) -> DAGRunResponse: - """Materialize an asset by triggering a DAG run that produces it.""" + """Materialize an asset by triggering a Dag run that produces it.""" dag_id_it = iter( session.scalars( select(TaskOutletAssetReference.dag_id) @@ -362,11 +362,11 @@ def materialize_asset( ) if (dag_id := next(dag_id_it, None)) is None: - raise HTTPException(status.HTTP_404_NOT_FOUND, f"No DAG materializes asset with ID: {asset_id}") + raise HTTPException(status.HTTP_404_NOT_FOUND, f"No Dag materializes asset with ID: {asset_id}") if next(dag_id_it, None) is not None: raise HTTPException( status.HTTP_409_CONFLICT, - f"More than one DAG materializes asset with ID: {asset_id}", + f"More than one Dag materializes asset with ID: {asset_id}", ) dag = get_latest_version_of_dag(dag_bag, dag_id, session) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_parsing.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_parsing.py index fe2b80e8c1133..29c1dfa8d86c7 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_parsing.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_parsing.py @@ -35,7 +35,7 @@ if TYPE_CHECKING: from airflow.api_fastapi.auth.managers.models.batch_apis import IsAuthorizedDagRequest -dag_parsing_router = AirflowRouter(tags=["DAG Parsing"], prefix="/parseDagFile/{file_token}") +dag_parsing_router = AirflowRouter(tags=["Dag Parsing"], prefix="/parseDagFile/{file_token}") @dag_parsing_router.put( @@ -49,7 +49,7 @@ def reparse_dag_file( session: SessionDep, request: Request, ) -> None: - """Request re-parsing a DAG file.""" + """Request re-parsing a Dag file.""" secret_key = request.app.state.secret_key auth_s = URLSafeSerializer(secret_key) try: diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_report.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_report.py index 42539015b53d1..d970c50e506ef 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_report.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_report.py @@ -52,7 +52,7 @@ def get_dag_reports( subdir: str, readable_dags_filter: ReadableDagsFilterDep, ): - """Get DAG report.""" + """Get Dag report.""" fullpath = os.path.normpath(subdir) if not fullpath.startswith(settings.DAGS_FOLDER): raise HTTPException(status.HTTP_400_BAD_REQUEST, "subdir should be subpath of DAGS_FOLDER settings") diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py index 833b927df1389..9f672d850958a 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py @@ -125,7 +125,7 @@ def get_dag_run(dag_id: str, dag_run_id: str, session: SessionDep) -> DAGRunResp ], ) def delete_dag_run(dag_id: str, dag_run_id: str, session: SessionDep): - """Delete a DAG Run entry.""" + """Delete a Dag Run entry.""" dag_run = session.scalar(select(DagRun).filter_by(dag_id=dag_id, run_id=dag_run_id)) if dag_run is None: @@ -158,7 +158,7 @@ def patch_dag_run( user: GetUserDep, update_mask: list[str] | None = Query(None), ) -> DAGRunResponse: - """Modify a DAG Run.""" + """Modify a Dag Run.""" dag_run = session.scalar( select(DagRun).filter_by(dag_id=dag_id, run_id=dag_run_id).options(joinedload(DagRun.dag_model)) ) @@ -350,14 +350,14 @@ def get_dag_runs( ], ) -> DAGRunCollectionResponse: """ - Get all DAG Runs. + Get all Dag Runs. - This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs. + This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all Dags. """ query = select(DagRun) if dag_id != "~": - get_latest_version_of_dag(dag_bag, dag_id, session) # Check if the DAG exists. + get_latest_version_of_dag(dag_bag, dag_id, session) # Check if the Dag exists. query = query.filter(DagRun.dag_id == dag_id).options(joinedload(DagRun.dag_model)) dag_run_select, total_entries = paginated_select( @@ -411,12 +411,12 @@ def trigger_dag_run( """Trigger a DAG.""" dm = session.scalar(select(DagModel).where(~DagModel.is_stale, DagModel.dag_id == dag_id).limit(1)) if not dm: - raise HTTPException(status.HTTP_404_NOT_FOUND, f"DAG with dag_id: '{dag_id}' not found") + raise HTTPException(status.HTTP_404_NOT_FOUND, f"Dag with dag_id: '{dag_id}' not found") if dm.has_import_errors: raise HTTPException( status.HTTP_400_BAD_REQUEST, - f"DAG with dag_id: '{dag_id}' has import errors and cannot be triggered", + f"Dag with dag_id: '{dag_id}' has import errors and cannot be triggered", ) try: @@ -509,7 +509,7 @@ def get_list_dag_runs_batch( readable_dag_runs_filter: ReadableDagRunsFilterDep, session: SessionDep, ) -> DAGRunCollectionResponse: - """Get a list of DAG Runs.""" + """Get a list of Dag Runs.""" dag_ids = FilterParam(DagRun.dag_id, body.dag_ids, FilterOptionEnum.IN) logical_date = RangeFilter( Range( diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_sources.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_sources.py index c44fe9740a1af..26920007672ad 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_sources.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_sources.py @@ -62,7 +62,7 @@ def get_dag_source( if not dag_version: raise HTTPException( status.HTTP_404_NOT_FOUND, - f"The source code of the DAG {dag_id}, version_number {version_number} was not found", + f"The source code of the Dag {dag_id}, version_number {version_number} was not found", ) if not dag_version.dag_code: raise HTTPException( diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py index b02b9be31ecbb..0a9adf85c0deb 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_tags.py @@ -57,7 +57,7 @@ def get_dag_tags( readable_tags_filter: ReadableTagsFilterDep, session: SessionDep, ) -> DAGTagCollectionResponse: - """Get all DAG tags.""" + """Get all Dag tags.""" query = select(DagTag.name).group_by(DagTag.name) dag_tags_select, total_entries = paginated_select( statement=query, diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_versions.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_versions.py index e4f282f60880b..7c91c6b63b7be 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_versions.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_versions.py @@ -104,9 +104,9 @@ def get_dag_versions( dag_bag: DagBagDep, ) -> DAGVersionCollectionResponse: """ - Get all DAG Versions. + Get all Dag Versions. - This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions for all DAGs. + This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions for all Dags. """ query = select(DagVersion).options(joinedload(DagVersion.dag_model)) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_warning.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_warning.py index 3884a165e9978..c1a652c370f74 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_warning.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_warning.py @@ -64,7 +64,7 @@ def list_dag_warnings( readable_dag_warning_filter: ReadableDagWarningsFilterDep, session: SessionDep, ) -> DAGWarningCollectionResponse: - """Get a list of DAG warnings.""" + """Get a list of Dag warnings.""" dag_warnings_select, total_entries = paginated_select( statement=select(DagWarning).options(joinedload(DagWarning.dag_model)), filters=[warning_type, dag_id, readable_dag_warning_filter], 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 87260dee00e86..2675fa734c2cf 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 @@ -126,7 +126,7 @@ def get_dags( session: SessionDep, is_favorite: QueryFavoriteFilter, ) -> DAGCollectionResponse: - """Get all DAGs.""" + """Get all Dags.""" query = generate_dag_with_latest_run_query( max_run_filters=[ dag_run_start_date_range, @@ -287,7 +287,7 @@ def patch_dags( session: SessionDep, update_mask: list[str] | None = Query(None), ) -> DAGCollectionResponse: - """Patch multiple DAGs.""" + """Patch multiple Dags.""" if update_mask: if update_mask != ["is_paused"]: raise HTTPException( @@ -336,10 +336,10 @@ def patch_dags( dependencies=[Depends(requires_access_dag(method="GET")), Depends(action_logging())], ) def favorite_dag(dag_id: str, session: SessionDep, user: GetUserDep): - """Mark the DAG as favorite.""" + """Mark the Dag as favorite.""" dag = session.get(DagModel, dag_id) if not dag: - raise HTTPException(status.HTTP_404_NOT_FOUND, detail=f"DAG with id '{dag_id}' not found") + raise HTTPException(status.HTTP_404_NOT_FOUND, detail=f"Dag with id '{dag_id}' not found") user_id = str(user.get_id()) session.execute(insert(DagFavorite).values(dag_id=dag_id, user_id=user_id)) @@ -352,10 +352,10 @@ def favorite_dag(dag_id: str, session: SessionDep, user: GetUserDep): dependencies=[Depends(requires_access_dag(method="GET")), Depends(action_logging())], ) def unfavorite_dag(dag_id: str, session: SessionDep, user: GetUserDep): - """Unmark the DAG as favorite.""" + """Unmark the Dag as favorite.""" dag = session.get(DagModel, dag_id) if not dag: - raise HTTPException(status.HTTP_404_NOT_FOUND, detail=f"DAG with id '{dag_id}' not found") + raise HTTPException(status.HTTP_404_NOT_FOUND, detail=f"Dag with id '{dag_id}' not found") user_id = str(user.get_id()) @@ -367,7 +367,7 @@ def unfavorite_dag(dag_id: str, session: SessionDep, user: GetUserDep): ).first() if not favorite_exists: - raise HTTPException(status.HTTP_409_CONFLICT, detail="DAG is not marked as favorite") + raise HTTPException(status.HTTP_409_CONFLICT, detail="Dag is not marked as favorite") session.execute( delete(DagFavorite).where( diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/import_error.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/import_error.py index a989a7eef168c..a07615c3788c3 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/import_error.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/import_error.py @@ -52,7 +52,7 @@ from airflow.models import DagModel from airflow.models.errors import ParseImportError -REDACTED_STACKTRACE = "REDACTED - you do not have read permission on all DAGs in the file" +REDACTED_STACKTRACE = "REDACTED - you do not have read permission on all Dags in the file" import_error_router = AirflowRouter(tags=["Import Error"], prefix="/importErrors") @@ -80,7 +80,7 @@ def get_import_error( auth_manager = get_auth_manager() can_read_all_dags = auth_manager.is_authorized_dag(method="GET", user=user) if can_read_all_dags: - # Early return if the user has access to all DAGs + # Early return if the user has access to all Dags return error readable_dag_ids = auth_manager.get_authorized_dag_ids(user=user) @@ -88,14 +88,14 @@ def get_import_error( file_dag_ids = set( session.scalars(select(DagModel.dag_id).where(DagModel.fileloc == error.filename)).all() ) - # Can the user read any DAGs in the file? + # Can the user read any Dags in the file? if not readable_dag_ids.intersection(file_dag_ids): raise HTTPException( status.HTTP_403_FORBIDDEN, - "You do not have read permission on any of the DAGs in the file", + "You do not have read permission on any of the Dags in the file", ) - # Check if user has read access to all the DAGs defined in the file + # Check if user has read access to all the Dags defined in the file if not file_dag_ids.issubset(readable_dag_ids): error.stacktrace = REDACTED_STACKTRACE return error @@ -141,14 +141,14 @@ def get_import_errors( auth_manager = get_auth_manager() can_read_all_dags = auth_manager.is_authorized_dag(method="GET", user=user) if can_read_all_dags: - # Early return if the user has access to all DAGs + # Early return if the user has access to all Dags import_errors = session.scalars(import_errors_select).all() return ImportErrorCollectionResponse( import_errors=import_errors, total_entries=total_entries, ) - # if the user doesn't have access to all DAGs, only display errors from visible DAGs + # if the user doesn't have access to all Dags, only display errors from visible Dags readable_dag_ids = auth_manager.get_authorized_dag_ids(method="GET", user=user) # Build a cte that fetches dag_ids for each file location visible_files_cte = ( @@ -185,7 +185,7 @@ def get_import_errors( import_errors = [] for import_error, file_dag_ids in import_errors_result: - # Check if user has read access to all the DAGs defined in the file + # Check if user has read access to all the Dags defined in the file requests: Sequence[IsAuthorizedDagRequest] = [ { "method": "GET", diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py index eabf620c41be0..46e4600ab7821 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py @@ -449,8 +449,8 @@ def get_task_instances( """ Get list of task instances. - This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all DAGs - and DAG runs. + This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all Dags + and Dag runs. """ dag_run = None query = ( diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py index 2cdb89fcc88d9..9283cddd3774f 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py @@ -155,7 +155,7 @@ def get_xcom_entries( """ Get all XCom entries. - This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. + This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all Dags. """ query = select(XComModel) if dag_id != "~": @@ -224,7 +224,7 @@ def create_xcom_entry( from airflow.models.dagrun import DagRun dag_run = session.scalar(select(DagRun).where(DagRun.dag_id == dag_id, DagRun.run_id == dag_run_id)) - # Validate DAG ID + # Validate Dag ID dag = get_dag_for_run_or_latest_version(dag_bag, dag_run, dag_id, session) # Validate Task ID @@ -235,7 +235,7 @@ def create_xcom_entry( status.HTTP_404_NOT_FOUND, f"Task with ID: `{task_id}` not found in dag: `{dag_id}`" ) - # Validate DAG Run ID + # Validate Dag Run ID if not dag_run: if not dag_run: raise HTTPException( diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/calendar.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/calendar.py index 10a86b2b7c92c..c0a1b29ba0b7f 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/calendar.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/calendar.py @@ -57,7 +57,7 @@ def get_calendar( logical_date: Annotated[RangeFilter, Depends(datetime_range_filter_factory("logical_date", DagRun))], granularity: Literal["hourly", "daily"] = "daily", ) -> CalendarTimeRangeCollectionResponse: - """Get calendar data for a DAG including historical and planned DAG runs.""" + """Get calendar data for a Dag including historical and planned Dag runs.""" dag = get_latest_version_of_dag(dag_bag, dag_id, session) calendar_service = CalendarService() diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py index 7c580e421815f..ecfb37502e8d9 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py @@ -109,8 +109,8 @@ def get_dags( session: SessionDep, dag_runs_limit: int = 10, ) -> DAGWithLatestDagRunsCollectionResponse: - """Get DAGs with recent DagRun.""" - # Fetch DAGs with their latest DagRun and apply filters + """Get Dags with recent DagRun.""" + # Fetch Dags with their latest DagRun and apply filters query = generate_dag_with_latest_run_query( max_run_filters=[ last_dag_run_state, diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dashboard.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dashboard.py index dbbada8cf39c7..063a4e420ec79 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dashboard.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dashboard.py @@ -117,7 +117,7 @@ def dag_stats( session: SessionDep, readable_dags_filter: ReadableDagsFilterDep, ) -> DashboardDagStatsResponse: - """Return basic DAG stats with counts of DAGs in various states.""" + """Return basic Dag stats with counts of Dags in various states.""" permitted_dag_ids = readable_dags_filter.value latest_dates_subq = ( select(DagRun.dag_id, func.max(DagRun.logical_date).label("max_logical_date")) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py index 0f9f4023cbc55..820e2557a19b9 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py @@ -123,9 +123,9 @@ def get_dag_structure( latest_serdag = _get_latest_serdag(dag_id, session) latest_dag = latest_serdag.dag - # Retrieve, sort the previous DAG Runs + # Retrieve, sort the previous Dag Runs base_query = select(DagRun.id).where(DagRun.dag_id == dag_id) - # This comparison is to fall back to DAG timetable when no order_by is provided + # This comparison is to fall back to Dag timetable when no order_by is provided if order_by.value == [order_by.get_primary_key_string()]: ordering = list(latest_dag.timetable.run_ordering) order_by = SortParam( @@ -216,7 +216,7 @@ def get_grid_runs( run_after: Annotated[RangeFilter, Depends(datetime_range_filter_factory("run_after", DagRun))], ) -> list[GridRunsResponse]: """Get info about a run for the grid.""" - # Retrieve, sort the previous DAG Runs + # Retrieve, sort the previous Dag Runs base_query = select( DagRun.dag_id, DagRun.run_id, @@ -228,7 +228,7 @@ def get_grid_runs( DagRun.run_type, ).where(DagRun.dag_id == dag_id) - # This comparison is to fall back to DAG timetable when no order_by is provided + # This comparison is to fall back to Dag timetable when no order_by is provided if order_by.value == [order_by.get_primary_key_string()]: latest_serdag = _get_latest_serdag(dag_id, session) latest_dag = latest_serdag.dag diff --git a/airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py b/airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py index 4f68b808b7cf8..bae49bc885799 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py @@ -58,7 +58,7 @@ def _patch_ti_validate_request( ) -> tuple[DAG, list[TI], dict]: dag = get_latest_version_of_dag(dag_bag, dag_id, session) if not dag.has_task(task_id): - raise HTTPException(status.HTTP_404_NOT_FOUND, f"Task '{task_id}' not found in DAG '{dag_id}'") + raise HTTPException(status.HTTP_404_NOT_FOUND, f"Task '{task_id}' not found in Dag '{dag_id}'") query = ( select(TI) diff --git a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py index 8562d305406ac..d11394bdb3cc9 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py @@ -57,12 +57,12 @@ def get_calendar_data( granularity: Literal["hourly", "daily"] = "daily", ) -> CalendarTimeRangeCollectionResponse: """ - Get calendar data for a DAG including historical and planned runs. + Get calendar data for a Dag including historical and planned runs. Args: - dag_id: The DAG ID + dag_id: The Dag ID session: Database session - dag: The DAG object + dag: The Dag object logical_date: Date range filter granularity: Time granularity ("hourly" or "daily") @@ -91,7 +91,7 @@ def _get_historical_dag_runs( logical_date: RangeFilter, granularity: Literal["hourly", "daily"], ) -> tuple[list[CalendarTimeRangeResponse], list[Row]]: - """Get historical DAG runs from the database.""" + """Get historical Dag runs from the database.""" dialect = session.bind.dialect.name time_expression = self._get_time_truncation_expression(DagRun.logical_date, granularity, dialect) @@ -131,7 +131,7 @@ def _get_planned_dag_runs( logical_date: RangeFilter, granularity: Literal["hourly", "daily"], ) -> list[CalendarTimeRangeResponse]: - """Get planned DAG runs based on the DAG's timetable.""" + """Get planned Dag runs based on the DAG's timetable.""" if not self._should_calculate_planned_runs(dag, raw_dag_states): return [] @@ -226,7 +226,7 @@ def _calculate_timetable_planned_runs( restriction=restriction, ) - if curr_info is None: # No more DAG runs to schedule + if curr_info is None: # No more Dag runs to schedule break if curr_info.logical_date <= prev_logical_date: # Timetable not progressing, stopping break diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/dagrun.py b/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/dagrun.py index 1f73156cebf5a..a81a835306da1 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/dagrun.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/dagrun.py @@ -25,7 +25,7 @@ class TriggerDAGRunPayload(StrictBaseModel): - """Schema for Trigger DAG Run API request.""" + """Schema for Trigger Dag Run API request.""" logical_date: UtcDateTime | None = None conf: dict = Field(default_factory=dict) @@ -33,6 +33,6 @@ class TriggerDAGRunPayload(StrictBaseModel): class DagRunStateResponse(BaseModel): - """Schema for DAG Run State response.""" + """Schema for Dag Run State response.""" state: DagRunState diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py b/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py index 7fa329e0f32b5..94da650d15319 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py @@ -285,7 +285,7 @@ class DagRun(StrictBaseModel): # TODO: `dag_id` and `run_id` are duplicated from TaskInstance # See if we can avoid sending these fields from API server and instead - # use the TaskInstance data to get the DAG run information in the client (Task Execution Interface). + # use the TaskInstance data to get the Dag run information in the client (Task Execution Interface). dag_id: str run_id: str @@ -306,7 +306,7 @@ class TIRunContext(BaseModel): """Response schema for TaskInstance run context.""" dag_run: DagRun - """DAG run information for the task instance.""" + """Dag run information for the task instance.""" task_reschedule_count: int = 0 """How many times the task has been rescheduled.""" diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py b/airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py index 22237ee5e28cd..ef773b450455c 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/dag_runs.py @@ -45,9 +45,9 @@ "/{dag_id}/{run_id}", status_code=status.HTTP_204_NO_CONTENT, responses={ - status.HTTP_400_BAD_REQUEST: {"description": "DAG has import errors and cannot be triggered"}, - status.HTTP_404_NOT_FOUND: {"description": "DAG not found for the given dag_id"}, - status.HTTP_409_CONFLICT: {"description": "DAG Run already exists for the given dag_id"}, + status.HTTP_400_BAD_REQUEST: {"description": "Dag has import errors and cannot be triggered"}, + status.HTTP_404_NOT_FOUND: {"description": "Dag not found for the given dag_id"}, + status.HTTP_409_CONFLICT: {"description": "Dag Run already exists for the given dag_id"}, status.HTTP_422_UNPROCESSABLE_ENTITY: {"description": "Invalid payload"}, }, ) @@ -57,12 +57,12 @@ def trigger_dag_run( payload: TriggerDAGRunPayload, session: SessionDep, ): - """Trigger a DAG Run.""" + """Trigger a Dag Run.""" dm = session.scalar(select(DagModel).where(~DagModel.is_stale, DagModel.dag_id == dag_id).limit(1)) if not dm: raise HTTPException( status.HTTP_404_NOT_FOUND, - detail={"reason": "not_found", "message": f"DAG with dag_id: '{dag_id}' not found"}, + detail={"reason": "not_found", "message": f"Dag with dag_id: '{dag_id}' not found"}, ) if dm.has_import_errors: @@ -70,7 +70,7 @@ def trigger_dag_run( status.HTTP_400_BAD_REQUEST, detail={ "reason": "import_errors", - "message": f"DAG with dag_id: '{dag_id}' has import errors and cannot be triggered", + "message": f"Dag with dag_id: '{dag_id}' has import errors and cannot be triggered", }, ) @@ -89,7 +89,7 @@ def trigger_dag_run( status.HTTP_409_CONFLICT, detail={ "reason": "already_exists", - "message": f"A DAG Run already exists for DAG {dag_id} with run id {run_id}", + "message": f"A Dag Run already exists for Dag {dag_id} with run id {run_id}", }, ) @@ -98,8 +98,8 @@ def trigger_dag_run( "/{dag_id}/{run_id}/clear", status_code=status.HTTP_204_NO_CONTENT, responses={ - status.HTTP_400_BAD_REQUEST: {"description": "DAG has import errors and cannot be triggered"}, - status.HTTP_404_NOT_FOUND: {"description": "DAG not found for the given dag_id"}, + status.HTTP_400_BAD_REQUEST: {"description": "Dag has import errors and cannot be triggered"}, + status.HTTP_404_NOT_FOUND: {"description": "Dag not found for the given dag_id"}, status.HTTP_422_UNPROCESSABLE_ENTITY: {"description": "Invalid payload"}, }, ) @@ -109,12 +109,12 @@ def clear_dag_run( session: SessionDep, dag_bag: DagBagDep, ): - """Clear a DAG Run.""" + """Clear a Dag Run.""" dm = session.scalar(select(DagModel).where(~DagModel.is_stale, DagModel.dag_id == dag_id).limit(1)) if not dm: raise HTTPException( status.HTTP_404_NOT_FOUND, - detail={"reason": "not_found", "message": f"DAG with dag_id: '{dag_id}' not found"}, + detail={"reason": "not_found", "message": f"Dag with dag_id: '{dag_id}' not found"}, ) if dm.has_import_errors: @@ -122,7 +122,7 @@ def clear_dag_run( status.HTTP_400_BAD_REQUEST, detail={ "reason": "import_errors", - "message": f"DAG with dag_id: '{dag_id}' has import errors and cannot be triggered", + "message": f"Dag with dag_id: '{dag_id}' has import errors and cannot be triggered", }, ) @@ -137,7 +137,7 @@ def clear_dag_run( @router.get( "/{dag_id}/{run_id}/state", responses={ - status.HTTP_404_NOT_FOUND: {"description": "DAG not found for the given dag_id"}, + status.HTTP_404_NOT_FOUND: {"description": "Dag not found for the given dag_id"}, }, ) def get_dagrun_state( @@ -145,7 +145,7 @@ def get_dagrun_state( run_id: str, session: SessionDep, ) -> DagRunStateResponse: - """Get a DAG Run State.""" + """Get a Dag Run State.""" dag_run = session.scalar( select(DagRunModel).where(DagRunModel.dag_id == dag_id, DagRunModel.run_id == run_id) ) @@ -169,7 +169,7 @@ def get_dr_count( run_ids: Annotated[list[str] | None, Query()] = None, states: Annotated[list[str] | None, Query()] = None, ) -> int: - """Get the count of DAG runs matching the given criteria.""" + """Get the count of Dag runs matching the given criteria.""" query = select(func.count()).select_from(DagRunModel).where(DagRunModel.dag_id == dag_id) if logical_dates: @@ -192,7 +192,7 @@ def get_previous_dagrun( session: SessionDep, state: Annotated[DagRunState | None, Query()] = None, ) -> DagRun | None: - """Get the previous DAG run before the given logical date, optionally filtered by state.""" + """Get the previous Dag run before the given logical date, optionally filtered by state.""" query = ( select(DagRunModel) .where( diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py b/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py index 3892cf8d42967..3c66340f6a76c 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py @@ -472,7 +472,7 @@ def _create_ti_state_update_query_and_update_state( session.flush() # TODO: HANDLE execution timeout later as it requires a call to the DB - # either get it from the serialised DAG or get it from the API + # either get it from the serialised Dag or get it from the API query = update(TI).where(TI.id == ti_id_str) @@ -557,7 +557,7 @@ def ti_skip_downstream( tasks = ti_patch_payload.tasks dag_id, run_id = session.execute(select(TI.dag_id, TI.run_id).where(TI.id == ti_id_str)).fetchone() - log.debug("Retrieved DAG and run info", dag_id=dag_id, run_id=run_id) + log.debug("Retrieved Dag and run info", dag_id=dag_id, run_id=run_id) task_ids = [task if isinstance(task, tuple) else (task, -1) for task in tasks] log.debug("Prepared task IDs for skipping", task_ids=task_ids) @@ -700,7 +700,7 @@ def get_previous_successful_dagrun( """ ti_id_str = str(task_instance_id) bind_contextvars(ti_id=ti_id_str) - log.debug("Retrieving previous successful DAG run") + log.debug("Retrieving previous successful Dag run") task_instance = session.scalar(select(TI).where(TI.id == ti_id_str)) if not task_instance or not task_instance.logical_date: @@ -718,11 +718,11 @@ def get_previous_successful_dagrun( .limit(1) ) if not dag_run: - log.debug("No previous successful DAG run found") + log.debug("No previous successful Dag run found") return PrevSuccessfulDagRunResponse() log.debug( - "Found previous successful DAG run", + "Found previous successful Dag run", dag_id=dag_run.dag_id, run_id=dag_run.run_id, logical_date=dag_run.logical_date, @@ -858,7 +858,7 @@ def _get_group_tasks( status.HTTP_404_NOT_FOUND, detail={ "reason": "not_found", - "message": f"Task group {task_group_id} not found in DAG {dag_id}", + "message": f"Task group {task_group_id} not found in Dag {dag_id}", }, ) diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py b/airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py index 576f6c4e0dc72..1786c48a35a9c 100644 --- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py +++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py @@ -172,12 +172,12 @@ def get_xcom( if params.offset is None: message = ( f"XCom with {key=} map_index={params.map_index} not found for " - f"task {task_id!r} in DAG run {run_id!r} of {dag_id!r}" + f"task {task_id!r} in Dag run {run_id!r} of {dag_id!r}" ) else: message = ( f"XCom with {key=} offset={params.offset} not found for " - f"task {task_id!r} in DAG run {run_id!r} of {dag_id!r}" + f"task {task_id!r} in Dag run {run_id!r} of {dag_id!r}" ) raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, @@ -214,7 +214,7 @@ def get_mapped_xcom_by_index( if (result := xcom_query.limit(1).first()) is None: message = ( - f"XCom with {key=} {offset=} not found for task {task_id!r} in DAG run {run_id!r} of {dag_id!r}" + f"XCom with {key=} {offset=} not found for task {task_id!r} in Dag run {run_id!r} of {dag_id!r}" ) raise HTTPException( status_code=status.HTTP_404_NOT_FOUND, @@ -397,7 +397,7 @@ def set_xcom( dag_run_id = session.query(DagRun.id).filter_by(dag_id=dag_id, run_id=run_id).scalar() if dag_run_id is None: - raise HTTPException(status.HTTP_404_NOT_FOUND, f"DAG run not found on DAG {dag_id} with ID {run_id}") + raise HTTPException(status.HTTP_404_NOT_FOUND, f"Dag run not found on Dag {dag_id} with ID {run_id}") # Remove duplicate XComs and insert a new one. session.execute( diff --git a/airflow-core/src/airflow/callbacks/callback_requests.py b/airflow-core/src/airflow/callbacks/callback_requests.py index 611f9ac7b4d7f..5c6cca2bd780f 100644 --- a/airflow-core/src/airflow/callbacks/callback_requests.py +++ b/airflow-core/src/airflow/callbacks/callback_requests.py @@ -85,7 +85,7 @@ class DagRunContext(BaseModel): class DagCallbackRequest(BaseCallbackRequest): - """A Class with information about the success/failure DAG callback to be executed.""" + """A Class with information about the success/failure Dag callback to be executed.""" dag_id: str run_id: str diff --git a/airflow-core/src/airflow/cli/cli_config.py b/airflow-core/src/airflow/cli/cli_config.py index 5c8497ead6e4f..ca258338b86fd 100644 --- a/airflow-core/src/airflow/cli/cli_config.py +++ b/airflow-core/src/airflow/cli/cli_config.py @@ -146,15 +146,15 @@ def string_lower_type(val): ARG_TASK_ID = Arg(("task_id",), help="The id of the task") ARG_LOGICAL_DATE = Arg(("-l", "--logical-date"), help="The logical date of the DAG", type=parsedate) ARG_LOGICAL_DATE_OPTIONAL = Arg( - ("logical_date",), nargs="?", help="The logical date of the DAG (optional)", type=parsedate + ("logical_date",), nargs="?", help="The logical date of the Dag (optional)", type=parsedate ) ARG_LOGICAL_DATE_OR_RUN_ID = Arg( - ("logical_date_or_run_id",), help="The logical date of the DAG or run_id of the DAGRun" + ("logical_date_or_run_id",), help="The logical date of the Dag or run_id of the DAGRun" ) ARG_LOGICAL_DATE_OR_RUN_ID_OPTIONAL = Arg( ("logical_date_or_run_id",), nargs="?", - help="The logical date of the DAG or run_id of the DAGRun (optional)", + help="The logical date of the Dag or run_id of the DAGRun (optional)", ) ARG_TASK_REGEX = Arg(("-t", "--task-regex"), help="The regex to filter specific task_ids (optional)") ARG_BUNDLE_NAME = Arg( @@ -162,7 +162,7 @@ def string_lower_type(val): "-B", "--bundle-name", ), - help=("The name of the DAG bundle to use; may be provided more than once"), + help=("The name of the Dag bundle to use; may be provided more than once"), type=str, default=None, action="append", @@ -233,7 +233,7 @@ def string_lower_type(val): ARG_LIST_LOCAL = Arg( ("-l", "--local"), action="store_true", - help="Shows local parsed DAGs and their import errors, ignores content serialized in DB", + help="Shows local parsed Dags and their import errors, ignores content serialized in DB", ) # list_dag_runs @@ -243,7 +243,7 @@ def string_lower_type(val): dagrun_states = tuple(state.value for state in DagRunState) ARG_DR_STATE = Arg( ("--state",), - help="Only list the DAG runs corresponding to the state", + help="Only list the Dag runs corresponding to the state", metavar=", ".join(dagrun_states), choices=dagrun_states, ) @@ -369,7 +369,7 @@ def string_lower_type(val): ARG_SHOW_DAGRUN = Arg( ("--show-dagrun",), help=( - "After completing the backfill, shows the diagram for current DAG Run.\n" + "After completing the backfill, shows the diagram for current Dag Run.\n" "\n" "The diagram is in DOT language\n" ), @@ -379,17 +379,17 @@ def string_lower_type(val): ("--imgcat-dagrun",), help=( "After completing the dag run, prints a diagram on the screen for the " - "current DAG Run using the imgcat tool.\n" + "current Dag Run using the imgcat tool.\n" ), action="store_true", ) ARG_SAVE_DAGRUN = Arg( ("--save-dagrun",), - help="After completing the backfill, saves the diagram for current DAG Run to the indicated file.\n\n", + help="After completing the backfill, saves the diagram for current Dag Run to the indicated file.\n\n", ) ARG_USE_EXECUTOR = Arg( ("--use-executor",), - help="Use an executor to test the DAG. By default it runs the DAG without an executor. " + help="Use an executor to test the DAG. By default it runs the Dag without an executor. " "If set, it uses the executor configured in the environment.", action="store_true", ) @@ -967,7 +967,7 @@ class GroupCommand(NamedTuple): ActionCommand( name="create", help="Create a backfill for a dag.", - description="Run subsections of a DAG for a specified date range.", + description="Run subsections of a Dag for a specified date range.", func=lazy_load_command("airflow.cli.commands.backfill_command.create_backfill"), args=( ARG_BACKFILL_DAG, @@ -985,19 +985,19 @@ class GroupCommand(NamedTuple): DAGS_COMMANDS = ( ActionCommand( name="details", - help="Get DAG details given a DAG id", + help="Get Dag details given a Dag id", func=lazy_load_command("airflow.cli.commands.dag_command.dag_details"), args=(ARG_DAG_ID, ARG_OUTPUT, ARG_VERBOSE), ), ActionCommand( name="list", - help="List all the DAGs", + help="List all the Dags", func=lazy_load_command("airflow.cli.commands.dag_command.dag_list_dags"), args=(ARG_OUTPUT, ARG_VERBOSE, ARG_DAG_LIST_COLUMNS, ARG_BUNDLE_NAME, ARG_LIST_LOCAL), ), ActionCommand( name="list-import-errors", - help="List all the DAGs that have import errors", + help="List all the Dags that have import errors", func=lazy_load_command("airflow.cli.commands.dag_command.dag_list_import_errors"), args=(ARG_BUNDLE_NAME, ARG_OUTPUT, ARG_VERBOSE, ARG_LIST_LOCAL), ), @@ -1009,9 +1009,9 @@ class GroupCommand(NamedTuple): ), ActionCommand( name="list-runs", - help="List DAG runs given a DAG id", + help="List Dag runs given a Dag id", description=( - "List DAG runs given a DAG id. If state option is given, it will only search for all the " + "List Dag runs given a Dag id. If state option is given, it will only search for all the " "dagruns with the given state. If no_backfill option is given, it will filter out all " "backfill dagruns for given dag id. If start_date is given, it will filter out all the " "dagruns that were executed before this date. If end_date is given, it will filter out " @@ -1054,8 +1054,8 @@ class GroupCommand(NamedTuple): name="pause", help="Pause DAG(s)", description=( - "Pause one or more DAGs. This command allows to halt the execution of specified DAGs, " - "disabling further task scheduling. Use `--treat-dag-id-as-regex` to target multiple DAGs by " + "Pause one or more Dags. This command allows to halt the execution of specified Dags, " + "disabling further task scheduling. Use `--treat-dag-id-as-regex` to target multiple Dags by " "treating the `--dag-id` as a regex pattern." ), func=lazy_load_command("airflow.cli.commands.dag_command.dag_pause"), @@ -1065,8 +1065,8 @@ class GroupCommand(NamedTuple): name="unpause", help="Resume paused DAG(s)", description=( - "Resume one or more DAGs. This command allows to restore the execution of specified " - "DAGs, enabling further task scheduling. Use `--treat-dag-id-as-regex` to target multiple DAGs " + "Resume one or more Dags. This command allows to restore the execution of specified " + "Dags, enabling further task scheduling. Use `--treat-dag-id-as-regex` to target multiple Dags " "treating the `--dag-id` as a regex pattern." ), func=lazy_load_command("airflow.cli.commands.dag_command.dag_unpause"), @@ -1075,7 +1075,7 @@ class GroupCommand(NamedTuple): ActionCommand( name="trigger", help=( - "Trigger a new DAG run. If DAG is paused then dagrun state will remain queued, " + "Trigger a new Dag run. If Dag is paused then dagrun state will remain queued, " "and the task won't run." ), func=lazy_load_command("airflow.cli.commands.dag_command.dag_trigger"), @@ -1120,7 +1120,7 @@ class GroupCommand(NamedTuple): ), ActionCommand( name="show-dependencies", - help="Displays DAGs with their dependencies", + help="Displays Dags with their dependencies", description=( "The --imgcat option only works in iTerm.\n" "\n" @@ -1149,16 +1149,16 @@ class GroupCommand(NamedTuple): name="test", help="Execute one single DagRun", description=( - "Execute one single DagRun for a given DAG and logical date.\n" + "Execute one single DagRun for a given Dag and logical date.\n" "\n" - "You can test a DAG in three ways:\n" + "You can test a Dag in three ways:\n" "1. Using default bundle:\n" " airflow dags test \n" "\n" - "2. Using a specific bundle if multiple DAG bundles are configured:\n" + "2. Using a specific bundle if multiple Dag bundles are configured:\n" " airflow dags test --bundle-name (or -B )\n" "\n" - "3. Using a specific DAG file:\n" + "3. Using a specific Dag file:\n" " airflow dags test --dagfile-path (or -f )\n" "\n" "The --imgcat-dagrun option only works in iTerm.\n" @@ -1166,7 +1166,7 @@ class GroupCommand(NamedTuple): "For more information, see: https://www.iterm2.com/documentation-images.html\n" "\n" "If --save-dagrun is used, then, after completing the backfill, saves the diagram " - "for current DAG Run to the indicated file.\n" + "for current Dag Run to the indicated file.\n" "The file format is determined by the file extension. " "For more information about supported format, " "see: https://www.graphviz.org/doc/info/output.html\n" @@ -1194,10 +1194,10 @@ class GroupCommand(NamedTuple): ), ActionCommand( name="reserialize", - help="Reserialize DAGs by parsing the DagBag files", + help="Reserialize Dags by parsing the DagBag files", description=( - "Reserialize DAGs in the metadata DB. This can be " - "particularly useful if your serialized DAGs become out of sync with the Airflow " + "Reserialize Dags in the metadata DB. This can be " + "particularly useful if your serialized Dags become out of sync with the Airflow " "version you are using." ), func=lazy_load_command("airflow.cli.commands.dag_command.dag_reserialize"), @@ -1807,7 +1807,7 @@ class GroupCommand(NamedTuple): core_commands: list[CLICommand] = [ GroupCommand( name="dags", - help="Manage DAGs", + help="Manage Dags", subcommands=DAGS_COMMANDS, ), GroupCommand( @@ -2010,7 +2010,7 @@ def _remove_dag_id_opt(command: ActionCommand): dag_cli_commands: list[CLICommand] = [ GroupCommand( name="dags", - help="Manage DAGs", + help="Manage Dags", subcommands=[ _remove_dag_id_opt(sp) for sp in DAGS_COMMANDS diff --git a/airflow-core/src/airflow/cli/commands/asset_command.py b/airflow-core/src/airflow/cli/commands/asset_command.py index 3b4685a0d1bf2..00ae82fb1fce5 100644 --- a/airflow-core/src/airflow/cli/commands/asset_command.py +++ b/airflow-core/src/airflow/cli/commands/asset_command.py @@ -129,7 +129,7 @@ def asset_materialize(args, *, session: Session = NEW_SESSION) -> None: """ Materialize the specified asset. - This is done by finding the DAG with the asset defined as outlet, and create + This is done by finding the Dag with the asset defined as outlet, and create a run for that DAG. """ if not args.name and not args.uri: @@ -149,7 +149,7 @@ def asset_materialize(args, *, session: Session = NEW_SESSION) -> None: if (dag_id := next(dag_id_it, None)) is None: raise SystemExit(f"Asset with {select_message} does not exist.") if next(dag_id_it, None) is not None: - raise SystemExit(f"More than one DAG materializes asset with {select_message}.") + raise SystemExit(f"More than one Dag materializes asset with {select_message}.") try: user = getuser() diff --git a/airflow-core/src/airflow/cli/commands/backfill_command.py b/airflow-core/src/airflow/cli/commands/backfill_command.py index 444bc35aea34a..6943939294f0b 100644 --- a/airflow-core/src/airflow/cli/commands/backfill_command.py +++ b/airflow-core/src/airflow/cli/commands/backfill_command.py @@ -36,7 +36,7 @@ @cli_utils.action_cli @providers_configuration_loaded def create_backfill(args) -> None: - """Create backfill job or dry run for a DAG or list of DAGs using regex.""" + """Create backfill job or dry run for a Dag or list of Dags using regex.""" logging.basicConfig(level=settings.LOGGING_LEVEL, format=settings.SIMPLE_LOG_FORMAT) signal.signal(signal.SIGTERM, sigint_handler) console = AirflowConsole() diff --git a/airflow-core/src/airflow/cli/commands/config_command.py b/airflow-core/src/airflow/cli/commands/config_command.py index 0c30ce111af65..8c3177b918859 100644 --- a/airflow-core/src/airflow/cli/commands/config_command.py +++ b/airflow-core/src/airflow/cli/commands/config_command.py @@ -647,9 +647,9 @@ def message(self) -> str | None: was_removed=False, new_default="False", suggestion="In Airflow 3.0 the default value for `catchup_by_default` is set to `False`. " - "This means that DAGs without explicit definition of the `catchup` parameter will not " + "This means that Dags without explicit definition of the `catchup` parameter will not " "catchup by default. " - "If your DAGs rely on catchup behavior, not explicitly defined in the DAG definition, " + "If your Dags rely on catchup behavior, not explicitly defined in the Dag definition, " "set this configuration parameter to `True` in the `scheduler` section of your `airflow.cfg` " "to enable the behavior from Airflow 2.x.", ), diff --git a/airflow-core/src/airflow/cli/commands/dag_command.py b/airflow-core/src/airflow/cli/commands/dag_command.py index e1cbb105dda52..c8678f39083cc 100644 --- a/airflow-core/src/airflow/cli/commands/dag_command.py +++ b/airflow-core/src/airflow/cli/commands/dag_command.py @@ -126,7 +126,7 @@ def dag_unpause(args) -> None: @providers_configuration_loaded def set_is_paused(is_paused: bool, args) -> None: - """Set is_paused for DAG by a given dag_id.""" + """Set is_paused for Dag by a given dag_id.""" should_apply = True with create_session() as session: query = select(DagModel) @@ -141,13 +141,13 @@ def set_is_paused(is_paused: bool, args) -> None: matched_dags = session.scalars(query).all() if not matched_dags: - print(f"No {'un' if is_paused else ''}paused DAGs were found") + print(f"No {'un' if is_paused else ''}paused Dags were found") return if not args.yes and args.treat_dag_id_as_regex: dags_ids = [dag.dag_id for dag in matched_dags] question = ( - f"You are about to {'un' if not is_paused else ''}pause {len(dags_ids)} DAGs:\n" + f"You are about to {'un' if not is_paused else ''}pause {len(dags_ids)} Dags:\n" f"{','.join(dags_ids)}" f"\n\nAre you sure? [y/n]" ) @@ -167,7 +167,7 @@ def set_is_paused(is_paused: bool, args) -> None: @providers_configuration_loaded def dag_dependencies_show(args) -> None: - """Display DAG dependencies, save to file or show as imgcat image.""" + """Display Dag dependencies, save to file or show as imgcat image.""" deduplicated_dag_dependencies = { dag_id: list(set(dag_dependencies)) for dag_id, dag_dependencies in SerializedDagModel.get_dag_dependencies().items() @@ -191,7 +191,7 @@ def dag_dependencies_show(args) -> None: @providers_configuration_loaded def dag_show(args) -> None: - """Display DAG or saves its graphic representation to the file.""" + """Display Dag or saves its graphic representation to the file.""" dag = get_dag(bundle_names=None, dag_id=args.dag_id, from_db=True) dot = render_dag(dag) filename = args.save @@ -297,7 +297,7 @@ def dag_state(args, session: Session = NEW_SESSION) -> None: @providers_configuration_loaded def dag_next_execution(args) -> None: """ - Return the next logical datetime of a DAG at the command line. + Return the next logical datetime of a Dag at the command line. >>> airflow dags next-execution tutorial 2018-08-31 10:38:00 @@ -310,13 +310,13 @@ def dag_next_execution(args) -> None: ).one() if last_parsed_dag.get_is_paused(): - print("[INFO] Please be reminded this DAG is PAUSED now.", file=sys.stderr) + print("[INFO] Please be reminded this Dag is PAUSED now.", file=sys.stderr) def print_execution_interval(interval: DataInterval | None): if interval is None: print( "[WARN] No following schedule can be found. " - "This DAG may have schedule interval '@once' or `None`.", + "This Dag may have schedule interval '@once' or `None`.", file=sys.stderr, ) print(None) @@ -399,7 +399,7 @@ def get_dag_detail(dag: DAG) -> dict: return {col: dag_detail[col] for col in cols if col in DAG_DETAIL_FIELDS} def filter_dags_by_bundle(dags: list[DAG], bundle_names: list[str] | None) -> list[DAG]: - """Filter DAGs based on the specified bundle name, if provided.""" + """Filter Dags based on the specified bundle name, if provided.""" if not bundle_names: return dags @@ -421,7 +421,7 @@ def filter_dags_by_bundle(dags: list[DAG], bundle_names: list[str] | None) -> li @providers_configuration_loaded @provide_session def dag_details(args, session: Session = NEW_SESSION): - """Get DAG details given a DAG id.""" + """Get Dag details given a Dag id.""" dag = DagModel.get_dagmodel(args.dag_id, session=session) if not dag: raise SystemExit(f"DAG: {args.dag_id} does not exist in 'dag' table") @@ -598,7 +598,7 @@ def _render_dagrun(dr: DagRun) -> dict[str, str]: @providers_configuration_loaded @provide_session def dag_test(args, dag: DAG | None = None, session: Session = NEW_SESSION) -> None: - """Execute one single DagRun for a given DAG and logical date.""" + """Execute one single DagRun for a given Dag and logical date.""" run_conf = None if args.conf: try: @@ -652,7 +652,7 @@ def dag_test(args, dag: DAG | None = None, session: Session = NEW_SESSION) -> No @providers_configuration_loaded @provide_session def dag_reserialize(args, session: Session = NEW_SESSION) -> None: - """Serialize a DAG instance.""" + """Serialize a Dag instance.""" manager = DagBundlesManager() manager.sync_bundles_to_db(session=session) session.commit() diff --git a/airflow-core/src/airflow/cli/commands/task_command.py b/airflow-core/src/airflow/cli/commands/task_command.py index 8962c6d640f1f..2af9254213c6c 100644 --- a/airflow-core/src/airflow/cli/commands/task_command.py +++ b/airflow-core/src/airflow/cli/commands/task_command.py @@ -71,9 +71,9 @@ def _generate_temporary_run_id() -> str: """ - Generate a ``run_id`` for a DAG run that will be created temporarily. + Generate a ``run_id`` for a Dag run that will be created temporarily. - This is used mostly by ``airflow task test`` to create a DAG run that will + This is used mostly by ``airflow task test`` to create a Dag run that will be deleted after the task is run. """ return f"__airflow_temporary_run_{timezone.utcnow().isoformat()}__" @@ -87,16 +87,16 @@ def _get_dag_run( session: Session | None = None, ) -> tuple[DagRun, bool]: """ - Try to retrieve a DAG run from a string representing either a run ID or logical date. + Try to retrieve a Dag run from a string representing either a run ID or logical date. - This checks DAG runs like this: + This checks Dag runs like this: - 1. If the input ``logical_date_or_run_id`` matches a DAG run ID, return the run. + 1. If the input ``logical_date_or_run_id`` matches a Dag run ID, return the run. 2. Try to parse the input as a date. If that works, and the resulting - date matches a DAG run's logical date, return the run. + date matches a Dag run's logical date, return the run. 3. If ``create_if_necessary`` is *False* and the input works for neither of the above, raise ``DagRunNotFound``. - 4. Try to create a new DAG run. If the input looks like a date, use it as + 4. Try to create a new Dag run. If the input looks like a date, use it as the logical date; otherwise use it as a run ID and set the logical date to the current time. """ @@ -283,7 +283,7 @@ def task_state(args) -> None: @suppress_logs_and_warning @providers_configuration_loaded def task_list(args, dag: DAG | None = None) -> None: - """List the tasks within a DAG at the command line.""" + """List the tasks within a Dag at the command line.""" dag = dag or get_dag(args.bundle_name, args.dag_id) tasks = sorted(t.task_id for t in dag.tasks) print("\n".join(tasks)) diff --git a/airflow-core/src/airflow/cli/utils.py b/airflow-core/src/airflow/cli/utils.py index 4c7e6409e53a8..6eb5e9dcdee9f 100644 --- a/airflow-core/src/airflow/cli/utils.py +++ b/airflow-core/src/airflow/cli/utils.py @@ -62,15 +62,15 @@ def fetch_dag_run_from_run_id_or_logical_date_string( session: Session, ) -> tuple[DagRun | None, datetime.datetime | None]: """ - Try to find a DAG run with a given string value. + Try to find a Dag run with a given string value. The string value may be a run ID, or a logical date in string form. We first try to use it as a run_id; if a run is found, it is returned as-is. Otherwise, the string value is parsed into a datetime. If that works, it is - used to find a DAG run. + used to find a Dag run. - The return value is a two-tuple. The first item is the found DAG run (or + The return value is a two-tuple. The first item is the found Dag run (or *None* if one cannot be found). The second is the parsed logical date. This second value can be used to create a new run by the calling function when one cannot be found here. diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml index 5da744041a2e3..314fdf194dd2e 100644 --- a/airflow-core/src/airflow/config_templates/config.yml +++ b/airflow-core/src/airflow/config_templates/config.yml @@ -121,12 +121,12 @@ core: default: "32" max_active_tasks_per_dag: description: | - The maximum number of task instances allowed to run concurrently in each DAG. To calculate - the number of tasks that is running concurrently for a DAG, add up the number of running - tasks for all DAG runs of the DAG. This is configurable at the DAG level with ``max_active_tasks``, + The maximum number of task instances allowed to run concurrently in each Dag. To calculate + the number of tasks that is running concurrently for a Dag, add up the number of running + tasks for all Dag runs of the Dag. This is configurable at the Dag level with ``max_active_tasks``, which is defaulted as ``[core] max_active_tasks_per_dag``. - An example scenario when this would be useful is when you want to stop a new dag with an early + An example scenario when this would be useful is when you want to stop a new Dag with an early start date from stealing all the executor slots in a cluster. version_added: 2.2.0 type: integer @@ -141,8 +141,8 @@ core: default: "True" max_active_runs_per_dag: description: | - The maximum number of active DAG runs per DAG. The scheduler will not create more DAG runs - if it reaches the limit. This is configurable at the DAG level with ``max_active_runs``, + The maximum number of active Dag runs per Dag. The scheduler will not create more Dag runs + if it reaches the limit. This is configurable at the Dag level with ``max_active_runs``, which is defaulted as ``[core] max_active_runs_per_dag``. version_added: ~ type: integer @@ -150,8 +150,8 @@ core: default: "16" max_consecutive_failed_dag_runs_per_dag: description: | - (experimental) The maximum number of consecutive DAG failures before DAG is automatically paused. - This is also configurable per DAG level with ``max_consecutive_failed_dag_runs``, + (experimental) The maximum number of consecutive Dag failures before Dag is automatically paused. + This is also configurable per Dag level with ``max_consecutive_failed_dag_runs``, which is defaulted as ``[core] max_consecutive_failed_dag_runs_per_dag``. If not specified, then the value is considered as 0, meaning that the dags are never paused out by default. @@ -173,7 +173,7 @@ core: example: "fork" load_examples: description: | - Whether to load the DAG examples that ship with Airflow. It's good to + Whether to load the Dag examples that ship with Airflow. It's good to get started, but you probably want to set this to ``False`` in a production environment version_added: ~ @@ -298,14 +298,14 @@ core: The pattern syntax used in the `.airflowignore `__ - files in the DAG directories. Valid values are ``regexp`` or ``glob``. + files in the Dag directories. Valid values are ``regexp`` or ``glob``. version_added: 2.3.0 type: string example: ~ default: "glob" default_task_retries: description: | - The number of retries each task is going to have by default. Can be overridden at dag or task level. + The number of retries each task is going to have by default. Can be overridden at Dag or task level. version_added: 1.10.6 type: integer example: ~ @@ -313,7 +313,7 @@ core: default_task_retry_delay: description: | The number of seconds each task is going to wait by default between retries. Can be overridden at - dag or task level. + Dag or task level. version_added: 2.4.0 type: integer example: ~ @@ -321,7 +321,7 @@ core: max_task_retry_delay: description: | The maximum delay (in seconds) each task is going to wait by default between retries. - This is a global setting and cannot be overridden at task or DAG level. + This is a global setting and cannot be overridden at task or Dag level. version_added: 2.6.0 type: integer default: "86400" @@ -352,7 +352,7 @@ core: default: "" min_serialized_dag_update_interval: description: | - Updating serialized DAG can not be faster than a minimum interval to reduce database write rate. + Updating serialized Dag can not be faster than a minimum interval to reduce database write rate. version_added: 1.10.7 type: integer example: ~ @@ -363,7 +363,7 @@ core: .. note:: - This will disable the DAG dependencies view + This will disable the Dag dependencies view version_added: 2.3.0 type: boolean example: ~ diff --git a/airflow-core/src/airflow/dag_processing/bundles/base.py b/airflow-core/src/airflow/dag_processing/bundles/base.py index 1ab14abd047fb..06ca49ab51ca1 100644 --- a/airflow-core/src/airflow/dag_processing/bundles/base.py +++ b/airflow-core/src/airflow/dag_processing/bundles/base.py @@ -230,9 +230,9 @@ def remove_stale_bundle_versions(self): class BaseDagBundle(ABC): """ - Base class for DAG bundles. + Base class for Dag bundles. - DAG bundles are used both by the DAG processor and by a worker when running a task. These usage + Dag bundles are used both by the Dag processor and by a worker when running a task. These usage patterns are different, however. When running a task, we know what version of the bundle we need (assuming the bundle supports versioning). @@ -240,13 +240,13 @@ class BaseDagBundle(ABC): that bundle version. This also means, that on a single worker, it's possible that multiple versions of the same bundle are used at the same time. - In contrast, the DAG processor uses a bundle to keep the DAGs from that bundle up to date. There will not be - multiple versions of the same bundle in use at the same time. The DAG processor will always use the latest version. + In contrast, the Dag processor uses a bundle to keep the Dags from that bundle up to date. There will not be + multiple versions of the same bundle in use at the same time. The Dag processor will always use the latest version. - :param name: String identifier for the DAG bundle + :param name: String identifier for the Dag bundle :param refresh_interval: How often the bundle should be refreshed from the source in seconds (Optional - defaults to [dag_processor] refresh_interval) - :param version: Version of the DAG bundle (Optional) + :param version: Version of the Dag bundle (Optional) """ supports_versioning: bool = False @@ -278,7 +278,7 @@ def initialize(self) -> None: """ Initialize the bundle. - This method is called by the DAG processor and worker before the bundle is used, + This method is called by the Dag processor and worker before the bundle is used, and allows for deferring expensive operations until that point in time. This will only be called when Airflow needs the bundle files on disk - some uses only need to call the `view_url` method, which can run without initializing the bundle. @@ -296,7 +296,7 @@ def initialize(self) -> None: bundle_path = self.path if not bundle_path.exists(): log.warning( - "Bundle '%s' path does not exist: %s. This may cause DAG loading issues.", + "Bundle '%s' path does not exist: %s. This may cause Dag loading issues.", self.name, bundle_path, ) @@ -307,14 +307,14 @@ def path(self) -> Path: """ Path for this bundle. - Airflow will use this path to find/load/execute the DAGs from the bundle. + Airflow will use this path to find/load/execute the Dags from the bundle. After `initialize` has been called, all dag files in the bundle should be accessible from this path. """ @abstractmethod def get_current_version(self) -> str | None: """ - Retrieve a string that represents the version of the DAG bundle. + Retrieve a string that represents the version of the Dag bundle. Airflow can use this value to retrieve this same bundle version later. """ diff --git a/airflow-core/src/airflow/dag_processing/bundles/local.py b/airflow-core/src/airflow/dag_processing/bundles/local.py index 918e5cd189e30..66271e99e16ed 100644 --- a/airflow-core/src/airflow/dag_processing/bundles/local.py +++ b/airflow-core/src/airflow/dag_processing/bundles/local.py @@ -25,9 +25,9 @@ class LocalDagBundle(BaseDagBundle): """ - Local DAG bundle - exposes a local directory as a DAG bundle. + Local Dag bundle - exposes a local directory as a Dag bundle. - :param path: Local path where the DAGs are stored + :param path: Local path where the Dags are stored """ supports_versioning = False diff --git a/airflow-core/src/airflow/dag_processing/bundles/manager.py b/airflow-core/src/airflow/dag_processing/bundles/manager.py index cf3b7c5104824..38f1b36203cdc 100644 --- a/airflow-core/src/airflow/dag_processing/bundles/manager.py +++ b/airflow-core/src/airflow/dag_processing/bundles/manager.py @@ -60,7 +60,7 @@ def _validate_bundle_config(config_list): if bundle_name == _example_dag_bundle_name: raise AirflowConfigException( f"Bundle name '{_example_dag_bundle_name}' is a reserved name. Please choose another name for your bundle." - " Example DAGs can be enabled with the '[core] load_examples' config." + " Example Dags can be enabled with the '[core] load_examples' config." ) all_names.append(bundle_name) @@ -139,7 +139,7 @@ def _sign_bundle_url(url: str, bundle_name: str) -> str: class DagBundlesManager(LoggingMixin): - """Manager for DAG bundles.""" + """Manager for Dag bundles.""" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -148,7 +148,7 @@ def __init__(self, *args, **kwargs): def parse_config(self) -> None: """ - Get all DAG bundle configurations and store in instance variable. + Get all Dag bundle configurations and store in instance variable. If a bundle class for a given name has already been imported, it will not be imported again. @@ -176,11 +176,11 @@ def parse_config(self) -> None: class_ = import_string(cfg["classpath"]) kwargs = cfg["kwargs"] self._bundle_config[name] = (class_, kwargs) - self.log.info("DAG bundles loaded: %s", ", ".join(self._bundle_config.keys())) + self.log.info("Dag bundles loaded: %s", ", ".join(self._bundle_config.keys())) @provide_session def sync_bundles_to_db(self, *, session: Session = NEW_SESSION) -> None: - self.log.debug("Syncing DAG bundles to the database") + self.log.debug("Syncing Dag bundles to the database") def _extract_and_sign_template(bundle_name: str) -> tuple[str | None, dict]: bundle_instance = self.get_bundle(name) @@ -219,11 +219,11 @@ def _extract_and_sign_template(bundle_name: str) -> tuple[str | None, dict]: new_bundle.template_params = new_params session.add(new_bundle) - self.log.info("Added new DAG bundle %s to the database", name) + self.log.info("Added new Dag bundle %s to the database", name) for name, bundle in stored.items(): bundle.active = False - self.log.warning("DAG bundle %s is no longer found in config and has been disabled", name) + self.log.warning("Dag bundle %s is no longer found in config and has been disabled", name) from airflow.models.errors import ParseImportError session.execute(delete(ParseImportError).where(ParseImportError.bundle_name == name)) @@ -260,12 +260,12 @@ def _extract_template_params(bundle_instance: BaseDagBundle) -> dict: def get_bundle(self, name: str, version: str | None = None) -> BaseDagBundle: """ - Get a DAG bundle by name. + Get a Dag bundle by name. - :param name: The name of the DAG bundle. - :param version: The version of the DAG bundle you need (optional). If not provided, ``tracking_ref`` will be used instead. + :param name: The name of the Dag bundle. + :param version: The version of the Dag bundle you need (optional). If not provided, ``tracking_ref`` will be used instead. - :return: The DAG bundle. + :return: The Dag bundle. """ cfg_tuple = self._bundle_config.get(name) if not cfg_tuple: @@ -275,9 +275,9 @@ def get_bundle(self, name: str, version: str | None = None) -> BaseDagBundle: def get_all_dag_bundles(self) -> Iterable[BaseDagBundle]: """ - Get all DAG bundles. + Get all Dag bundles. - :return: list of DAG bundles. + :return: list of Dag bundles. """ for name, (class_, kwargs) in self._bundle_config.items(): yield class_(name=name, version=None, **kwargs) diff --git a/airflow-core/src/airflow/dag_processing/collection.py b/airflow-core/src/airflow/dag_processing/collection.py index e9264c38d322e..5e556de1c67e3 100644 --- a/airflow-core/src/airflow/dag_processing/collection.py +++ b/airflow-core/src/airflow/dag_processing/collection.py @@ -17,7 +17,7 @@ # under the License. """ -Utility code that writes DAGs in bulk into the database. +Utility code that writes Dags in bulk into the database. This should generally only be called by internal methods such as ``DagBag._sync_to_db``, ``DAG.bulk_write_to_db``. @@ -79,7 +79,7 @@ def _create_orm_dags( orm_dag = DagModel(dag_id=dag.dag_id, bundle_name=bundle_name) if dag.is_paused_upon_creation is not None: orm_dag.is_paused = dag.is_paused_upon_creation - log.info("Creating ORM DAG for %s", dag.dag_id) + log.info("Creating ORM Dag for %s", dag.dag_id) session.add(orm_dag) yield orm_dag @@ -135,7 +135,7 @@ def calculate(cls, dags: dict[str, MaybeSerializedDAG], *, session: Session) -> :param dags: dict of dags to query """ - # Skip these queries entirely if no DAGs can be scheduled to save time. + # Skip these queries entirely if no Dags can be scheduled to save time. if not any(dag.timetable.can_be_scheduled for dag in dags.values()): return cls({}, {}) @@ -206,7 +206,7 @@ def _serialize_dag_capturing_errors( except OperationalError: raise except Exception: - log.exception("Failed to write serialized DAG dag_id=%s fileloc=%s", dag.dag_id, dag.fileloc) + log.exception("Failed to write serialized Dag dag_id=%s fileloc=%s", dag.dag_id, dag.fileloc) dagbag_import_error_traceback_depth = conf.getint("core", "dagbag_import_error_traceback_depth") return [ ( @@ -217,10 +217,10 @@ def _serialize_dag_capturing_errors( def _sync_dag_perms(dag: MaybeSerializedDAG, session: Session): - """Sync DAG specific permissions.""" + """Sync Dag specific permissions.""" dag_id = dag.dag_id - log.debug("Syncing DAG permissions: %s to the DB", dag_id) + log.debug("Syncing Dag permissions: %s to the DB", dag_id) from airflow.providers.fab.www.security_appless import ApplessAirflowSecurityManager security_manager = ApplessAirflowSecurityManager(session=session) @@ -342,7 +342,7 @@ def update_dag_parsing_results_in_db( warning_types: tuple[DagWarningType] = (DagWarningType.NONEXISTENT_POOL,), ): """ - Update everything to do with DAG parsing in the DB. + Update everything to do with Dag parsing in the DB. This function will create or update rows in the following tables: @@ -350,10 +350,10 @@ def update_dag_parsing_results_in_db( - SerializedDagModel (`serialized_dag` table) - ParseImportError (including with any errors as a result of serialization, not just parsing) - DagWarning - - DAG Permissions + - Dag Permissions This function will not remove any rows for dags not passed in. It will remove parse errors and warnings - from dags/dag files that are passed in. In order words, if a DAG is passed in with a fileloc of `a.py` + from dags/dag files that are passed in. In order words, if a Dag is passed in with a fileloc of `a.py` then all warnings and errors related to this file will be removed. ``import_errors`` will be updated in place with an new errors @@ -372,7 +372,7 @@ def update_dag_parsing_results_in_db( log.debug("Calling the DAG.bulk_sync_to_db method") try: DAG.bulk_write_to_db(bundle_name, bundle_version, dags, session=session) - # Write Serialized DAGs to DB, capturing errors + # Write Serialized Dags to DB, capturing errors for dag in dags: serialize_errors.extend( _serialize_dag_capturing_errors( @@ -387,7 +387,7 @@ def update_dag_parsing_results_in_db( import_errors.update(dict(serialize_errors)) # Record import errors into the ORM - we don't retry on this one as it's not as critical that it works try: - # TODO: This won't clear errors for files that exist that no longer contain DAGs. Do we need to pass + # TODO: This won't clear errors for files that exist that no longer contain Dags. Do we need to pass # in the list of file parsed? good_dag_filelocs = { @@ -404,24 +404,24 @@ def update_dag_parsing_results_in_db( except Exception: log.exception("Error logging import errors!") - # Record DAG warnings in the metadatabase. + # Record Dag warnings in the metadatabase. try: _update_dag_warnings([dag.dag_id for dag in dags], warnings, warning_types, session) except Exception: - log.exception("Error logging DAG warnings.") + log.exception("Error logging Dag warnings.") session.flush() class DagModelOperation(NamedTuple): - """Collect DAG objects and perform database operations for them.""" + """Collect Dag objects and perform database operations for them.""" dags: dict[str, MaybeSerializedDAG] bundle_name: str bundle_version: str | None def find_orm_dags(self, *, session: Session) -> dict[str, DagModel]: - """Find existing DagModel objects from DAG objects.""" + """Find existing DagModel objects from Dag objects.""" stmt = ( select(DagModel) .options(joinedload(DagModel.tags, innerjoin=False)) @@ -621,7 +621,7 @@ def _find_active_assets(name_uri_assets: Iterable[tuple[str, str]], session: Ses class AssetModelOperation(NamedTuple): - """Collect asset/alias objects from DAGs and perform database operations for them.""" + """Collect asset/alias objects from Dags and perform database operations for them.""" schedule_asset_references: dict[str, list[Asset]] schedule_asset_alias_references: dict[str, list[AssetAlias]] @@ -888,7 +888,7 @@ def add_asset_trigger_references( active_assets = _find_active_assets(self.assets, session=session) if self.assets else {} for name_uri, asset in self.assets.items(): - # If the asset belong to a DAG not active or paused, consider there is no watcher associated to it + # If the asset belong to a Dag not active or paused, consider there is no watcher associated to it asset_watcher_triggers = ( [_encode_trigger(watcher.trigger) for watcher in asset.watchers] if name_uri in active_assets @@ -906,7 +906,7 @@ def add_asset_trigger_references( BaseEventTrigger.hash(trigger.classpath, trigger.kwargs) for trigger in asset_model.triggers } - # Optimization: no diff between the DB and DAG definitions, no update needed + # Optimization: no diff between the DB and Dag definitions, no update needed if trigger_hash_from_asset == trigger_hash_from_asset_model: continue diff --git a/airflow-core/src/airflow/dag_processing/manager.py b/airflow-core/src/airflow/dag_processing/manager.py index 606fc57b76a2b..bcdaf1ad2f17a 100644 --- a/airflow-core/src/airflow/dag_processing/manager.py +++ b/airflow-core/src/airflow/dag_processing/manager.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Processes DAGs.""" +"""Processes Dags.""" from __future__ import annotations @@ -107,7 +107,7 @@ class DagFileStat: @dataclass(frozen=True) class DagFileInfo: - """Information about a DAG file.""" + """Information about a Dag file.""" rel_path: Path bundle_name: str @@ -152,9 +152,9 @@ def utc_epoch() -> datetime: @attrs.define(kw_only=True) class DagFileProcessorManager(LoggingMixin): """ - Manage processes responsible for parsing DAGs. + Manage processes responsible for parsing Dags. - Given a list of DAG definition files, this kicks off several processors + Given a list of Dag definition files, this kicks off several processors in parallel to process them and put the results to a multiprocessing.Queue for DagFileProcessorAgent to harvest. The parallelism is limited and as the processors finish, more are launched. The files are processed over and @@ -162,7 +162,7 @@ class DagFileProcessorManager(LoggingMixin): :param max_runs: The number of times to parse each file. -1 for unlimited. :param bundle_names_to_parse: List of bundle names to parse. If None, all bundles are parsed. - :param processor_timeout: How long to wait before timing out a DAG file processor + :param processor_timeout: How long to wait before timing out a Dag file processor """ max_runs: int @@ -238,17 +238,17 @@ def register_exit_signals(self): signal.signal(signal.SIGUSR2, signal.SIG_IGN) def _exit_gracefully(self, signum, frame): - """Clean up DAG file processors to avoid leaving orphan processes.""" + """Clean up Dag file processors to avoid leaving orphan processes.""" self.log.info("Exiting gracefully upon receiving signal %s", signum) self.log.debug("Current Stacktrace is: %s", "\n".join(map(str, inspect.stack()))) self.terminate() self.end() - self.log.debug("Finished terminating DAG processors.") + self.log.debug("Finished terminating Dag processors.") sys.exit(os.EX_OK) def run(self): """ - Use multiple processes to parse and generate tasks for the DAGs in parallel. + Use multiple processes to parse and generate tasks for the Dags in parallel. By processing them in separate processes, we can get parallelism and isolation from potentially harmful user code. @@ -275,7 +275,7 @@ def run(self): return self._run_parsing_loop() def _scan_stale_dags(self): - """Scan and deactivate DAGs which are no longer present in files.""" + """Scan and deactivate Dags which are no longer present in files.""" now = time.monotonic() elapsed_time_since_refresh = now - self._last_deactivate_stale_dags_time if elapsed_time_since_refresh > self.parsing_cleanup_interval: @@ -293,7 +293,7 @@ def deactivate_stale_dags( last_parsed: dict[DagFileInfo, datetime | None], session: Session = NEW_SESSION, ): - """Detect and deactivate DAGs which are no longer present in files.""" + """Detect and deactivate Dags which are no longer present in files.""" to_deactivate = set() bundle_names = {b.name for b in self._dag_bundles} query = select( @@ -307,13 +307,13 @@ def deactivate_stale_dags( for dag in dags_parsed: # The largest valid difference between a DagFileStat's last_finished_time and a DAG's - # last_parsed_time is the processor_timeout. Longer than that indicates that the DAG is + # last_parsed_time is the processor_timeout. Longer than that indicates that the Dag is # no longer present in the file. We have a stale_dag_threshold configured to prevent a # significant delay in deactivation of stale dags when a large timeout is configured file_info = DagFileInfo(rel_path=Path(dag.relative_fileloc), bundle_name=dag.bundle_name) if last_finish_time := last_parsed.get(file_info, None): if dag.last_parsed_time + timedelta(seconds=self.stale_dag_threshold) < last_finish_time: - self.log.info("DAG %s is missing and will be deactivated.", dag.dag_id) + self.log.info("Dag %s is missing and will be deactivated.", dag.dag_id) to_deactivate.add(dag.dag_id) if to_deactivate: @@ -325,11 +325,11 @@ def deactivate_stale_dags( ) deactivated = deactivated_dagmodel.rowcount if deactivated: - self.log.info("Deactivated %i DAGs which are no longer present in file.", deactivated) + self.log.info("Deactivated %i Dags which are no longer present in file.", deactivated) def _run_parsing_loop(self): - # initialize cache to mutualize calls to Variable.get in DAGs - # needs to be done before this process is forked to create the DAG parsing processes. + # initialize cache to mutualize calls to Variable.get in Dags + # needs to be done before this process is forked to create the Dag parsing processes. SecretCache.init() poll_time = 0.0 @@ -486,7 +486,7 @@ def _add_callback_to_queue(self, request: CallbackRequest): Stats.incr("dag_processing.other_callback_count") def _refresh_dag_bundles(self, known_files: dict[str, set[DagFileInfo]]): - """Refresh DAG bundles, if required.""" + """Refresh Dag bundles, if required.""" now = timezone.utcnow() # we don't need to check if it's time to refresh every loop - that is way too often @@ -494,7 +494,7 @@ def _refresh_dag_bundles(self, known_files: dict[str, set[DagFileInfo]]): now_seconds = time.monotonic() if now_seconds < next_check and not self._force_refresh_bundles: self.log.debug( - "Not time to check if DAG Bundles need refreshed yet - skipping. Next check in %.2f seconds", + "Not time to check if Dag Bundles need refreshed yet - skipping. Next check in %.2f seconds", next_check - now_seconds, ) return @@ -517,7 +517,7 @@ def _refresh_dag_bundles(self, known_files: dict[str, set[DagFileInfo]]): now - (bundle_model.last_refreshed or utc_epoch()) ).total_seconds() if bundle.supports_versioning: - # we will also check the version of the bundle to see if another DAG processor has seen + # we will also check the version of the bundle to see if another Dag processor has seen # a new version pre_refresh_version = ( self._bundle_versions.get(bundle.name) or bundle.get_current_version() @@ -587,7 +587,7 @@ def _refresh_dag_bundles(self, known_files: dict[str, set[DagFileInfo]]): def _find_files_in_bundle(self, bundle: BaseDagBundle) -> list[Path]: """Get relative paths for dag files from bundle dir.""" - # Build up a list of Python files that could contain DAGs + # Build up a list of Python files that could contain Dags self.log.info("Searching for files in %s at %s", bundle.name, bundle.path) rel_paths = [Path(x).relative_to(bundle.path) for x in list_py_file_paths(bundle.path)] self.log.info("Found %s files for bundle %s", len(rel_paths), bundle.name) @@ -595,7 +595,7 @@ def _find_files_in_bundle(self, bundle: BaseDagBundle) -> list[Path]: return rel_paths def deactivate_deleted_dags(self, bundle_name: str, present: set[DagFileInfo]) -> None: - """Deactivate DAGs that come from files that are no longer present in bundle.""" + """Deactivate Dags that come from files that are no longer present in bundle.""" def find_zipped_dags(abs_path: os.PathLike) -> Iterator[str]: """ @@ -667,10 +667,10 @@ def _log_file_processing_stats(self, known_files: dict[str, set[DagFileInfo]]): Print out stats about how files are getting processed. :param known_files: a list of file paths that may contain Airflow - DAG definitions + Dag definitions :return: None """ - # File Path: Path to the file containing the DAG definition + # File Path: Path to the file containing the Dag definition # PID: PID associated with the process that's processing the file. May # be empty. # Runtime: If the process is currently running, how long it's been @@ -685,7 +685,7 @@ def _log_file_processing_stats(self, known_files: dict[str, set[DagFileInfo]]): "File Path", "PID", "Current Duration", - "# DAGs", + "# Dags", "# Errors", "Last Duration", "Last Run At", @@ -753,7 +753,7 @@ def _log_file_processing_stats(self, known_files: dict[str, set[DagFileInfo]]): "\n" + "=" * 80 + "\n" - + "DAG File Processing Stats\n\n" + + "Dag File Processing Stats\n\n" + tabulate(formatted_rows, headers=headers) + "\n" + "=" * 80 @@ -987,7 +987,7 @@ def prepare_file_queue(self, known_files: dict[str, set[DagFileInfo]]): elif list_mode == "alphabetical": files.sort(key=attrgetter("rel_path")) elif list_mode == "random_seeded_by_host": - # Shuffle the list seeded by hostname so multiple DAG processors can work on different + # Shuffle the list seeded by hostname so multiple Dag processors can work on different # set of files. Since we set the seed, the sort order will remain same per host random.Random(get_hostname()).shuffle(files) @@ -1149,7 +1149,7 @@ def process_parse_results( if parsing_result is None: stat.import_errors = 1 else: - # record DAGs and import errors to database + # record Dags and import errors to database import_errors = {} if parsing_result.import_errors: import_errors = { diff --git a/airflow-core/src/airflow/dag_processing/processor.py b/airflow-core/src/airflow/dag_processing/processor.py index 7e29799021612..af7795a55f71e 100644 --- a/airflow-core/src/airflow/dag_processing/processor.py +++ b/airflow-core/src/airflow/dag_processing/processor.py @@ -68,9 +68,9 @@ class DagFileParseRequest(BaseModel): """ - Request for DAG File Parsing. + Request for Dag File Parsing. - This is the request that the manager will send to the DAG parser with the dag file and + This is the request that the manager will send to the Dag parser with the dag file and any other necessary metadata. """ @@ -85,9 +85,9 @@ class DagFileParseRequest(BaseModel): class DagFileParsingResult(BaseModel): """ - Result of DAG File Parsing. + Result of Dag File Parsing. - This is the result of a successful DAG parse, in this class, we gather all serialized DAGs, + This is the result of a successful Dag parse, in this class, we gather all serialized Dags, import errors and warnings to send back to the scheduler to store in the DB. """ @@ -148,7 +148,7 @@ def _parse_file_entrypoint(): from airflow.sdk.execution_time import comms, task_runner - # Parse DAG file, send JSON back up! + # Parse Dag file, send JSON back up! comms_decoder = comms.CommsDecoder[ToDagProcessor, ToManager]( body_decoder=TypeAdapter[ToDagProcessor](ToDagProcessor), ) @@ -180,7 +180,7 @@ def _parse_file(msg: DagFileParseRequest, log: FilteringBoundLogger) -> DagFileP load_op_links=False, ) if msg.callback_requests: - # If the request is for callback, we shouldn't serialize the DAGs + # If the request is for callback, we shouldn't serialize the Dags _execute_callbacks(bag, msg.callback_requests, log) return None @@ -345,9 +345,9 @@ class DagFileProcessorProcess(WatchedSubprocess): """ Parses dags with Task SDK API. - This class provides a wrapper and management around a subprocess to parse a specific DAG file. + This class provides a wrapper and management around a subprocess to parse a specific Dag file. - Since DAGs are written with the Task SDK, we need to parse them in a task SDK process such that + Since Dags are written with the Task SDK, we need to parse them in a task SDK process such that we can use the Task SDK definitions when serializing. This prevents potential conflicts with classes in core Airflow. """ diff --git a/airflow-core/src/airflow/example_dags/example_asset_alias.py b/airflow-core/src/airflow/example_dags/example_asset_alias.py index 5c4df1aa09c35..563301b0d452e 100644 --- a/airflow-core/src/airflow/example_dags/example_asset_alias.py +++ b/airflow-core/src/airflow/example_dags/example_asset_alias.py @@ -15,18 +15,18 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG for demonstrating the behavior of the AssetAlias feature in Airflow, including conditional and +Example Dag for demonstrating the behavior of the AssetAlias feature in Airflow, including conditional and asset expression-based scheduling. Notes on usage: -Turn on all the DAGs. +Turn on all the Dags. -Once the "asset_s3_bucket_producer" DAG is triggered, the "asset_s3_bucket_consumer" DAG should be triggered upon completion. +Once the "asset_s3_bucket_producer" Dag is triggered, the "asset_s3_bucket_consumer" Dag should be triggered upon completion. This is because the asset alias "example-alias" is used to add an asset event to the asset "s3://bucket/my-task" during the "produce_asset_events_through_asset_alias" task. -As the DAG "asset-alias-consumer" relies on asset alias "example-alias" which was previously unresolved, -the DAG "asset-alias-consumer" (along with all the DAGs in the same file) will be re-parsed and +As the Dag "asset-alias-consumer" relies on asset alias "example-alias" which was previously unresolved, +the Dag "asset-alias-consumer" (along with all the Dags in the same file) will be re-parsed and thus update its schedule to the asset "s3://bucket/my-task" and will also be triggered. """ diff --git a/airflow-core/src/airflow/example_dags/example_asset_alias_with_no_taskflow.py b/airflow-core/src/airflow/example_dags/example_asset_alias_with_no_taskflow.py index d9de5e06d9f7b..3f4454f0f216e 100644 --- a/airflow-core/src/airflow/example_dags/example_asset_alias_with_no_taskflow.py +++ b/airflow-core/src/airflow/example_dags/example_asset_alias_with_no_taskflow.py @@ -15,20 +15,20 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG for demonstrating the behavior of the AssetAlias feature in Airflow, including conditional and +Example Dag for demonstrating the behavior of the AssetAlias feature in Airflow, including conditional and asset expression-based scheduling. Notes on usage: -Turn on all the DAGs. +Turn on all the Dags. -Before running any DAG, the schedule of the "asset_alias_example_alias_consumer_with_no_taskflow" DAG will show as "unresolved AssetAlias". +Before running any DAG, the schedule of the "asset_alias_example_alias_consumer_with_no_taskflow" Dag will show as "unresolved AssetAlias". This is expected because the asset alias has not been resolved into any asset yet. -Once the "asset_s3_bucket_producer_with_no_taskflow" DAG is triggered, the "asset_s3_bucket_consumer_with_no_taskflow" DAG should be triggered upon completion. +Once the "asset_s3_bucket_producer_with_no_taskflow" Dag is triggered, the "asset_s3_bucket_consumer_with_no_taskflow" Dag should be triggered upon completion. This is because the asset alias "example-alias-no-taskflow" is used to add an asset event to the asset "s3://bucket/my-task-with-no-taskflow" -during the "produce_asset_events_through_asset_alias_with_no_taskflow" task. Also, the schedule of the "asset_alias_example_alias_consumer_with_no_taskflow" DAG should change to "Asset" as -the asset alias "example-alias-no-taskflow" is now resolved to the asset "s3://bucket/my-task-with-no-taskflow" and this DAG should also be triggered. +during the "produce_asset_events_through_asset_alias_with_no_taskflow" task. Also, the schedule of the "asset_alias_example_alias_consumer_with_no_taskflow" Dag should change to "Asset" as +the asset alias "example-alias-no-taskflow" is now resolved to the asset "s3://bucket/my-task-with-no-taskflow" and this Dag should also be triggered. """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_asset_with_watchers.py b/airflow-core/src/airflow/example_dags/example_asset_with_watchers.py index 673be86a7964b..63ec6fd1d8a1a 100644 --- a/airflow-core/src/airflow/example_dags/example_asset_with_watchers.py +++ b/airflow-core/src/airflow/example_dags/example_asset_with_watchers.py @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG for demonstrating the usage of event driven scheduling using assets and triggers. +Example Dag for demonstrating the usage of event driven scheduling using assets and triggers. """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_assets.py b/airflow-core/src/airflow/example_dags/example_assets.py index 3ab372112585c..715126ee86aff 100644 --- a/airflow-core/src/airflow/example_dags/example_assets.py +++ b/airflow-core/src/airflow/example_dags/example_assets.py @@ -15,14 +15,14 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG for demonstrating the behavior of the Assets feature in Airflow, including conditional and +Example Dag for demonstrating the behavior of the Assets feature in Airflow, including conditional and asset expression-based scheduling. Notes on usage: -Turn on all the DAGs. +Turn on all the Dags. -asset_produces_1 is scheduled to run daily. Once it completes, it triggers several DAGs due to its asset +asset_produces_1 is scheduled to run daily. Once it completes, it triggers several Dags due to its asset being updated. asset_consumes_1 is triggered immediately, as it depends solely on the asset produced by asset_produces_1. consume_1_or_2_with_asset_expressions will also be triggered, as its condition of either asset_produces_1 or asset_produces_2 being updated is satisfied with asset_produces_1. @@ -30,23 +30,23 @@ asset_consumes_1_and_2 will not be triggered after asset_produces_1 runs because it requires the asset from asset_produces_2, which has no schedule and must be manually triggered. -After manually triggering asset_produces_2, several DAGs will be affected. asset_consumes_1_and_2 should +After manually triggering asset_produces_2, several Dags will be affected. asset_consumes_1_and_2 should run because both its asset dependencies are now met. consume_1_and_2_with_asset_expressions will be triggered, as it requires both asset_produces_1 and asset_produces_2 assets to be updated. consume_1_or_2_with_asset_expressions will be triggered again, since it's conditionally set to run when either asset is updated. consume_1_or_both_2_and_3_with_asset_expressions demonstrates complex asset dependency logic. -This DAG triggers if asset_produces_1 is updated or if both asset_produces_2 and dag3_asset +This Dag triggers if asset_produces_1 is updated or if both asset_produces_2 and dag3_asset are updated. This example highlights the capability to combine updates from multiple assets with logical expressions for advanced scheduling. conditional_asset_and_time_based_timetable illustrates the integration of time-based scheduling with -asset dependencies. This DAG is configured to execute either when both asset_produces_1 and +asset dependencies. This Dag is configured to execute either when both asset_produces_1 and asset_produces_2 assets have been updated or according to a specific cron schedule, showcasing Airflow's versatility in handling mixed triggers for asset and time-based scheduling. -The DAGs asset_consumes_1_never_scheduled and asset_consumes_unknown_never_scheduled will not run +The Dags asset_consumes_1_never_scheduled and asset_consumes_unknown_never_scheduled will not run automatically as they depend on assets that do not get updated or are not produced by any scheduled tasks. """ diff --git a/airflow-core/src/airflow/example_dags/example_branch_labels.py b/airflow-core/src/airflow/example_dags/example_branch_labels.py index fcff3d5a3a1f4..dea697c8a12e2 100644 --- a/airflow-core/src/airflow/example_dags/example_branch_labels.py +++ b/airflow-core/src/airflow/example_dags/example_branch_labels.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating the usage of labels with different branches. +Example Dag demonstrating the usage of labels with different branches. """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_branch_python_dop_operator_3.py b/airflow-core/src/airflow/example_dags/example_branch_python_dop_operator_3.py index 06c210676a856..5fa9898b35842 100644 --- a/airflow-core/src/airflow/example_dags/example_branch_python_dop_operator_3.py +++ b/airflow-core/src/airflow/example_dags/example_branch_python_dop_operator_3.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating the usage of ``@task.branch`` TaskFlow API decorator with depends_on_past=True, +Example Dag demonstrating the usage of ``@task.branch`` TaskFlow API decorator with depends_on_past=True, where tasks may be run or skipped on alternating runs. """ diff --git a/airflow-core/src/airflow/example_dags/example_complex.py b/airflow-core/src/airflow/example_dags/example_complex.py index 1a414aa4d6c5a..2437c0d35347b 100644 --- a/airflow-core/src/airflow/example_dags/example_complex.py +++ b/airflow-core/src/airflow/example_dags/example_complex.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example Airflow DAG that shows the complex DAG structure. +Example Airflow Dag that shows the complex Dag structure. """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_custom_weight.py b/airflow-core/src/airflow/example_dags/example_custom_weight.py index 4bbc261c5531a..c3ae727991e9f 100644 --- a/airflow-core/src/airflow/example_dags/example_custom_weight.py +++ b/airflow-core/src/airflow/example_dags/example_custom_weight.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the CustomWeightRule.""" +"""Example Dag demonstrating the usage of the CustomWeightRule.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_dag_decorator.py b/airflow-core/src/airflow/example_dags/example_dag_decorator.py index 9f6e637c9178e..c4af2f69a55e7 100644 --- a/airflow-core/src/airflow/example_dags/example_dag_decorator.py +++ b/airflow-core/src/airflow/example_dags/example_dag_decorator.py @@ -53,7 +53,7 @@ def execute(self, context: Context): ) def example_dag_decorator(url: str = "http://httpbin.org/get"): """ - DAG to get IP address and echo it via BashOperator. + Dag to get IP address and echo it via BashOperator. :param url: URL to get IP address from. Defaults to "http://httpbin.org/get". """ diff --git a/airflow-core/src/airflow/example_dags/example_display_name.py b/airflow-core/src/airflow/example_dags/example_display_name.py index f91ee45287916..b0f2329b40671 100644 --- a/airflow-core/src/airflow/example_dags/example_display_name.py +++ b/airflow-core/src/airflow/example_dags/example_display_name.py @@ -29,7 +29,7 @@ start_date=pendulum.datetime(2021, 1, 1, tz="UTC"), catchup=False, tags=["example"], - dag_display_name="Sample DAG with Display Name", + dag_display_name="Sample Dag with Display Name", ) def example_display_name(): sample_task_1 = EmptyOperator( diff --git a/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping.py b/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping.py index 750c3da1ec17b..35dd3e2f7eb85 100644 --- a/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping.py +++ b/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of dynamic task mapping.""" +"""Example Dag demonstrating the usage of dynamic task mapping.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py b/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py index 07cd653d29b14..00f34bc730bc0 100644 --- a/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py +++ b/airflow-core/src/airflow/example_dags/example_dynamic_task_mapping_with_no_taskflow_operators.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of dynamic task mapping with non-TaskFlow operators.""" +"""Example Dag demonstrating the usage of dynamic task mapping with non-TaskFlow operators.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_inlet_event_extra.py b/airflow-core/src/airflow/example_dags/example_inlet_event_extra.py index ead4b442b782e..c93178550dbe5 100644 --- a/airflow-core/src/airflow/example_dags/example_inlet_event_extra.py +++ b/airflow-core/src/airflow/example_dags/example_inlet_event_extra.py @@ -16,7 +16,7 @@ # under the License. """ -Example DAG to demonstrate reading asset events annotated with extra information. +Example Dag to demonstrate reading asset events annotated with extra information. Also see examples in ``example_outlet_event_extra.py``. """ diff --git a/airflow-core/src/airflow/example_dags/example_kubernetes_executor.py b/airflow-core/src/airflow/example_dags/example_kubernetes_executor.py index 937c174b0dfd1..ba90e81d54cee 100644 --- a/airflow-core/src/airflow/example_dags/example_kubernetes_executor.py +++ b/airflow-core/src/airflow/example_dags/example_kubernetes_executor.py @@ -36,7 +36,7 @@ from kubernetes.client import models as k8s except ImportError: log.warning( - "The example_kubernetes_executor example DAG requires the kubernetes provider." + "The example_kubernetes_executor example Dag requires the kubernetes provider." " Please install it with: pip install apache-airflow[cncf.kubernetes]" ) k8s = None diff --git a/airflow-core/src/airflow/example_dags/example_local_kubernetes_executor.py b/airflow-core/src/airflow/example_dags/example_local_kubernetes_executor.py index 752c2bc29ca39..36e9287930711 100644 --- a/airflow-core/src/airflow/example_dags/example_local_kubernetes_executor.py +++ b/airflow-core/src/airflow/example_dags/example_local_kubernetes_executor.py @@ -36,7 +36,7 @@ try: from kubernetes.client import models as k8s except ImportError: - log.warning("Could not import DAGs in example_local_kubernetes_executor.py", exc_info=True) + log.warning("Could not import Dags in example_local_kubernetes_executor.py", exc_info=True) log.warning("Install Kubernetes dependencies with: pip install apache-airflow[cncf.kubernetes]") k8s = None diff --git a/airflow-core/src/airflow/example_dags/example_nested_branch_dag.py b/airflow-core/src/airflow/example_dags/example_nested_branch_dag.py index 5f223d1fb8fdc..6a366ab8cb135 100644 --- a/airflow-core/src/airflow/example_dags/example_nested_branch_dag.py +++ b/airflow-core/src/airflow/example_dags/example_nested_branch_dag.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating a workflow with nested branching. The join tasks are created with +Example Dag demonstrating a workflow with nested branching. The join tasks are created with ``none_failed_min_one_success`` trigger rule such that they are skipped whenever their corresponding branching tasks are skipped. """ diff --git a/airflow-core/src/airflow/example_dags/example_outlet_event_extra.py b/airflow-core/src/airflow/example_dags/example_outlet_event_extra.py index 50b4cdf0b27b9..04e88554d16d3 100644 --- a/airflow-core/src/airflow/example_dags/example_outlet_event_extra.py +++ b/airflow-core/src/airflow/example_dags/example_outlet_event_extra.py @@ -16,7 +16,7 @@ # under the License. """ -Example DAG to demonstrate annotating an asset event with extra information. +Example Dag to demonstrate annotating an asset event with extra information. Also see examples in ``example_inlet_event_extra.py``. """ diff --git a/airflow-core/src/airflow/example_dags/example_params_trigger_ui.py b/airflow-core/src/airflow/example_dags/example_params_trigger_ui.py index 6d506e9f4c5fe..6e6db956f8765 100644 --- a/airflow-core/src/airflow/example_dags/example_params_trigger_ui.py +++ b/airflow-core/src/airflow/example_dags/example_params_trigger_ui.py @@ -15,9 +15,9 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage DAG params to model a trigger UI with a user form. +"""Example Dag demonstrating the usage Dag params to model a trigger UI with a user form. -This example DAG generates greetings to a list of provided names in selected languages in the logs. +This example Dag generates greetings to a list of provided names in selected languages in the logs. """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py b/airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py index 40e4667d35b6f..e810734520222 100644 --- a/airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py +++ b/airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py @@ -15,10 +15,10 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""DAG demonstrating various options for a trigger form generated by DAG params. +"""Dag demonstrating various options for a trigger form generated by Dag params. -The DAG attribute `params` is used to define a default dictionary of parameters which are usually passed -to the DAG and which are used to render a trigger form. +The Dag attribute `params` is used to define a default dictionary of parameters which are usually passed +to the Dag and which are used to render a trigger form. """ from __future__ import annotations @@ -113,7 +113,7 @@ # Fields can be required or not. If the defined fields are typed they are getting required by default # (else they would not pass JSON schema validation) - to make typed fields optional you must # permit the optional "null" type. - # You can omit a default value if the DAG is triggered manually + # You can omit a default value if the Dag is triggered manually # [START section_2] "required_field": Param( # In this example we have no default value @@ -244,7 +244,7 @@ @task(task_display_name="Show used parameters") def show_params(**kwargs) -> None: params = kwargs["params"] - print(f"This DAG was triggered with the following parameters:\n\n{json.dumps(params, indent=4)}\n") + print(f"This Dag was triggered with the following parameters:\n\n{json.dumps(params, indent=4)}\n") show_params() # [END section_3] diff --git a/airflow-core/src/airflow/example_dags/example_passing_params_via_test_command.py b/airflow-core/src/airflow/example_dags/example_passing_params_via_test_command.py index 9e4d3bf477845..10526dc187105 100644 --- a/airflow-core/src/airflow/example_dags/example_passing_params_via_test_command.py +++ b/airflow-core/src/airflow/example_dags/example_passing_params_via_test_command.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the params arguments in templated arguments.""" +"""Example Dag demonstrating the usage of the params arguments in templated arguments.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_setup_teardown.py b/airflow-core/src/airflow/example_dags/example_setup_teardown.py index 052377736ea59..119757f546266 100644 --- a/airflow-core/src/airflow/example_dags/example_setup_teardown.py +++ b/airflow-core/src/airflow/example_dags/example_setup_teardown.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of setup and teardown tasks.""" +"""Example Dag demonstrating the usage of setup and teardown tasks.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_setup_teardown_taskflow.py b/airflow-core/src/airflow/example_dags/example_setup_teardown_taskflow.py index 8b68f85ef826d..12361d7e1b4da 100644 --- a/airflow-core/src/airflow/example_dags/example_setup_teardown_taskflow.py +++ b/airflow-core/src/airflow/example_dags/example_setup_teardown_taskflow.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of setup and teardown tasks.""" +"""Example Dag demonstrating the usage of setup and teardown tasks.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_simplest_dag.py b/airflow-core/src/airflow/example_dags/example_simplest_dag.py index 660f38c2e00e1..e4d8c4de7aaba 100644 --- a/airflow-core/src/airflow/example_dags/example_simplest_dag.py +++ b/airflow-core/src/airflow/example_dags/example_simplest_dag.py @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the simplest use of the `@dag` decorator.""" +"""Example Dag demonstrating the simplest use of the `@dag` decorator.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_skip_dag.py b/airflow-core/src/airflow/example_dags/example_skip_dag.py index 7b87dd732c1f0..7b7d9042197fa 100644 --- a/airflow-core/src/airflow/example_dags/example_skip_dag.py +++ b/airflow-core/src/airflow/example_dags/example_skip_dag.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the EmptyOperator and a custom EmptySkipOperator which skips by default.""" +"""Example Dag demonstrating the EmptyOperator and a custom EmptySkipOperator which skips by default.""" from __future__ import annotations @@ -48,7 +48,7 @@ def create_test_pipeline(suffix, trigger_rule): :param str suffix: Suffix to append to the operator task_ids :param str trigger_rule: TriggerRule for the join task - :param DAG dag_: The DAG to run the operators on + :param Dag dag_: The Dag to run the operators on """ skip_operator = EmptySkipOperator(task_id=f"skip_operator_{suffix}") always_true = EmptyOperator(task_id=f"always_true_{suffix}") diff --git a/airflow-core/src/airflow/example_dags/example_task_group.py b/airflow-core/src/airflow/example_dags/example_task_group.py index c882c269c476b..7514bba22e1b8 100644 --- a/airflow-core/src/airflow/example_dags/example_task_group.py +++ b/airflow-core/src/airflow/example_dags/example_task_group.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the TaskGroup.""" +"""Example Dag demonstrating the usage of the TaskGroup.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_task_group_decorator.py b/airflow-core/src/airflow/example_dags/example_task_group_decorator.py index 5ed2a59ae3b64..8fcfde839b369 100644 --- a/airflow-core/src/airflow/example_dags/example_task_group_decorator.py +++ b/airflow-core/src/airflow/example_dags/example_task_group_decorator.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the @taskgroup decorator.""" +"""Example Dag demonstrating the usage of the @taskgroup decorator.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_time_delta_sensor_async.py b/airflow-core/src/airflow/example_dags/example_time_delta_sensor_async.py index 726fa2cf5c5df..491dcaa9cc39b 100644 --- a/airflow-core/src/airflow/example_dags/example_time_delta_sensor_async.py +++ b/airflow-core/src/airflow/example_dags/example_time_delta_sensor_async.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating ``TimeDeltaSensor``, that defers and doesn't occupy a worker slot while it waits +Example Dag demonstrating ``TimeDeltaSensor``, that defers and doesn't occupy a worker slot while it waits """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_trigger_target_dag.py b/airflow-core/src/airflow/example_dags/example_trigger_target_dag.py index 3de96ebc21277..3e7e6015cf538 100644 --- a/airflow-core/src/airflow/example_dags/example_trigger_target_dag.py +++ b/airflow-core/src/airflow/example_dags/example_trigger_target_dag.py @@ -16,9 +16,9 @@ # specific language governing permissions and limitations # under the License. """ -Example usage of the TriggerDagRunOperator. This example holds 2 DAGs: -1. 1st DAG (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG -2. 2nd DAG (example_trigger_target_dag) which will be triggered by the TriggerDagRunOperator in the 1st DAG +Example usage of the TriggerDagRunOperator. This example holds 2 Dags: +1. 1st Dag (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG +2. 2nd Dag (example_trigger_target_dag) which will be triggered by the TriggerDagRunOperator in the 1st DAG """ from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_xcom.py b/airflow-core/src/airflow/example_dags/example_xcom.py index 8b8bc5bebd770..7ca8474b33e15 100644 --- a/airflow-core/src/airflow/example_dags/example_xcom.py +++ b/airflow-core/src/airflow/example_dags/example_xcom.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of XComs.""" +"""Example Dag demonstrating the usage of XComs.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/example_xcomargs.py b/airflow-core/src/airflow/example_dags/example_xcomargs.py index a64beb513baef..01b21f97400a1 100644 --- a/airflow-core/src/airflow/example_dags/example_xcomargs.py +++ b/airflow-core/src/airflow/example_dags/example_xcomargs.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the XComArgs.""" +"""Example Dag demonstrating the usage of the XComArgs.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/example_dags/plugins/decreasing_priority_weight_strategy.py b/airflow-core/src/airflow/example_dags/plugins/decreasing_priority_weight_strategy.py index 3335b7da4ee77..eda5ecb999c11 100644 --- a/airflow-core/src/airflow/example_dags/plugins/decreasing_priority_weight_strategy.py +++ b/airflow-core/src/airflow/example_dags/plugins/decreasing_priority_weight_strategy.py @@ -27,7 +27,7 @@ # [START custom_priority_weight_strategy] class DecreasingPriorityStrategy(PriorityWeightStrategy): - """A priority weight strategy that decreases the priority weight with each attempt of the DAG task.""" + """A priority weight strategy that decreases the priority weight with each attempt of the Dag task.""" def get_weight(self, ti: TaskInstance): return max(3 - ti.try_number + 1, 1) diff --git a/airflow-core/src/airflow/example_dags/plugins/workday.py b/airflow-core/src/airflow/example_dags/plugins/workday.py index c0749bfaba285..420b8cc6e2a21 100644 --- a/airflow-core/src/airflow/example_dags/plugins/workday.py +++ b/airflow-core/src/airflow/example_dags/plugins/workday.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Plugin to demonstrate timetable registration and accommodate example DAGs.""" +"""Plugin to demonstrate timetable registration and accommodate example Dags.""" from __future__ import annotations @@ -79,7 +79,7 @@ def next_dagrun_info( elif (earliest := restriction.earliest) is None: return None # No start_date. Don't schedule. elif not restriction.catchup: - # If the DAG has catchup=False, today is the earliest to consider. + # If the Dag has catchup=False, today is the earliest to consider. next_start = max(earliest, DateTime.combine(Date.today(), Time.min, tzinfo=UTC)) elif earliest.time() != Time.min: # If earliest does not fall on midnight, skip to the next day. diff --git a/airflow-core/src/airflow/example_dags/tutorial.py b/airflow-core/src/airflow/example_dags/tutorial.py index 7e12eb454695f..5e9e14f7598fc 100644 --- a/airflow-core/src/airflow/example_dags/tutorial.py +++ b/airflow-core/src/airflow/example_dags/tutorial.py @@ -31,7 +31,7 @@ # Operators; we need this to operate! from airflow.providers.standard.operators.bash import BashOperator -# The DAG object; we'll need this to instantiate a DAG +# The Dag object; we'll need this to instantiate a DAG from airflow.sdk import DAG # [END import_module] diff --git a/airflow-core/src/airflow/example_dags/tutorial_dag.py b/airflow-core/src/airflow/example_dags/tutorial_dag.py index 0f891e5dd7876..250867bc803e2 100644 --- a/airflow-core/src/airflow/example_dags/tutorial_dag.py +++ b/airflow-core/src/airflow/example_dags/tutorial_dag.py @@ -16,8 +16,8 @@ # specific language governing permissions and limitations # under the License. """ -### DAG Tutorial Documentation -This DAG is demonstrating an Extract -> Transform -> Load pipeline +### Dag Tutorial Documentation +This Dag is demonstrating an Extract -> Transform -> Load pipeline """ from __future__ import annotations @@ -32,7 +32,7 @@ # Operators; we need this to operate! from airflow.providers.standard.operators.python import PythonOperator -# The DAG object; we'll need this to instantiate a DAG +# The Dag object; we'll need this to instantiate a DAG from airflow.sdk import DAG # [END import_module] @@ -45,7 +45,7 @@ # You can override them on a per-task basis during operator initialization default_args={"retries": 2}, # [END default_args] - description="DAG tutorial", + description="Dag tutorial", schedule=None, start_date=pendulum.datetime(2021, 1, 1, tz="UTC"), catchup=False, diff --git a/airflow-core/src/airflow/example_dags/tutorial_objectstorage.py b/airflow-core/src/airflow/example_dags/tutorial_objectstorage.py index 66620122d6045..c761ed56f5a57 100644 --- a/airflow-core/src/airflow/example_dags/tutorial_objectstorage.py +++ b/airflow-core/src/airflow/example_dags/tutorial_objectstorage.py @@ -56,7 +56,7 @@ def tutorial_objectstorage(): """ ### Object Storage Tutorial Documentation - This is a tutorial DAG to showcase the usage of the Object Storage API. + This is a tutorial Dag to showcase the usage of the Object Storage API. Documentation that goes along with the Airflow Object Storage tutorial is located [here](https://airflow.apache.org/docs/apache-airflow/stable/tutorial/objectstorage.html) diff --git a/airflow-core/src/airflow/exceptions.py b/airflow-core/src/airflow/exceptions.py index 150bbc3ffb312..ba4d60df44009 100644 --- a/airflow-core/src/airflow/exceptions.py +++ b/airflow-core/src/airflow/exceptions.py @@ -173,7 +173,7 @@ def serialize(self): class AirflowDagDuplicatedIdException(AirflowException): - """Raise when a DAG's ID is already used by another DAG.""" + """Raise when a Dag's ID is already used by another Dag.""" def __init__(self, dag_id: str, incoming: str, existing: str) -> None: super().__init__(dag_id, incoming, existing) @@ -182,15 +182,15 @@ def __init__(self, dag_id: str, incoming: str, existing: str) -> None: self.existing = existing def __str__(self) -> str: - return f"Ignoring DAG {self.dag_id} from {self.incoming} - also found in {self.existing}" + return f"Ignoring Dag {self.dag_id} from {self.incoming} - also found in {self.existing}" class AirflowClusterPolicyViolation(AirflowException): - """Raise when there is a violation of a Cluster Policy in DAG definition.""" + """Raise when there is a violation of a Cluster Policy in Dag definition.""" class AirflowClusterPolicySkipDag(AirflowException): - """Raise when skipping dag is needed in Cluster Policy.""" + """Raise when skipping Dag is needed in Cluster Policy.""" class AirflowClusterPolicyError(AirflowException): @@ -198,26 +198,26 @@ class AirflowClusterPolicyError(AirflowException): class AirflowTimetableInvalid(AirflowException): - """Raise when a DAG has an invalid timetable.""" + """Raise when a Dag has an invalid timetable.""" class DagNotFound(AirflowNotFoundException): - """Raise when a DAG is not available in the system.""" + """Raise when a Dag is not available in the system.""" class DagCodeNotFound(AirflowNotFoundException): - """Raise when a DAG code is not available in the system.""" + """Raise when a Dag code is not available in the system.""" class DagRunNotFound(AirflowNotFoundException): - """Raise when a DAG Run is not available in the system.""" + """Raise when a Dag Run is not available in the system.""" class DagRunAlreadyExists(AirflowBadRequest): - """Raise when creating a DAG run for DAG which already has DAG run entry.""" + """Raise when creating a Dag run for Dag which already has Dag run entry.""" def __init__(self, dag_run: DagRun) -> None: - super().__init__(f"A DAG Run already exists for DAG {dag_run.dag_id} with run id {dag_run.run_id}") + super().__init__(f"A Dag Run already exists for Dag {dag_run.dag_id} with run id {dag_run.run_id}") self.dag_run = dag_run def serialize(self): @@ -240,7 +240,7 @@ def serialize(self): class DuplicateTaskIdFound(AirflowException): - """Raise when a Task with duplicate task_id is defined in the same DAG.""" + """Raise when a Task with duplicate task_id is defined in the same Dag.""" class TaskAlreadyInTaskGroup(AirflowException): @@ -265,7 +265,7 @@ class SerializationError(AirflowException): class ParamValidationError(AirflowException): - """Raise when DAG params is invalid.""" + """Raise when Dag params is invalid.""" class TaskNotFound(AirflowNotFoundException): diff --git a/airflow-core/src/airflow/executors/workloads.py b/airflow-core/src/airflow/executors/workloads.py index 43a4aab1dbc47..e1e1982c33fdb 100644 --- a/airflow-core/src/airflow/executors/workloads.py +++ b/airflow-core/src/airflow/executors/workloads.py @@ -90,7 +90,7 @@ class ExecuteTask(BaseWorkload): ti: TaskInstance """The TaskInstance to execute""" dag_rel_path: os.PathLike[str] - """The filepath where the DAG can be found (likely prefixed with `DAG_FOLDER/`)""" + """The filepath where the Dag can be found (likely prefixed with `DAG_FOLDER/`)""" bundle_info: BundleInfo diff --git a/airflow-core/src/airflow/jobs/scheduler_job_runner.py b/airflow-core/src/airflow/jobs/scheduler_job_runner.py index 89c9c2c7bfcf2..0b024573db009 100644 --- a/airflow-core/src/airflow/jobs/scheduler_job_runner.py +++ b/airflow-core/src/airflow/jobs/scheduler_job_runner.py @@ -119,7 +119,7 @@ class ConcurrencyMap: It contains a map from (dag_id, task_id) to # of task instances, a map from (dag_id, task_id) to # of task instances in the given state list and a map from (dag_id, run_id, task_id) - to # of task instances in the given state list in each DAG run. + to # of task instances in the given state list in each Dag run. """ def __init__(self): @@ -159,10 +159,10 @@ class SchedulerJobRunner(BaseJobRunner, LoggingMixin): It figures out the latest runs for each task and sees if the dependencies for the next schedules are met. If so, it creates appropriate TaskInstances and sends run commands to the - executor. It does this for each task in each DAG and repeats. + executor. It does this for each task in each Dag and repeats. :param num_runs: The number of times to run the scheduling loop. If you - have a large number of DAG files this could complete before each file + have a large number of Dag files this could complete before each file has been parsed. -1 for unlimited times. :param scheduler_idle_sleep_time: The number of seconds to wait between polls of running processors @@ -297,11 +297,11 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session) - Conditions include: - pool limits - - DAG max_active_tasks + - Dag max_active_tasks - executor state - priority - max active tis per DAG - - max active tis per DAG run + - max active tis per Dag run :param max_tis: Maximum number of TIs to queue in this loop. :return: list[airflow.models.TaskInstance] @@ -478,14 +478,14 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session) - # Though we can execute tasks with lower priority if there's enough room continue - # Check to make sure that the task max_active_tasks of the DAG hasn't been + # Check to make sure that the task max_active_tasks of the Dag hasn't been # reached. dag_id = task_instance.dag_id dag_run_key = (dag_id, task_instance.run_id) current_active_tasks_per_dag_run = concurrency_map.dag_run_active_tasks_map[dag_run_key] dag_max_active_tasks = task_instance.dag_model.max_active_tasks self.log.info( - "DAG %s has %s/%s running and queued tasks", + "Dag %s has %s/%s running and queued tasks", dag_id, current_active_tasks_per_dag_run, dag_max_active_tasks, @@ -493,7 +493,7 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session) - if current_active_tasks_per_dag_run >= dag_max_active_tasks: self.log.info( "Not executing %s since the number of tasks running or queued " - "from DAG %s is >= to the DAG's max_active_tasks limit of %s", + "from Dag %s is >= to the DAG's max_active_tasks limit of %s", task_instance, dag_id, dag_max_active_tasks, @@ -503,14 +503,14 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session) - if task_instance.dag_model.has_task_concurrency_limits: # Many dags don't have a task_concurrency, so where we can avoid loading the full - # serialized DAG the better. + # serialized Dag the better. serialized_dag = self.scheduler_dag_bag.get_dag_for_run( dag_run=task_instance.dag_run, session=session ) # If the dag is missing, fail the task and continue to the next task. if not serialized_dag: self.log.error( - "DAG '%s' for task instance %s not found in serialized_dag table", + "Dag '%s' for task instance %s not found in serialized_dag table", dag_id, task_instance, ) @@ -554,7 +554,7 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session) - if current_task_dagrun_concurrency >= task_dagrun_concurrency_limit: self.log.info( - "Not executing %s since the task concurrency per DAG run for" + "Not executing %s since the task concurrency per Dag run for" " this task has been reached.", task_instance, ) @@ -679,7 +679,7 @@ def _critical_section_enqueue_task_instances(self, session: Session) -> int: HA note: This function is a "critical section" meaning that only a single scheduler process can execute this function at the same time. This is achieved by doing ``SELECT ... from pool FOR UPDATE``. For DBs that support NOWAIT, a "blocked" scheduler will skip - this and continue on with other tasks (creating new DAG runs, progressing TIs from None to SCHEDULED + this and continue on with other tasks (creating new Dag runs, progressing TIs from None to SCHEDULED etc.); DBs that don't support this (such as MariaDB or MySQL 5.x) the other schedulers will wait for the lock before continuing. @@ -753,7 +753,7 @@ def process_executor_events( Respond to executor events. This is a classmethod because this is also used in `dag.test()`. - `dag.test` execute DAGs with no scheduler, therefore it needs to handle the events pushed by the + `dag.test` execute Dags with no scheduler, therefore it needs to handle the events pushed by the executors as well. """ ti_primary_key_to_try_number_map: dict[tuple[str, str, str, int], int] = {} @@ -885,7 +885,7 @@ def process_executor_events( try: dag = scheduler_dag_bag.get_dag_for_run(dag_run=ti.dag_run, session=session) cls.logger().error( - "DAG '%s' for task instance %s not found in serialized_dag table", + "Dag '%s' for task instance %s not found in serialized_dag table", ti.dag_id, ti, ) @@ -1184,10 +1184,10 @@ def _recreate_unhealthy_scheduler_spans_if_needed(self, dag_run: DagRun, session def _run_scheduler_loop(self) -> None: """ - Harvest DAG parsing results, queue tasks, and perform executor heartbeat; the actual scheduler loop. + Harvest Dag parsing results, queue tasks, and perform executor heartbeat; the actual scheduler loop. The main steps in the loop are: - #. Harvest DAG parsing results through DagFileProcessorAgent + #. Harvest Dag parsing results through DagFileProcessorAgent #. Find and queue executable tasks #. Change task instance state in DB #. Queue tasks in executor @@ -1354,14 +1354,14 @@ def _do_scheduling(self, session: Session) -> int: Make the main scheduling decisions. It: - - Creates any necessary DAG runs by examining the next_dagrun_create_after column of DagModel + - Creates any necessary Dag runs by examining the next_dagrun_create_after column of DagModel Since creating Dag Runs is a relatively time consuming process, we select only 10 dags by default (configurable via ``scheduler.max_dagruns_to_create_per_loop`` setting) - putting this higher will mean one scheduler could spend a chunk of time creating dag runs, and not ever get around to scheduling tasks. - - Finds the "next n oldest" running DAG Runs to examine for scheduling (n=20 by default, configurable + - Finds the "next n oldest" running Dag Runs to examine for scheduling (n=20 by default, configurable via ``scheduler.max_dagruns_per_loop_to_schedule`` config setting) and tries to progress state (TIs to SCHEDULED, or DagRuns to SUCCESS/FAILURE etc) @@ -1369,8 +1369,8 @@ def _do_scheduling(self, session: Session) -> int: We don't select all dagruns at once, because the rows are selected with row locks, meaning that only one scheduler can "process them", even it is waiting behind other dags. Increasing this - limit will allow more throughput for smaller DAGs but will likely slow down throughput for larger - (>500 tasks.) DAGs + limit will allow more throughput for smaller Dags but will likely slow down throughput for larger + (>500 tasks.) Dags - Then, via a Critical Section (locking the rows of the Pool model) we queue tasks, and then send them to the executor. @@ -1404,7 +1404,7 @@ def _do_scheduling(self, session: Session) -> int: # Sending callbacks to the database, so it must be done outside of prohibit_commit. self._send_dag_callbacks_to_processor(dag, callback_to_run) else: - self.log.error("DAG '%s' not found in serialized_dag table", dag_run.dag_id) + self.log.error("Dag '%s' not found in serialized_dag table", dag_run.dag_id) with prohibit_commit(session) as guard: # Without this, the session has an invalid view of the DB @@ -1487,7 +1487,7 @@ def _mark_backfills_complete(self, session: Session = NEW_SESSION) -> None: @add_debug_span def _create_dag_runs(self, dag_models: Collection[DagModel], session: Session) -> None: - """Create a DAG run and update the dag_model to control if/when the next DAGRun should be created.""" + """Create a Dag run and update the dag_model to control if/when the next DAGRun should be created.""" # Bulk Fetch DagRuns with dag_id and logical_date same # as DagModel.dag_id and DagModel.next_dagrun # This list is used to verify if the DagRun already exist so that we don't attempt to create @@ -1518,7 +1518,7 @@ def _create_dag_runs(self, dag_models: Collection[DagModel], session: Session) - for dag_model in dag_models: dag = _get_current_dag(dag_id=dag_model.dag_id, session=session) if not dag: - self.log.error("DAG '%s' not found in serialized_dag table", dag_model.dag_id) + self.log.error("Dag '%s' not found in serialized_dag table", dag_model.dag_id) continue data_interval = dag.get_next_data_interval(dag_model) @@ -1572,7 +1572,7 @@ def _create_dag_runs_asset_triggered( triggered_date_by_dag: dict[str, datetime], session: Session, ) -> None: - """For DAGs that are triggered by assets, create dag runs.""" + """For Dags that are triggered by assets, create dag runs.""" triggered_dates: dict[str, DateTime] = { dag_id: timezone.coerce_datetime(last_asset_event_time) for dag_id, last_asset_event_time in triggered_date_by_dag.items() @@ -1581,12 +1581,12 @@ def _create_dag_runs_asset_triggered( for dag_model in dag_models: dag = _get_current_dag(dag_id=dag_model.dag_id, session=session) if not dag: - self.log.error("DAG '%s' not found in serialized_dag table", dag_model.dag_id) + self.log.error("Dag '%s' not found in serialized_dag table", dag_model.dag_id) continue if not isinstance(dag.timetable, AssetTriggeredTimetable): self.log.error( - "DAG '%s' was asset-scheduled, but didn't have an AssetTriggeredTimetable!", + "Dag '%s' was asset-scheduled, but didn't have an AssetTriggeredTimetable!", dag_model.dag_id, ) continue @@ -1650,13 +1650,13 @@ def _should_update_dag_next_dagruns( session: Session, ) -> bool: """Check if the dag's next_dagruns_create_after should be updated.""" - # If last_dag_run is defined, the update was triggered by a scheduling decision in this DAG run. + # If last_dag_run is defined, the update was triggered by a scheduling decision in this Dag run. # In such case, schedule next only if last_dag_run is finished and was an automated run. if last_dag_run and not ( last_dag_run.state in State.finished_dr_states and last_dag_run.run_type == DagRunType.SCHEDULED ): return False - # If the DAG never schedules skip save runtime + # If the Dag never schedules skip save runtime if not dag.timetable.can_be_scheduled: return False @@ -1670,7 +1670,7 @@ def _should_update_dag_next_dagruns( if active_non_backfill_runs >= dag.max_active_runs: self.log.info( - "DAG %s is at (or above) max_active_runs (%d of %d), not creating any more runs", + "Dag %s is at (or above) max_active_runs (%d of %d), not creating any more runs", dag_model.dag_id, active_non_backfill_runs, dag.max_active_runs, @@ -1751,7 +1751,7 @@ def _update_state(dag: DAG, dag_run: DagRun): backfill = dag_run.backfill dag = dag_run.dag = cached_get_dag(dag_run) if not dag: - self.log.error("DAG '%s' not found in serialized_dag table", dag_run.dag_id) + self.log.error("Dag '%s' not found in serialized_dag table", dag_run.dag_id) continue active_runs = active_runs_of_dags[(dag_id, backfill_id)] if backfill_id is not None: @@ -1834,7 +1834,7 @@ def _schedule_dag_run( dag_model = DM.get_dagmodel(dag_run.dag_id, session) if not dag or not dag_model: - self.log.error("Couldn't find DAG %s in DAG bag or database!", dag_run.dag_id) + self.log.error("Couldn't find Dag %s in Dag bag or database!", dag_run.dag_id) return callback if ( @@ -1897,7 +1897,7 @@ def _schedule_dag_run( dag_run=dag_run, session=session ): self.log.warning( - "The DAG disappeared before verifying integrity: %s. Skipping.", dag_run.dag_id + "The Dag disappeared before verifying integrity: %s. Skipping.", dag_run.dag_id ) return callback @@ -1937,16 +1937,16 @@ def _schedule_dag_run( def _verify_integrity_if_dag_changed(self, dag_run: DagRun, session: Session) -> bool: """ - Only run DagRun.verify integrity if Serialized DAG has changed since it is slow. + Only run DagRun.verify integrity if Serialized Dag has changed since it is slow. - Return True if we determine that DAG still exists. + Return True if we determine that Dag still exists. """ latest_dag_version = DagVersion.get_latest_version(dag_run.dag_id, session=session) if TYPE_CHECKING: assert latest_dag_version if dag_run.check_version_id_exists_in_dr(latest_dag_version.id, session): - self.log.debug("DAG %s not changed structure, skipping dagrun.verify_integrity", dag_run.dag_id) + self.log.debug("Dag %s not changed structure, skipping dagrun.verify_integrity", dag_run.dag_id) return True # Refresh the DAG dag_run.dag = self.scheduler_dag_bag.get_dag_for_run(dag_run=dag_run, session=session) @@ -2042,7 +2042,7 @@ def _maybe_requeue_stuck_ti(self, *, ti, session, executor): task = dag.get_task(ti.task_id) except Exception: self.log.warning( - "The DAG or task could not be found. If a failure callback exists, it will not be run.", + "The Dag or task could not be found. If a failure callback exists, it will not be run.", exc_info=True, ) else: @@ -2293,7 +2293,7 @@ def _find_and_purge_task_instances_without_heartbeats(self) -> None: have a no-longer-running LocalTaskJob will be failed by the scheduler. A TaskCallbackRequest is also created for the killed task instance to be - handled by the DAG processor, and the executor is informed to no longer + handled by the Dag processor, and the executor is informed to no longer count the task instance as running when it calculates parallelism. """ with create_session() as session: @@ -2385,7 +2385,7 @@ def _purge_task_instances_without_heartbeats( @staticmethod def _generate_task_instance_heartbeat_timeout_message_details(ti: TI) -> dict[str, Any]: task_instance_heartbeat_timeout_message_details = { - "DAG Id": ti.dag_id, + "Dag Id": ti.dag_id, "Task Id": ti.task_id, "Run Id": ti.run_id, } @@ -2417,7 +2417,7 @@ def _update_asset_orphanage(self, session: Session = NEW_SESSION) -> None: """ Check assets orphanization and update their active entry. - An orphaned asset is no longer referenced in any DAG schedule parameters + An orphaned asset is no longer referenced in any Dag schedule parameters or task outlets. Active assets (non-orphaned) have entries in AssetActive and must have unique names and URIs. @@ -2559,8 +2559,8 @@ def _try_to_load_executor(self, executor_name: str | None) -> BaseExecutor | Non return e # This case should not happen unless some (as of now unknown) edge case occurs or direct DB - # modification, since the DAG parser will validate the tasks in the DAG and ensure the executor - # they request is available and if not, disallow the DAG to be scheduled. + # modification, since the Dag parser will validate the tasks in the Dag and ensure the executor + # they request is available and if not, disallow the Dag to be scheduled. # Keeping this exception handling because this is a critical issue if we do somehow find # ourselves here and the user should get some feedback about that. self.log.warning("Executor, %s, was not found but a Task was configured to use it", executor_name) diff --git a/airflow-core/src/airflow/jobs/triggerer_job_runner.py b/airflow-core/src/airflow/jobs/triggerer_job_runner.py index ba85d00f18ae5..24065bade1121 100644 --- a/airflow-core/src/airflow/jobs/triggerer_job_runner.py +++ b/airflow-core/src/airflow/jobs/triggerer_job_runner.py @@ -102,7 +102,7 @@ class TriggererJobRunner(BaseJobRunner, LoggingMixin): """ - Run active triggers in asyncio and update their dependent tests/DAGs once their events have fired. + Run active triggers in asyncio and update their dependent tests/Dags once their events have fired. It runs as two threads: - The main thread does DB calls/checkins diff --git a/airflow-core/src/airflow/listeners/spec/dagrun.py b/airflow-core/src/airflow/listeners/spec/dagrun.py index 3337f4b9a16ce..d743f009172e4 100644 --- a/airflow-core/src/airflow/listeners/spec/dagrun.py +++ b/airflow-core/src/airflow/listeners/spec/dagrun.py @@ -29,14 +29,14 @@ @hookspec def on_dag_run_running(dag_run: DagRun, msg: str): - """Execute when dag run state changes to RUNNING.""" + """Execute when Dag run state changes to RUNNING.""" @hookspec def on_dag_run_success(dag_run: DagRun, msg: str): - """Execute when dag run state changes to SUCCESS.""" + """Execute when Dag run state changes to SUCCESS.""" @hookspec def on_dag_run_failed(dag_run: DagRun, msg: str): - """Execute when dag run state changes to FAIL.""" + """Execute when Dag run state changes to FAIL.""" diff --git a/airflow-core/src/airflow/listeners/spec/importerrors.py b/airflow-core/src/airflow/listeners/spec/importerrors.py index 2cb2b4e454d37..786ebf33f66ec 100644 --- a/airflow-core/src/airflow/listeners/spec/importerrors.py +++ b/airflow-core/src/airflow/listeners/spec/importerrors.py @@ -24,9 +24,9 @@ @hookspec def on_new_dag_import_error(filename, stacktrace): - """Execute when new dag import error appears.""" + """Execute when new Dag import error appears.""" @hookspec def on_existing_dag_import_error(filename, stacktrace): - """Execute when existing dag import error appears.""" + """Execute when existing Dag import error appears.""" diff --git a/airflow-core/src/airflow/migrations/versions/0029_3_0_0_remove_is_subdag.py b/airflow-core/src/airflow/migrations/versions/0029_3_0_0_remove_is_subdag.py index cb652f647d10c..90f657fe1b254 100644 --- a/airflow-core/src/airflow/migrations/versions/0029_3_0_0_remove_is_subdag.py +++ b/airflow-core/src/airflow/migrations/versions/0029_3_0_0_remove_is_subdag.py @@ -17,7 +17,7 @@ # under the License. """ -Remove SubDAGs: ``is_subdag`` & ``root_dag_id`` columns from DAG table. +Remove SubDags: ``is_subdag`` & ``root_dag_id`` columns from Dag table. Revision ID: d0f1c55954fa Revises: 044f740568ec @@ -41,7 +41,7 @@ def upgrade(): - """Remove ``is_subdag`` column from DAGs table.""" + """Remove ``is_subdag`` column from Dags table.""" with op.batch_alter_table("dag") as batch_op: batch_op.drop_column("is_subdag") batch_op.drop_index("idx_root_dag_id") @@ -49,7 +49,7 @@ def upgrade(): def downgrade(): - """Add ``is_subdag`` column in DAGs table.""" + """Add ``is_subdag`` column in Dags table.""" with op.batch_alter_table("dag", schema=None) as batch_op: batch_op.add_column(sa.Column("is_subdag", sa.BOOLEAN(), nullable=True)) batch_op.add_column(sa.Column("root_dag_id", StringID(), nullable=True)) diff --git a/airflow-core/src/airflow/migrations/versions/0032_3_0_0_rename_execution_date_to_logical_date_and_nullable.py b/airflow-core/src/airflow/migrations/versions/0032_3_0_0_rename_execution_date_to_logical_date_and_nullable.py index 742d5ed6b742a..00e6f3e711522 100644 --- a/airflow-core/src/airflow/migrations/versions/0032_3_0_0_rename_execution_date_to_logical_date_and_nullable.py +++ b/airflow-core/src/airflow/migrations/versions/0032_3_0_0_rename_execution_date_to_logical_date_and_nullable.py @@ -94,7 +94,7 @@ def _move_offending_dagruns(): # end up with an empty offending table. Leave a note for the user to drop it # themselves after review. if offline: - op.execute(f"-- TODO: DAG runs unable to be downgraded are moved to {offending_table_name}.") + op.execute(f"-- TODO: Dag runs unable to be downgraded are moved to {offending_table_name}.") op.execute(f"-- TODO: Table {offending_table_name} can be removed after contained data are reviewed.") # Remove offending rows so we can continue downgrade. diff --git a/airflow-core/src/airflow/migrations/versions/0046_3_0_0_drop_dag_pickling.py b/airflow-core/src/airflow/migrations/versions/0046_3_0_0_drop_dag_pickling.py index 599759fa9f86a..44a4222d6af5f 100644 --- a/airflow-core/src/airflow/migrations/versions/0046_3_0_0_drop_dag_pickling.py +++ b/airflow-core/src/airflow/migrations/versions/0046_3_0_0_drop_dag_pickling.py @@ -17,7 +17,7 @@ # under the License. """ -Drop DAG pickling. +Drop Dag pickling. Revision ID: d03e4a635aa3 Revises: d8cd3297971e @@ -41,7 +41,7 @@ def upgrade(): - """Drop DAG pickling.""" + """Drop Dag pickling.""" with op.batch_alter_table("dag", schema=None) as batch_op: batch_op.drop_column("pickle_id") batch_op.drop_column("last_pickled") @@ -50,7 +50,7 @@ def upgrade(): def downgrade(): - """Re-Add DAG pickling.""" + """Re-Add Dag pickling.""" import dill with op.batch_alter_table("dag", schema=None) as batch_op: diff --git a/airflow-core/src/airflow/migrations/versions/0067_3_0_0_rename_is_active_to_is_stale_column_in_.py b/airflow-core/src/airflow/migrations/versions/0067_3_0_0_rename_is_active_to_is_stale_column_in_.py index 09b0aa8e1d6e6..fabdaf713553c 100644 --- a/airflow-core/src/airflow/migrations/versions/0067_3_0_0_rename_is_active_to_is_stale_column_in_.py +++ b/airflow-core/src/airflow/migrations/versions/0067_3_0_0_rename_is_active_to_is_stale_column_in_.py @@ -37,7 +37,7 @@ def upgrade(): - """Rename is_active to is_stale column in DAG table.""" + """Rename is_active to is_stale column in Dag table.""" with op.batch_alter_table("dag", schema=None) as batch_op: batch_op.alter_column("is_active", new_column_name="is_stale", type_=sa.Boolean) @@ -45,7 +45,7 @@ def upgrade(): def downgrade(): - """Revert renaming of is_active to is_stale column in DAG table.""" + """Revert renaming of is_active to is_stale column in Dag table.""" with op.batch_alter_table("dag", schema=None) as batch_op: batch_op.alter_column("is_stale", new_column_name="is_active", type_=sa.Boolean) diff --git a/airflow-core/src/airflow/models/asset.py b/airflow-core/src/airflow/models/asset.py index 8b28f2bea6184..049d932a35a73 100644 --- a/airflow-core/src/airflow/models/asset.py +++ b/airflow-core/src/airflow/models/asset.py @@ -326,7 +326,7 @@ class AssetActive(Base): """ Collection of active assets. - An asset is considered active if it is declared by the user in any DAG files. + An asset is considered active if it is declared by the user in any Dag files. AssetModel entries that are not active (also called orphaned in some parts of the code base) are still kept in the database, but have their corresponding entries in this table removed. This ensures we keep all possible history on @@ -380,7 +380,7 @@ def for_asset(cls, asset: AssetModel) -> AssetActive: class DagScheduleAssetNameReference(Base): - """Reference from a DAG to an asset name reference of which it is a consumer.""" + """Reference from a Dag to an asset name reference of which it is a consumer.""" name = Column( String(length=1500).with_variant( @@ -426,7 +426,7 @@ def __repr__(self): class DagScheduleAssetUriReference(Base): - """Reference from a DAG to an asset URI reference of which it is a consumer.""" + """Reference from a Dag to an asset URI reference of which it is a consumer.""" uri = Column( String(length=1500).with_variant( @@ -472,7 +472,7 @@ def __repr__(self): class DagScheduleAssetAliasReference(Base): - """References from a DAG to an asset alias of which it is a consumer.""" + """References from a Dag to an asset alias of which it is a consumer.""" alias_id = Column(Integer, primary_key=True, nullable=False) dag_id = Column(StringID(), primary_key=True, nullable=False) @@ -514,7 +514,7 @@ def __repr__(self): class DagScheduleAssetReference(Base): - """References from a DAG to an asset of which it is a consumer.""" + """References from a Dag to an asset of which it is a consumer.""" asset_id = Column(Integer, primary_key=True, nullable=False) dag_id = Column(StringID(), primary_key=True, nullable=False) diff --git a/airflow-core/src/airflow/models/backfill.py b/airflow-core/src/airflow/models/backfill.py index 4142265b8bd44..c4e1360341ce8 100644 --- a/airflow-core/src/airflow/models/backfill.py +++ b/airflow-core/src/airflow/models/backfill.py @@ -70,7 +70,7 @@ class AlreadyRunningBackfill(AirflowException): class DagNoScheduleException(AirflowException): """ - Raised when attempting to create backfill for a DAG with no schedule. + Raised when attempting to create backfill for a Dag with no schedule. :meta private: """ @@ -164,7 +164,7 @@ class BackfillDagRunExceptionReason(str, Enum): class BackfillDagRun(Base): - """Mapping table between backfill run and dag run.""" + """Mapping table between backfill run and Dag run.""" __tablename__ = "backfill_dag_run" id = Column(Integer, primary_key=True, autoincrement=True) @@ -234,11 +234,11 @@ def _validate_backfill_params(dag, reverse, from_date, to_date, reprocess_behavi if depends_on_past: if reverse is True: raise InvalidBackfillDirection( - "Backfill cannot be run in reverse when the DAG has tasks where depends_on_past=True." + "Backfill cannot be run in reverse when the Dag has tasks where depends_on_past=True." ) if reprocess_behavior in (None, ReprocessBehavior.NONE): raise InvalidReprocessBehavior( - "DAG has tasks for which depends_on_past=True. " + "Dag has tasks for which depends_on_past=True. " "You must set reprocess behavior to reprocess completed or reprocess failed." ) current_time = timezone.utcnow() @@ -404,7 +404,7 @@ def _get_info_list( def _handle_clear_run(session, dag, dr, info, backfill_id, sort_ordinal, run_on_latest=False): - """Clear the existing DAG run and update backfill metadata.""" + """Clear the existing Dag run and update backfill metadata.""" from sqlalchemy.sql import update from airflow.models import DagRun diff --git a/airflow-core/src/airflow/models/dag.py b/airflow-core/src/airflow/models/dag.py index 9d801c197e641..642c3eead215c 100644 --- a/airflow-core/src/airflow/models/dag.py +++ b/airflow-core/src/airflow/models/dag.py @@ -249,7 +249,7 @@ def _create_orm_dagrun( ) dag_version = DagVersion.get_latest_version(dag.dag_id, session=session) if not dag_version: - raise AirflowException(f"Cannot create DagRun for DAG {dag.dag_id} because the dag is not serialized") + raise AirflowException(f"Cannot create DagRun for Dag {dag.dag_id} because the dag is not serialized") run = DagRun( dag_id=dag.dag_id, @@ -309,7 +309,7 @@ class DAG(TaskSDKDag, LoggingMixin): are met. Certain tasks have the property of depending on their own past, meaning that they can't run until their previous schedule (and upstream tasks) are completed. - DAGs essentially act as namespaces for tasks. A task_id can only be + Dags essentially act as namespaces for tasks. A task_id can only be added once to a DAG. Note that if you plan to use time zones all the dates provided should be pendulum @@ -333,11 +333,11 @@ class DAG(TaskSDKDag, LoggingMixin): :param start_date: The timestamp from which the scheduler will attempt to backfill. If this is not provided, backfilling must be done manually with an explicit time range. - :param end_date: A date beyond which your DAG won't run, leave to None + :param end_date: A date beyond which your Dag won't run, leave to None for open-ended scheduling. :param template_searchpath: This list of folders (non-relative) defines where jinja will look for your templates. Order matters. - Note that jinja/airflow includes the path of your DAG file by + Note that jinja/airflow includes the path of your Dag file by default :param template_undefined: Template undefined type. :param user_defined_macros: a dictionary of macros that will be exposed @@ -356,25 +356,25 @@ class DAG(TaskSDKDag, LoggingMixin): here, meaning that if your dict contains `'depends_on_past': True` here and `'depends_on_past': False` in the operator's call `default_args`, the actual value will be `False`. - :param params: a dictionary of DAG level parameters that are made + :param params: a dictionary of Dag level parameters that are made accessible in templates, namespaced under `params`. These params can be overridden at the task level. :param max_active_tasks: the number of task instances allowed to run concurrently - :param max_active_runs: maximum number of active DAG runs, beyond this - number of DAG runs in a running state, the scheduler won't create - new active DAG runs - :param max_consecutive_failed_dag_runs: (experimental) maximum number of consecutive failed DAG runs, + :param max_active_runs: maximum number of active Dag runs, beyond this + number of Dag runs in a running state, the scheduler won't create + new active Dag runs + :param max_consecutive_failed_dag_runs: (experimental) maximum number of consecutive failed Dag runs, beyond this the scheduler will disable the DAG :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 deadline: Optional Deadline Alert for the DAG. - Specifies a time by which the DAG run should be complete, either in the form of a static datetime + Specifies a time by which the Dag run should be complete, either in the form of a static datetime or calculated relative to a reference timestamp. If the deadline passes before completion, the provided callback is triggered. - **Example**: To set the deadline for one hour after the DAG run starts you could use :: + **Example**: To set the deadline for one hour after the Dag run starts you could use :: DeadlineAlert( reference=DeadlineReference.DAGRUN_LOGICAL_DATE, @@ -389,8 +389,8 @@ class DAG(TaskSDKDag, LoggingMixin): that it is executed when the dag succeeds. :param access_control: Specify optional DAG-level actions, e.g., "{'role1': {'can_read'}, 'role2': {'can_read', 'can_edit', 'can_delete'}}" - or it can specify the resource name if there is a DAGs Run resource, e.g., - "{'role1': {'DAG Runs': {'can_create'}}, 'role2': {'DAGs': {'can_read', 'can_edit', 'can_delete'}}" + or it can specify the resource name if there is a Dags Run resource, e.g., + "{'role1': {'Dag Runs': {'can_create'}}, 'role2': {'Dags': {'can_read', 'can_edit', 'can_delete'}}" :param is_paused_upon_creation: Specifies if the dag is paused when created for the first time. If the dag exists already, this flag will be ignored. If this optional parameter is not specified, the global config setting will be used. @@ -413,15 +413,15 @@ class DAG(TaskSDKDag, LoggingMixin): :param render_template_as_native_obj: If True, uses a Jinja ``NativeEnvironment`` to render templates as native Python types. If False, a Jinja ``Environment`` is used to render templates as string values. - :param tags: List of tags to help filtering DAGs in the UI. - :param owner_links: Dict of owners and their links, that will be clickable on the DAGs view UI. + :param tags: List of tags to help filtering Dags in the UI. + :param owner_links: Dict of owners and their links, that will be clickable on the Dags view UI. Can be used as an HTTP link (for example the link to your Slack channel), or a mailto link. e.g: {"dag_owner": "https://airflow.apache.org/"} - :param auto_register: Automatically register this DAG when it is used in a ``with`` block - :param fail_fast: Fails currently running tasks when task in DAG fails. + :param auto_register: Automatically register this Dag when it is used in a ``with`` block + :param fail_fast: Fails currently running tasks when task in Dag fails. **Warning**: A fail fast dag can only have tasks with the default trigger rule ("all_success"). An exception will be thrown if any task in a fail fast dag has a non default trigger rule. - :param dag_display_name: The display name of the DAG which appears on the UI. + :param dag_display_name: The display name of the Dag which appears on the UI. """ partial: bool = False @@ -460,7 +460,7 @@ def validate_executor_field(self): @staticmethod def _upgrade_outdated_dag_access_control(access_control=None): - """Look for outdated dag level actions in DAG access_controls and replace them with updated actions.""" + """Look for outdated Dag level actions in Dag access_controls and replace them with updated actions.""" if access_control is None: return None updated_access_control = {} @@ -487,7 +487,7 @@ def get_next_data_interval(self, dag_model: DagModel) -> DataInterval | None: :meta private: """ if self.dag_id != dag_model.dag_id: - raise ValueError(f"Arguments refer to different DAGs: {self.dag_id} != {dag_model.dag_id}") + raise ValueError(f"Arguments refer to different Dags: {self.dag_id} != {dag_model.dag_id}") if dag_model.next_dagrun is None: # Next run not scheduled. return None data_interval = dag_model.next_dagrun_data_interval @@ -513,7 +513,7 @@ def get_run_data_interval(self, run: DagRun) -> DataInterval: :meta private: """ if run.dag_id is not None and run.dag_id != self.dag_id: - raise ValueError(f"Arguments refer to different DAGs: {self.dag_id} != {run.dag_id}") + raise ValueError(f"Arguments refer to different Dags: {self.dag_id} != {run.dag_id}") data_interval = _get_model_data_interval(run, "data_interval_start", "data_interval_end") if data_interval is not None: return data_interval @@ -544,10 +544,10 @@ def infer_automated_data_interval(self, logical_date: datetime) -> DataInterval: end = cast("DeltaDataIntervalTimetable", self.timetable)._get_next(start) # Contributors: When the exception below is raised, you might want to # add an 'elif' block here to handle custom timetables. Stop! The bug - # you're looking for is instead at when the DAG run (represented by + # you're looking for is instead at when the Dag run (represented by # logical_date) was created. See GH-31969 for an example: # * Wrong fix: GH-32074 (modifies this function). - # * Correct fix: GH-32118 (modifies the DAG run creation code). + # * Correct fix: GH-32118 (modifies the Dag run creation code). else: raise ValueError(f"Not a valid timetable: {self.timetable!r}") return DataInterval(start, end) @@ -594,7 +594,7 @@ def next_dagrun_info( ) except Exception: self.log.exception( - "Failed to fetch run info after data interval %s for DAG %r", + "Failed to fetch run info after data interval %s for Dag %r", data_interval, self.dag_id, ) @@ -636,7 +636,7 @@ def iter_dagrun_infos_between( ``earliest``, even if it does not fall on the logical timetable schedule. The default is ``True``. - Example: A DAG is scheduled to run every midnight (``0 0 * * *``). If + Example: A Dag is scheduled to run every midnight (``0 0 * * *``). If ``earliest`` is ``2021-06-03 23:00:00``, the first DagRunInfo would be ``2021-06-03 23:00:00`` if ``align=False``, and ``2021-06-04 00:00:00`` if ``align=True``. @@ -657,7 +657,7 @@ def iter_dagrun_infos_between( ) except Exception: self.log.exception( - "Failed to fetch run info after data interval %s for DAG %r", + "Failed to fetch run info after data interval %s for Dag %r", None, self.dag_id, ) @@ -685,7 +685,7 @@ def iter_dagrun_infos_between( ) except Exception: self.log.exception( - "Failed to fetch run info after data interval %s for DAG %r", + "Failed to fetch run info after data interval %s for Dag %r", info.data_interval if info else "", self.dag_id, ) @@ -707,7 +707,7 @@ def dag_id(self, value: str) -> None: @provide_session def get_concurrency_reached(self, session=NEW_SESSION) -> bool: - """Return a boolean indicating whether the max_active_tasks limit for this DAG has been reached.""" + """Return a boolean indicating whether the max_active_tasks limit for this Dag has been reached.""" TI = TaskInstance total_tasks = session.scalar( select(func.count(TI.task_id)).where( @@ -719,33 +719,33 @@ def get_concurrency_reached(self, session=NEW_SESSION) -> bool: @provide_session def get_is_active(self, session=NEW_SESSION) -> None: - """Return a boolean indicating whether this DAG is active.""" + """Return a boolean indicating whether this Dag is active.""" return session.scalar(select(~DagModel.is_stale).where(DagModel.dag_id == self.dag_id)) @provide_session def get_is_stale(self, session=NEW_SESSION) -> None: - """Return a boolean indicating whether this DAG is stale.""" + """Return a boolean indicating whether this Dag is stale.""" return session.scalar(select(DagModel.is_stale).where(DagModel.dag_id == self.dag_id)) @provide_session def get_is_paused(self, session=NEW_SESSION) -> None: - """Return a boolean indicating whether this DAG is paused.""" + """Return a boolean indicating whether this Dag is paused.""" return session.scalar(select(DagModel.is_paused).where(DagModel.dag_id == self.dag_id)) @provide_session def get_bundle_name(self, session=NEW_SESSION) -> str | None: - """Return the bundle name this DAG is in.""" + """Return the bundle name this Dag is in.""" return session.scalar(select(DagModel.bundle_name).where(DagModel.dag_id == self.dag_id)) @provide_session def get_bundle_version(self, session=NEW_SESSION) -> str | None: - """Return the bundle version that was seen when this dag was processed.""" + """Return the bundle version that was seen when this Dag was processed.""" return session.scalar(select(DagModel.bundle_version).where(DagModel.dag_id == self.dag_id)) @methodtools.lru_cache(maxsize=None) @classmethod def get_serialized_fields(cls): - """Stringified DAGs and operators contain exactly these fields.""" + """Stringified Dags and operators contain exactly these fields.""" return TaskSDKDag.get_serialized_fields() | {"_processor_dags_folder"} def get_active_runs(self): @@ -768,7 +768,7 @@ def fetch_dagrun(dag_id: str, run_id: str, session: Session = NEW_SESSION) -> Da """ Return the dag run for a given run_id if it exists, otherwise none. - :param dag_id: The dag_id of the DAG to find. + :param dag_id: The dag_id of the Dag to find. :param run_id: The run_id of the DagRun to find. :param session: :return: The DagRun if found, otherwise None. @@ -801,7 +801,7 @@ def get_dagruns_between(self, start_date, end_date, session=NEW_SESSION): @provide_session def get_latest_logical_date(self, session: Session = NEW_SESSION) -> pendulum.DateTime | None: - """Return the latest date for which at least one dag run exists.""" + """Return the latest date for which at least one Dag run exists.""" return session.scalar(select(func.max(DagRun.logical_date)).where(DagRun.dag_id == self.dag_id)) @provide_session @@ -817,7 +817,7 @@ def get_task_instances_before( The returned list may contain exactly ``num`` task instances corresponding to any DagRunType. It can have less if there are - less than ``num`` scheduled DAG runs before ``base_date``. + less than ``num`` scheduled Dag runs before ``base_date``. """ logical_dates: list[Any] = session.execute( select(DagRun.logical_date) @@ -1381,7 +1381,7 @@ def clear( :param dag_run_state: state to set DagRun to. If set to False, dagrun state will not be changed. :param dry_run: Find the tasks to clear but don't clear them. - :param run_on_latest_version: whether to run on latest serialized DAG and Bundle version + :param run_on_latest_version: whether to run on latest serialized Dag and Bundle version :param session: The sqlalchemy session to use :param dag_bag: The DagBag used to find the dags (Optional) :param exclude_task_ids: A set of ``task_id`` or (``task_id``, ``map_index``) @@ -1513,7 +1513,7 @@ def create_dagrun( session: Session = NEW_SESSION, ) -> DagRun: """ - Create a run for this DAG to run its tasks. + Create a run for this Dag to run its tasks. :param run_id: ID of the dag_run :param logical_date: date of execution @@ -1525,7 +1525,7 @@ def create_dagrun( :param creating_job_id: ID of the job creating this DagRun :param backfill_id: ID of the backfill run if one exists :param session: Unused. Only added in compatibility with database isolation mode - :return: The created DAG run. + :return: The created Dag run. :meta private: """ @@ -1561,7 +1561,7 @@ def create_dagrun( if run_type == DagRunType.MANUAL: if (inferred_run_type := DagRunType.from_run_id(run_id)) != DagRunType.MANUAL: raise ValueError( - f"A {run_type.value} DAG run cannot use ID {run_id!r} since it " + f"A {run_type.value} Dag run cannot use ID {run_id!r} since it " f"is reserved for {inferred_run_type.value} runs" ) @@ -1617,7 +1617,7 @@ def bulk_write_to_db( """ Ensure the DagModel rows for the given dags are up-to-date in the dag table in the DB. - :param dags: the DAG objects to save to the DB + :param dags: the Dag objects to save to the DB :return: None """ if not dags: @@ -1625,7 +1625,7 @@ def bulk_write_to_db( from airflow.dag_processing.collection import AssetModelOperation, DagModelOperation - log.info("Sync %s DAGs", len(dags)) + log.info("Sync %s Dags", len(dags)) dag_op = DagModelOperation( bundle_name=bundle_name, bundle_version=bundle_version, dags={d.dag_id: d for d in dags} ) @@ -1654,7 +1654,7 @@ def bulk_write_to_db( @provide_session def sync_to_db(self, session=NEW_SESSION): """ - Save attributes about this DAG to the DB. + Save attributes about this Dag to the DB. :return: None """ @@ -1667,9 +1667,9 @@ def sync_to_db(self, session=NEW_SESSION): @provide_session def deactivate_unknown_dags(active_dag_ids, session=NEW_SESSION): """ - Given a list of known DAGs, deactivate any other DAGs that are marked as active in the ORM. + Given a list of known Dags, deactivate any other Dags that are marked as active in the ORM. - :param active_dag_ids: list of DAG IDs that are active + :param active_dag_ids: list of Dag IDs that are active :return: None """ if not active_dag_ids: @@ -1683,18 +1683,18 @@ def deactivate_unknown_dags(active_dag_ids, session=NEW_SESSION): @provide_session def deactivate_stale_dags(expiration_date, session=NEW_SESSION): """ - Deactivate any DAGs that were last touched by the scheduler before the expiration date. + Deactivate any Dags that were last touched by the scheduler before the expiration date. - These DAGs were likely deleted. + These Dags were likely deleted. - :param expiration_date: set inactive DAGs that were touched before this time + :param expiration_date: set inactive Dags that were touched before this time :return: None """ for dag in session.scalars( select(DagModel).where(DagModel.last_parsed_time < expiration_date, ~DagModel.is_stale) ): log.info( - "Deactivating DAG ID %s since it was last touched by the scheduler at %s", + "Deactivating Dag ID %s since it was last touched by the scheduler at %s", dag.dag_id, dag.last_parsed_time.isoformat(), ) @@ -1709,8 +1709,8 @@ def get_num_task_instances(dag_id, run_id=None, task_ids=None, states=None, sess Return the number of task instances in the given DAG. :param session: ORM session - :param dag_id: ID of the DAG to get the task concurrency of - :param run_id: ID of the DAG run to get the task concurrency of + :param dag_id: ID of the Dag to get the task concurrency of + :param run_id: ID of the Dag run to get the task concurrency of :param task_ids: A list of valid task IDs for the given DAG :param states: A list of states to filter by if supplied :return: The number of running tasks @@ -1761,7 +1761,7 @@ def get_task_assets( @classmethod def from_sdk_dag(cls, dag: TaskSDKDag) -> DAG: - """Create a new (Scheduler) DAG object from a TaskSDKDag.""" + """Create a new (Scheduler) Dag object from a TaskSDKDag.""" if not isinstance(dag, TaskSDKDag): return dag @@ -1825,7 +1825,7 @@ def create_tasks(task): class DagTag(Base): - """A tag name per dag, to allow quick filtering in the DAG view.""" + """A tag name per Dag, to allow quick filtering in the Dag view.""" __tablename__ = "dag_tag" name = Column(String(TAG_MAX_LEN), primary_key=True) @@ -1845,7 +1845,7 @@ class DagOwnerAttributes(Base): """ Table defining different owner attributes. - For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view. + For example, a link for an owner that will be passed as a hyperlink to the "Dags" view. """ __tablename__ = "dag_owner_attributes" @@ -1870,32 +1870,32 @@ def get_all(cls, session) -> dict[str, dict[str, str]]: class DagModel(Base): - """Table containing DAG properties.""" + """Table containing Dag properties.""" __tablename__ = "dag" """ These items are stored in the database for state related information. """ dag_id = Column(StringID(), primary_key=True) - # A DAG can be paused from the UI / DB + # A Dag can be paused from the UI / DB # Set this default value of is_paused based on a configuration value! is_paused_at_creation = airflow_conf.getboolean("core", "dags_are_paused_at_creation") is_paused = Column(Boolean, default=is_paused_at_creation) - # Whether that DAG was seen on the last DagBag load + # Whether that Dag was seen on the last DagBag load is_stale = Column(Boolean, default=True) # Last time the scheduler started last_parsed_time = Column(UtcDateTime) - # Time when the DAG last received a refresh signal + # Time when the Dag last received a refresh signal # (e.g. the DAG's "refresh" button was clicked in the web UI) last_expired = Column(UtcDateTime) - # The location of the file containing the DAG object + # The location of the file containing the Dag object # Note: Do not depend on fileloc pointing to a file; in the case of a - # packaged DAG, it will point to the subpath of the DAG within the + # packaged DAG, it will point to the subpath of the Dag within the # associated zip. fileloc = Column(String(2000)) relative_fileloc = Column(String(2000)) bundle_name = Column(StringID(), ForeignKey("dag_bundle.name"), nullable=False) - # The version of the bundle the last time the DAG was processed + # The version of the bundle the last time the Dag was processed bundle_version = Column(String(200), nullable=True) # String representing the owners owners = Column(String(2000)) @@ -1909,11 +1909,11 @@ class DagModel(Base): timetable_description = Column(String(1000), nullable=True) # Asset expression based on asset triggers asset_expression = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=True) - # DAG deadline information + # Dag deadline information _deadline = Column("deadline", sqlalchemy_jsonfield.JSONField(json=json), nullable=True) # Tags for view filter tags = relationship("DagTag", cascade="all, delete, delete-orphan", backref=backref("dag")) - # Dag owner links for DAGs view + # Dag owner links for Dags view dag_owner_links = relationship( "DagOwnerAttributes", cascade="all, delete, delete-orphan", backref=backref("dag") ) @@ -1987,7 +1987,7 @@ def __init__(self, **kwargs): ) if self.has_task_concurrency_limits is None: - # Be safe -- this will be updated later once the DAG is parsed + # Be safe -- this will be updated later once the Dag is parsed self.has_task_concurrency_limits = True def __repr__(self): @@ -2042,11 +2042,11 @@ def get_last_dagrun(self, session=NEW_SESSION, include_manually_triggered=False) ) def get_is_paused(self, *, session: Session | None = None) -> bool: - """Provide interface compatibility to 'DAG'.""" + """Provide interface compatibility to 'Dag'.""" return self.is_paused def get_is_active(self, *, session: Session | None = None) -> bool: - """Provide interface compatibility to 'DAG'.""" + """Provide interface compatibility to 'Dag'.""" return not self.is_stale @staticmethod @@ -2077,7 +2077,7 @@ def set_is_paused(self, is_paused: bool, session=NEW_SESSION) -> None: """ Pause/Un-pause a DAG. - :param is_paused: Is the DAG paused + :param is_paused: Is the Dag paused :param session: session """ filter_query = [ @@ -2117,13 +2117,13 @@ def deactivate_deleted_dags( session: Session = NEW_SESSION, ) -> None: """ - Set ``is_active=False`` on the DAGs for which the DAG files have been removed. + Set ``is_active=False`` on the Dags for which the Dag files have been removed. :param bundle_name: bundle for filelocs :param rel_filelocs: relative filelocs for bundle :param session: ORM Session """ - log.debug("Deactivating DAGs (for which DAG files are deleted) from %s table ", cls.__tablename__) + log.debug("Deactivating Dags (for which Dag files are deleted) from %s table ", cls.__tablename__) dag_models = session.scalars( select(cls) .where( @@ -2161,7 +2161,7 @@ def dag_ready(dag_id: str, cond: BaseAsset, statuses: dict[AssetUniqueKey, bool] try: return evaluator.run(cond, statuses) except AttributeError: - log.warning("dag '%s' has old serialization; skipping DAG run creation.", dag_id) + log.warning("dag '%s' has old serialization; skipping Dag run creation.", dag_id) return None # this loads all the ADRQ records.... may need to limit num dags @@ -2236,7 +2236,7 @@ def calculate_dagrun_date_fields( """ Calculate ``next_dagrun`` and `next_dagrun_create_after``. - :param dag: The DAG object + :param dag: The Dag object :param last_automated_dag_run: DataInterval (or datetime) of most recent run of this dag, or none if not yet scheduled. """ @@ -2307,19 +2307,19 @@ def _get_or_create_dagrun( session: Session, ) -> DagRun: """ - Create a DAG run, replacing an existing instance if needed to prevent collisions. + Create a Dag run, replacing an existing instance if needed to prevent collisions. This function is only meant to be used by :meth:`DAG.test` as a helper function. - :param dag: DAG to be used to find run. + :param dag: Dag to be used to find run. :param conf: Configuration to pass to newly created run. :param start_date: Start date of new run. :param logical_date: Logical date for finding an existing run. - :param run_id: Run ID for the new DAG run. + :param run_id: Run ID for the new Dag run. :param triggered_by: the entity which triggers the dag_run :param triggering_user_name: the user name who triggers the dag_run - :return: The newly created DAG run. + :return: The newly created Dag run. """ dr: DagRun = session.scalar( select(DagRun).where(DagRun.dag_id == dag.dag_id, DagRun.logical_date == logical_date) diff --git a/airflow-core/src/airflow/models/dag_favorite.py b/airflow-core/src/airflow/models/dag_favorite.py index 5dfb742fdaf80..d500b8ec2b54d 100644 --- a/airflow-core/src/airflow/models/dag_favorite.py +++ b/airflow-core/src/airflow/models/dag_favorite.py @@ -23,7 +23,7 @@ class DagFavorite(Base): - """Association table model linking users to their favorite DAGs.""" + """Association table model linking users to their favorite Dags.""" __tablename__ = "dag_favorite" diff --git a/airflow-core/src/airflow/models/dag_version.py b/airflow-core/src/airflow/models/dag_version.py index a51f3cb301867..50d9c61539c62 100644 --- a/airflow-core/src/airflow/models/dag_version.py +++ b/airflow-core/src/airflow/models/dag_version.py @@ -38,7 +38,7 @@ class DagVersion(Base): - """Model to track the versions of DAGs in the database.""" + """Model to track the versions of Dags in the database.""" __tablename__ = "dag_version" id = Column(UUIDType(binary=False), primary_key=True, default=uuid6.uuid7) @@ -87,9 +87,9 @@ def write_dag( """ Write a new DagVersion into database. - Checks if a version of the DAG exists and increments the version number if it does. + Checks if a version of the Dag exists and increments the version number if it does. - :param dag_id: The DAG ID. + :param dag_id: The Dag ID. :param version_number: The version number. :param session: The database session. :return: The DagVersion object. @@ -119,7 +119,7 @@ def _latest_version_select( """ Get the select object to get the latest version of the DAG. - :param dag_id: The DAG ID. + :param dag_id: The Dag ID. :return: The select object. """ query = select(cls).where(cls.dag_id == dag_id) @@ -145,10 +145,10 @@ def get_latest_version( """ Get the latest version of the DAG. - :param dag_id: The DAG ID. + :param dag_id: The Dag ID. :param session: The database session. - :param load_dag_model: Whether to load the DAG model. - :return: The latest version of the DAG or None if not found. + :param load_dag_model: Whether to load the Dag model. + :return: The latest version of the Dag or None if not found. """ return session.scalar( cls._latest_version_select(dag_id, bundle_version=bundle_version, load_dag_model=load_dag_model) @@ -166,10 +166,10 @@ def get_version( """ Get the version of the DAG. - :param dag_id: The DAG ID. + :param dag_id: The Dag ID. :param version_number: The version number. :param session: The database session. - :return: The version of the DAG or None if not found. + :return: The version of the Dag or None if not found. """ version_select_obj = select(cls).where(cls.dag_id == dag_id) if version_number: diff --git a/airflow-core/src/airflow/models/dagbag.py b/airflow-core/src/airflow/models/dagbag.py index a2c6d5462c95a..b182eebff39b7 100644 --- a/airflow-core/src/airflow/models/dagbag.py +++ b/airflow-core/src/airflow/models/dagbag.py @@ -105,9 +105,9 @@ class FileLoadStat(NamedTuple): :param file: Loaded file. :param duration: Time spent on process file. - :param dag_num: Total number of DAGs loaded in this file. + :param dag_num: Total number of Dags loaded in this file. :param task_num: Total number of Tasks loaded in this file. - :param dags: DAGs names loaded in this file. + :param dags: Dags names loaded in this file. :param warning_num: Total number of warnings captured from processing this file. """ @@ -153,7 +153,7 @@ class DagBag(LoggingMixin): profiles. What would have been system level settings are now dagbag level so that one system can run multiple, independent settings sets. - :param dag_folder: the folder to scan to find DAGs + :param dag_folder: the folder to scan to find Dags :param include_examples: whether to include the examples that ship with airflow or not :param safe_mode: when ``False``, scans all python modules for dags. @@ -196,7 +196,7 @@ def __init__( self.import_errors: dict[str, str] = {} self.captured_warnings: dict[str, tuple[str, ...]] = {} self.has_logged = False - # Only used by SchedulerJob to compare the dag_hash to identify change in DAGs + # Only used by SchedulerJob to compare the dag_hash to identify change in Dags self.dags_hash: dict[str, str] = {} self.known_pools = known_pools @@ -220,25 +220,25 @@ def size(self) -> int: @property def dag_ids(self) -> list[str]: """ - Get DAG ids. + Get Dag ids. - :return: a list of DAG IDs in this bag + :return: a list of Dag IDs in this bag """ return list(self.dags) @provide_session def get_dag(self, dag_id, session: Session = None): """ - Get the DAG out of the dictionary, and refreshes it if expired. + Get the Dag out of the dictionary, and refreshes it if expired. - :param dag_id: DAG ID + :param dag_id: Dag ID """ # Avoid circular import from airflow.models.dag import DagModel dag = self.dags.get(dag_id) - # If DAG Model is absent, we can't check last_expired property. Is the DAG not yet synchronized? + # If Dag Model is absent, we can't check last_expired property. Is the Dag not yet synchronized? if (orm_dag := DagModel.get_current(dag_id, session=session)) is None: return dag @@ -261,7 +261,7 @@ def get_dag(self, dag_id, session: Session = None): return self.dags.get(dag_id) def process_file(self, filepath, only_if_updated=True, safe_mode=True): - """Given a path to a python module or zip file, import the module and look for dag objects within.""" + """Given a path to a python module or zip file, import the module and look for Dag objects within.""" from airflow.sdk.definitions._internal.contextmanager import DagContext # if the source file no longer exists in the DB or in the filesystem, @@ -368,7 +368,7 @@ def handler(signum, frame): # Don't want to spam user with skip messages if not self.has_logged: self.has_logged = True - self.log.info("File %s assumed to contain no DAGs. Skipping.", filepath) + self.log.info("File %s assumed to contain no Dags. Skipping.", filepath) return [] self.log.debug("Importing %s", filepath) @@ -417,7 +417,7 @@ def parse(mod_name, filepath): timeout_msg = ( f"DagBag import timeout for {filepath} after {dagbag_import_timeout}s.\n" - "Please take a look at these docs to improve your DAG import time:\n" + "Please take a look at these docs to improve your Dag import time:\n" f"* {get_docs_url('best-practices.html#top-level-python-code')}\n" f"* {get_docs_url('best-practices.html#reducing-dag-complexity')}" ) @@ -445,7 +445,7 @@ def _load_modules_from_zip(self, filepath, safe_mode): if not self.has_logged: self.has_logged = True self.log.info( - "File %s:%s assumed to contain no DAGs. Skipping.", filepath, zip_info.filename + "File %s:%s assumed to contain no Dags. Skipping.", filepath, zip_info.filename ) continue @@ -507,7 +507,7 @@ def _process_modules(self, filepath, mods, file_last_changed_on_disk): def bag_dag(self, dag: DAG): """ - Add the DAG into the bag. + Add the Dag into the bag. :raises: AirflowDagCycleException if a cycle is detected. :raises: AirflowDagDuplicatedIdException if this dag already exists in the bag. @@ -526,7 +526,7 @@ def bag_dag(self, dag: DAG): if getattr(task, "end_from_trigger", False) and get_listener_manager().has_listeners: raise AirflowException( "Listeners are not supported with end_from_trigger=True for deferrable operators. " - "Task %s in DAG %s has end_from_trigger=True with listeners from plugins. " + "Task %s in Dag %s has end_from_trigger=True with listeners from plugins. " "Set end_from_trigger=False to use listeners.", task.task_id, dag.dag_id, @@ -548,7 +548,7 @@ def bag_dag(self, dag: DAG): existing=self.dags[dag.dag_id].fileloc, ) self.dags[dag.dag_id] = dag - self.log.debug("Loaded DAG %s", dag) + self.log.debug("Loaded Dag %s", dag) except (AirflowDagCycleException, AirflowDagDuplicatedIdException): # There was an error in bagging the dag. Remove it from the list of dags self.log.exception("Exception bagging dag: %s", dag.dag_id) @@ -625,7 +625,7 @@ def dagbag_report(self): ------------------------------------------------------------------- DagBag loading stats for {dag_folder} ------------------------------------------------------------------- - Number of DAGs: {dag_num} + Number of Dags: {dag_num} Total task number: {task_num} DagBag parsing time: {duration}\n{table} """ @@ -641,7 +641,7 @@ def sync_bag_to_db( *, session: Session = NEW_SESSION, ) -> None: - """Save attributes about list of DAG to the DB.""" + """Save attributes about list of Dag to the DB.""" import airflow.models.dag from airflow.dag_processing.collection import update_dag_parsing_results_in_db from airflow.serialization.serialized_objects import LazyDeserializedDAG, SerializedDAG @@ -720,7 +720,7 @@ def iter_all_latest_version_dags(self, *, session: Session) -> Generator[DAG, No yield dag def get_latest_version_of_dag(self, dag_id: str, *, session: Session) -> DAG | None: - """Get the latest version of a dag by its id.""" + """Get the latest version of a Dag by its id.""" from airflow.models.serialized_dag import SerializedDagModel if not (serdag := SerializedDagModel.get(dag_id, session=session)): @@ -735,7 +735,7 @@ def generate_md5_hash(context): class DagPriorityParsingRequest(Base): - """Model to store the dag parsing requests that will be prioritized when parsing files.""" + """Model to store the Dag parsing requests that will be prioritized when parsing files.""" __tablename__ = "dag_priority_parsing_request" @@ -745,9 +745,9 @@ class DagPriorityParsingRequest(Base): id = Column(String(32), primary_key=True, default=generate_md5_hash, onupdate=generate_md5_hash) bundle_name = Column(StringID(), nullable=False) - # The location of the file containing the DAG object + # The location of the file containing the Dag object # Note: Do not depend on fileloc pointing to a file; in the case of a - # packaged DAG, it will point to the subpath of the DAG within the + # packaged DAG, it will point to the subpath of the Dag within the # associated zip. relative_fileloc = Column(String(2000), nullable=False) diff --git a/airflow-core/src/airflow/models/dagbundle.py b/airflow-core/src/airflow/models/dagbundle.py index eb391b06db44e..bcd1124fb6ba1 100644 --- a/airflow-core/src/airflow/models/dagbundle.py +++ b/airflow-core/src/airflow/models/dagbundle.py @@ -28,7 +28,7 @@ class DagBundleModel(Base, LoggingMixin): """ - A table for storing DAG bundle metadata. + A table for storing Dag bundle metadata. We track the following information about each bundle, as it can be useful for informational purposes and for debugging: diff --git a/airflow-core/src/airflow/models/dagcode.py b/airflow-core/src/airflow/models/dagcode.py index a68885e1dfdf2..112631d76a98b 100644 --- a/airflow-core/src/airflow/models/dagcode.py +++ b/airflow-core/src/airflow/models/dagcode.py @@ -46,9 +46,9 @@ class DagCode(Base): """ - A table for DAGs code. + A table for Dags code. - dag_code table contains code of DAG files synchronized by scheduler. + dag_code table contains code of Dag files synchronized by scheduler. For details on dag serialization see SerializedDagModel """ @@ -80,13 +80,13 @@ def write_code(cls, dag_version: DagVersion, fileloc: str, session: Session = NE """ Write code into database. - :param fileloc: file path of DAG to sync + :param fileloc: file path of Dag to sync :param session: ORM Session """ - log.debug("Writing DAG file %s into DagCode table", fileloc) + log.debug("Writing Dag file %s into DagCode table", fileloc) dag_code = DagCode(dag_version, fileloc, cls.get_code_from_file(fileloc)) session.add(dag_code) - log.debug("DAG file %s written into DagCode table", fileloc) + log.debug("Dag file %s written into DagCode table", fileloc) return dag_code @classmethod @@ -150,7 +150,7 @@ def _latest_dagcode_select(cls, dag_id: str) -> Select: """ Get the select object to get the latest dagcode. - :param dag_id: The DAG ID. + :param dag_id: The Dag ID. :return: The select object. """ return select(cls).where(cls.dag_id == dag_id).order_by(cls.last_updated.desc()).limit(1) @@ -161,7 +161,7 @@ def get_latest_dagcode(cls, dag_id: str, session: Session = NEW_SESSION) -> DagC """ Get the latest dagcode. - :param dag_id: The DAG ID. + :param dag_id: The Dag ID. :param session: The database session. :return: The latest dagcode or None if not found. """ @@ -171,7 +171,7 @@ def get_latest_dagcode(cls, dag_id: str, session: Session = NEW_SESSION) -> DagC @provide_session def update_source_code(cls, dag_id: str, fileloc: str, session: Session = NEW_SESSION) -> None: """ - Check if the source code of the DAG has changed and update it if needed. + Check if the source code of the Dag has changed and update it if needed. :param dag_id: Dag ID :param fileloc: The path of code file to read the code from diff --git a/airflow-core/src/airflow/models/dagrun.py b/airflow-core/src/airflow/models/dagrun.py index 2b79da564235c..8ecd2ec5e2351 100644 --- a/airflow-core/src/airflow/models/dagrun.py +++ b/airflow-core/src/airflow/models/dagrun.py @@ -139,7 +139,7 @@ class DagRun(Base, LoggingMixin): """ Invocation instance of a DAG. - A DAG run can be created by the scheduler (i.e. scheduled runs), or by an + A Dag run can be created by the scheduler (i.e. scheduled runs), or by an external trigger (i.e. manual runs). """ @@ -202,7 +202,7 @@ class DagRun(Base, LoggingMixin): ForeignKey("dag_version.id", name="created_dag_version_id_fkey", ondelete="set null"), nullable=True, ) - """The id of the dag version column that was in effect at dag run creation time. + """The id of the Dag version column that was in effect at dag run creation time. :meta private: """ @@ -362,7 +362,7 @@ def validate_run_id(self, key: str, run_id: str) -> str | None: @property def dag_versions(self) -> list[DagVersion]: - """Return the DAG versions associated with the TIs of this DagRun.""" + """Return the Dag versions associated with the TIs of this DagRun.""" # when the dag is in a versioned bundle, we keep the dag version fixed if self.bundle_version: return [self.created_dag_version] if self.created_dag_version is not None else [] @@ -376,7 +376,7 @@ def dag_versions(self) -> list[DagVersion]: @property def version_number(self) -> int | None: - """Return the DAG version number associated with the latest TI of this DagRun.""" + """Return the Dag version number associated with the latest TI of this DagRun.""" dag_versions = self.dag_versions if dag_versions: return dag_versions[-1].version_number @@ -724,9 +724,9 @@ def find( @provide_session def find_duplicate(cls, dag_id: str, run_id: str, *, session: Session = NEW_SESSION) -> DagRun | None: """ - Return an existing run for the DAG with a specific run_id. + Return an existing run for the Dag with a specific run_id. - *None* is returned if no such DAG run is found. + *None* is returned if no such Dag run is found. :param dag_id: the dag_id to find duplicates for :param run_id: defines the run id for this dag run @@ -759,7 +759,7 @@ def fetch_task_instances( state: Iterable[TaskInstanceState | None] | None = None, session: Session = NEW_SESSION, ) -> list[TI]: - """Return the task instances for this dag run.""" + """Return the task instances for this Dag run.""" tis = ( select(TI) .options(joinedload(TI.dag_run)) @@ -796,7 +796,7 @@ def _check_last_n_dagruns_failed(self, dag_id, max_consecutive_failed_dag_runs, .limit(max_consecutive_failed_dag_runs) .all() ) - """ Marking dag as paused, if needed""" + """ Marking Dag as paused, if needed""" to_be_paused = len(dag_runs) >= max_consecutive_failed_dag_runs and all( dag_run.state == DagRunState.FAILED for dag_run in dag_runs ) @@ -805,7 +805,7 @@ def _check_last_n_dagruns_failed(self, dag_id, max_consecutive_failed_dag_runs, from airflow.models.dag import DagModel self.log.info( - "Pausing DAG %s because last %s DAG runs failed.", + "Pausing Dag %s because last %s Dag runs failed.", self.dag_id, max_consecutive_failed_dag_runs, ) @@ -829,7 +829,7 @@ def _check_last_n_dagruns_failed(self, dag_id, max_consecutive_failed_dag_runs, ) else: self.log.debug( - "Limit of consecutive DAG failed dag runs is not reached, DAG %s will not be paused.", + "Limit of consecutive Dag failed dag runs is not reached, Dag %s will not be paused.", self.dag_id, ) @@ -884,8 +884,8 @@ def fetch_task_instance( """ Return the task instance specified by task_id for this dag run. - :param dag_id: the DAG id - :param dag_run_id: the DAG run id + :param dag_id: the Dag id + :param dag_run_id: the Dag run id :param task_id: the task id :param session: Sqlalchemy ORM Session """ @@ -900,7 +900,7 @@ def get_dag(self) -> DAG: :return: DAG """ if not self.dag: - raise AirflowException(f"The DAG (.dag) for {self} needs to be set") + raise AirflowException(f"The Dag (.dag) for {self} needs to be set") return self.dag @@ -935,7 +935,7 @@ def get_previous_scheduled_dagrun( """ Return the previous SCHEDULED DagRun, if there is one. - :param dag_run_id: the DAG run ID + :param dag_run_id: the Dag run ID :param session: SQLAlchemy ORM Session """ dag_run = session.get(DagRun, dag_run_id) @@ -983,7 +983,7 @@ def set_dagrun_span_attrs(self, span: Span | EmptySpan): # Explicitly set the value type to Union[...] to avoid a mypy error. attributes: dict[str, AttributeValueType] = { - "airflow.category": "DAG runs", + "airflow.category": "Dag runs", "airflow.dag_run.dag_id": str(self.dag_id), "airflow.dag_run.logical_date": str(self.logical_date), "airflow.dag_run.run_id": str(self.run_id), @@ -1193,7 +1193,7 @@ def recalculate(self) -> _UnfinishedStates: # and last consecutive failures are more if dag.max_consecutive_failed_dag_runs > 0: self.log.debug( - "Checking consecutive failed DAG runs for DAG %s, limit is %s", + "Checking consecutive failed Dag runs for Dag %s, limit is %s", self.dag_id, dag.max_consecutive_failed_dag_runs, ) @@ -1380,7 +1380,7 @@ def get_last_ti(self, dag: DAG, session: Session = NEW_SESSION) -> TI | None: return ti def handle_dag_callback(self, dag: SDKDAG, success: bool = True, reason: str = "success"): - """Only needed for `dag.test` where `execute_callbacks=True` is passed to `update_state`.""" + """Only needed for `Dag.test` where `execute_callbacks=True` is passed to `update_state`.""" from airflow.api_fastapi.execution_api.datamodels.taskinstance import ( DagRun as DRDataModel, TaskInstance as TIDataModel, @@ -1569,10 +1569,10 @@ def _emit_true_scheduling_delay_stats_for_finished_state(self, finished_tis: lis Emit the true scheduling delay stats. The true scheduling delay stats is defined as the time when the first - task in DAG starts minus the expected DAG run datetime. + task in Dag starts minus the expected Dag run datetime. This helper method is used in ``update_state`` when the state of the - DAG run is updated to a completed status (either success or failure). + Dag run is updated to a completed status (either success or failure). It finds the first started task within the DAG, calculates the run's expected start time based on the logical date and timetable, and gets the delay from the difference of these two values. @@ -1581,7 +1581,7 @@ def _emit_true_scheduling_delay_stats_for_finished_state(self, finished_tis: lis cleared, so the second task's start date will be used), but we can get rid of the outliers on the stats side through dashboards tooling. - Note that the stat will only be emitted for scheduler-triggered DAG runs + Note that the stat will only be emitted for scheduler-triggered Dag runs (i.e. when ``run_type`` is *SCHEDULED* and ``clear_number`` is equal to 0). """ if self.state == TaskInstanceState.RUNNING: @@ -1642,7 +1642,7 @@ def verify_integrity(self, *, session: Session = NEW_SESSION, dag_version_id: UU It will set state to removed or add the task if required. - :param dag_version_id: The DAG version ID + :param dag_version_id: The Dag version ID :param session: Sqlalchemy ORM Session """ from airflow.settings import task_instance_mutation_hook @@ -1688,11 +1688,11 @@ def _check_for_removed_or_restored_tasks( """ Check for removed tasks/restored/missing tasks. - :param dag: DAG object corresponding to the dagrun + :param dag: Dag object corresponding to the dagrun :param ti_mutation_hook: task_instance_mutation_hook function :param session: Sqlalchemy ORM Session - :return: Task IDs in the DAG run + :return: Task IDs in the Dag run """ from airflow.models.expandinput import NotFullyPopulated @@ -1710,7 +1710,7 @@ def _check_for_removed_or_restored_tasks( should_restore_task = (task is not None) and ti.state == TaskInstanceState.REMOVED if should_restore_task: - self.log.info("Restoring task '%s' which was previously removed from DAG '%s'", ti, dag) + self.log.info("Restoring task '%s' which was previously removed from Dag '%s'", ti, dag) Stats.incr(f"task_restored_to_dag.{dag.dag_id}", tags=self.stats_tags) # Same metric with tagging Stats.incr("task_restored_to_dag", tags={**self.stats_tags, "dag_id": dag.dag_id}) @@ -1833,7 +1833,7 @@ def _create_tasks( """ Create missing tasks -- and expand any MappedOperator that _only_ have literals as input. - :param tasks: Tasks to create jobs for in the DAG run + :param tasks: Tasks to create jobs for in the Dag run :param task_creator: Function to create task instances """ from airflow.models.expandinput import NotFullyPopulated @@ -1866,7 +1866,7 @@ def _create_task_instances( """ Create the necessary task instances from the given tasks. - :param dag_id: DAG ID associated with the dagrun + :param dag_id: Dag ID associated with the dagrun :param tasks: the tasks to create the task instances from :param created_counts: a dictionary of number of tasks -> total ti created by the task creator :param hook_is_noop: whether the task_instance_mutation_hook is noop @@ -1958,7 +1958,7 @@ def _revise_map_indexes_if_mapped( @classmethod @provide_session def get_latest_runs(cls, session: Session = NEW_SESSION) -> list[DagRun]: - """Return the latest DagRun for each DAG.""" + """Return the latest DagRun for each Dag.""" subquery = ( select(cls.dag_id, func.max(cls.logical_date).label("logical_date")) .group_by(cls.dag_id) diff --git a/airflow-core/src/airflow/models/dagwarning.py b/airflow-core/src/airflow/models/dagwarning.py index f11b5037a9090..4ef4db47a30a2 100644 --- a/airflow-core/src/airflow/models/dagwarning.py +++ b/airflow-core/src/airflow/models/dagwarning.py @@ -36,11 +36,11 @@ class DagWarning(Base): """ - A table to store DAG warnings. + A table to store Dag warnings. - DAG warnings are problems that don't rise to the level of failing the DAG parse + Dag warnings are problems that don't rise to the level of failing the Dag parse but which users should nonetheless be warned about. These warnings are recorded - when parsing DAG and displayed on the Webserver in a flash message. + when parsing Dag and displayed on the Webserver in a flash message. """ dag_id = Column(StringID(), primary_key=True) @@ -94,7 +94,7 @@ def purge_inactive_dag_warnings(cls, session: Session = NEW_SESSION) -> None: class DagWarningType(str, Enum): """ - Enum for DAG warning types. + Enum for Dag warning types. This is the set of allowable values for the ``warning_type`` field in the DagWarning model. diff --git a/airflow-core/src/airflow/models/deadline.py b/airflow-core/src/airflow/models/deadline.py index c199d85d43149..9aa2691824fa8 100644 --- a/airflow-core/src/airflow/models/deadline.py +++ b/airflow-core/src/airflow/models/deadline.py @@ -98,7 +98,7 @@ class Deadline(Base): id = Column(UUIDType(binary=False), primary_key=True, default=uuid6.uuid7) - # If the Deadline Alert is for a DAG, store the DAG run ID from the dag_run. + # If the Deadline Alert is for a DAG, store the Dag run ID from the dag_run. dagrun_id = Column(Integer, ForeignKey("dag_run.id", ondelete="CASCADE")) # The time after which the Deadline has passed and the callback should be triggered. @@ -187,7 +187,7 @@ def prune_deadlines(cls, *, session: Session, conditions: dict[Column, Any]) -> logger.debug("%d deadline records were deleted matching the conditions %s", deleted_count, conditions) - # Refresh any affected DAG runs. + # Refresh any affected Dag runs. for dagrun in dagruns_to_refresh: session.refresh(dagrun) diff --git a/airflow-core/src/airflow/models/errors.py b/airflow-core/src/airflow/models/errors.py index 6670df1dfaf62..aec37ceaf7d91 100644 --- a/airflow-core/src/airflow/models/errors.py +++ b/airflow-core/src/airflow/models/errors.py @@ -25,7 +25,7 @@ class ParseImportError(Base): - """Stores all Import Errors which are recorded when parsing DAGs and displayed on the Webserver.""" + """Stores all Import Errors which are recorded when parsing Dags and displayed on the Webserver.""" __tablename__ = "import_error" id = Column(Integer, primary_key=True) @@ -35,6 +35,6 @@ class ParseImportError(Base): stacktrace = Column(Text) def full_file_path(self) -> str: - """Return the full file path of the dag.""" + """Return the full file path of the Dag.""" bundle = DagBundlesManager().get_bundle(self.bundle_name) return "/".join([str(bundle.path), self.filename]) diff --git a/airflow-core/src/airflow/models/mappedoperator.py b/airflow-core/src/airflow/models/mappedoperator.py index 6e086beeaaae3..653d395baff50 100644 --- a/airflow-core/src/airflow/models/mappedoperator.py +++ b/airflow-core/src/airflow/models/mappedoperator.py @@ -66,9 +66,9 @@ def is_mapped(task: Operator) -> TypeGuard[MappedOperator]: @attrs.define( kw_only=True, # Disable custom __getstate__ and __setstate__ generation since it interacts - # badly with Airflow's DAG serialization and pickling. When a mapped task is + # badly with Airflow's Dag serialization and pickling. When a mapped task is # deserialized, subclasses are coerced into MappedOperator, but when it goes - # through DAG pickling, all attributes defined in the subclasses are dropped + # through Dag pickling, all attributes defined in the subclasses are dropped # by attrs's custom state management. Since attrs does not do anything too # special here (the logic is only important for slots=True), we use Python's # built-in implementation, which works (as proven by good old BaseOperator). @@ -77,7 +77,7 @@ def is_mapped(task: Operator) -> TypeGuard[MappedOperator]: ) # TODO (GH-52141): Duplicate DAGNode in the scheduler. class MappedOperator(DAGNode): - """Object representing a mapped operator in a DAG.""" + """Object representing a mapped operator in a Dag.""" # Stores minimal class type information (task_type, _operator_name) instead of full serialized data operator_class: dict[str, Any] @@ -299,7 +299,7 @@ def on_failure_fail_dagrun(self, v) -> None: @classmethod def get_serialized_fields(cls): - """Fields to extract from JSON-Serialized DAG.""" + """Fields to extract from JSON-Serialized Dag.""" return frozenset( { "_disallow_kwargs_override", diff --git a/airflow-core/src/airflow/models/referencemixin.py b/airflow-core/src/airflow/models/referencemixin.py index 19a775417f865..67bb477abc715 100644 --- a/airflow-core/src/airflow/models/referencemixin.py +++ b/airflow-core/src/airflow/models/referencemixin.py @@ -46,7 +46,7 @@ def iter_references(self) -> Iterable[tuple[Operator, str]]: """ Find underlying XCom references this contains. - This is used by the DAG parser to recursively find task dependencies. + This is used by the Dag parser to recursively find task dependencies. :meta private: """ diff --git a/airflow-core/src/airflow/models/serialized_dag.py b/airflow-core/src/airflow/models/serialized_dag.py index 2d9c65f80666a..dc7c2f631f748 100644 --- a/airflow-core/src/airflow/models/serialized_dag.py +++ b/airflow-core/src/airflow/models/serialized_dag.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Serialized DAG table in database.""" +"""Serialized Dag table in database.""" from __future__ import annotations @@ -64,7 +64,7 @@ class _DagDependenciesResolver: - """Resolver that resolves dag dependencies to include asset id and assets link to asset aliases.""" + """Resolver that resolves Dag dependencies to include asset id and assets link to asset aliases.""" def __init__(self, dag_id_dependencies: Sequence[tuple[str, dict]], session: Session) -> None: self.dag_id_dependencies = dag_id_dependencies @@ -265,16 +265,16 @@ def resolve_asset_alias_dag_dep(self, dep_data: dict) -> Iterator[DagDependency] class SerializedDagModel(Base): """ - A table for serialized DAGs. + A table for serialized Dags. - serialized_dag table is a snapshot of DAG files synchronized by scheduler. + serialized_dag table is a snapshot of Dag files synchronized by scheduler. This feature is controlled by: * ``[core] min_serialized_dag_update_interval = 30`` (s): - serialized DAGs are updated in DB when a file gets processed by scheduler, - to reduce DB write rate, there is a minimal interval of updating serialized DAGs. + serialized Dags are updated in DB when a file gets processed by scheduler, + to reduce DB write rate, there is a minimal interval of updating serialized Dags. * ``[dag_processor] refresh_interval = 300`` (s): - interval of deleting serialized DAGs in DB when the files are deleted, suggest + interval of deleting serialized Dags in DB when the files are deleted, suggest to use a smaller interval such as 60 * ``[core] compress_serialized_dags``: whether compressing the dag data to the Database. @@ -389,9 +389,9 @@ def write_dag( session: Session = NEW_SESSION, ) -> bool: """ - Serialize a DAG and writes it into database. + Serialize a Dag and writes it into database. - If the record already exists, it checks if the Serialized DAG changed or not. If it is + If the record already exists, it checks if the Serialized Dag changed or not. If it is changed, it updates the record, ignores otherwise. :param dag: a DAG to be written into database @@ -402,9 +402,9 @@ def write_dag( :returns: Boolean indicating if the DAG was written to the DB """ - # Checks if (Current Time - Time when the DAG was written to DB) < min_update_interval + # Checks if (Current Time - Time when the Dag was written to DB) < min_update_interval # If Yes, does nothing - # If No or the DAG does not exists, updates / writes Serialized DAG to DB + # If No or the Dag does not exists, updates / writes Serialized Dag to DB if min_update_interval is not None: if session.scalar( select(literal(True)) @@ -416,7 +416,7 @@ def write_dag( ): return False - log.debug("Checking if DAG (%s) changed", dag.dag_id) + log.debug("Checking if Dag (%s) changed", dag.dag_id) new_serialized_dag = cls(dag) serialized_dag_hash = session.scalars( select(cls.dag_hash).where(cls.dag_id == dag.dag_id).order_by(cls.created_at.desc()) @@ -428,17 +428,17 @@ def write_dag( and dag_version and dag_version.bundle_name == bundle_name ): - log.debug("Serialized DAG (%s) is unchanged. Skipping writing to DB", dag.dag_id) + log.debug("Serialized Dag (%s) is unchanged. Skipping writing to DB", dag.dag_id) return False if dag_version and not dag_version.task_instances: - # This is for dynamic DAGs that the hashes changes often. We should update + # This is for dynamic Dags that the hashes changes often. We should update # the serialized dag, the dag_version and the dag_code instead of a new version # if the dag_version is not associated with any task instances latest_ser_dag = cls.get(dag.dag_id, session=session) if TYPE_CHECKING: assert latest_ser_dag is not None - # Update the serialized DAG with the new_serialized_dag + # Update the serialized Dag with the new_serialized_dag latest_ser_dag._data = new_serialized_dag._data latest_ser_dag._data_compressed = new_serialized_dag._data_compressed latest_ser_dag.dag_hash = new_serialized_dag.dag_hash @@ -476,11 +476,11 @@ def get_latest_serialized_dags( cls, *, dag_ids: list[str], session: Session = NEW_SESSION ) -> list[SerializedDagModel]: """ - Get the latest serialized dags of given DAGs. + Get the latest serialized dags of given Dags. - :param dag_ids: The list of DAG IDs. + :param dag_ids: The list of Dag IDs. :param session: The database session. - :return: The latest serialized dag of the DAGs. + :return: The latest serialized dag of the Dags. """ # Subquery to get the latest serdag per dag_id latest_serdag_subquery = ( @@ -503,10 +503,10 @@ def get_latest_serialized_dags( @provide_session def read_all_dags(cls, session: Session = NEW_SESSION) -> dict[str, SerializedDAG]: """ - Read all DAGs in serialized_dag table. + Read all Dags in serialized_dag table. :param session: ORM Session - :returns: a dict of DAGs read from database + :returns: a dict of Dags read from database """ latest_serialized_dag_subquery = ( session.query(cls.dag_id, func.max(cls.created_at).label("max_created")) @@ -531,7 +531,7 @@ def read_all_dags(cls, session: Session = NEW_SESSION) -> dict[str, SerializedDA dags[row.dag_id] = dag else: log.warning( - "dag_id Mismatch in DB: Row with dag_id '%s' has Serialised DAG with '%s' dag_id", + "dag_id Mismatch in DB: Row with dag_id '%s' has Serialised Dag with '%s' dag_id", row.dag_id, dag.dag_id, ) @@ -550,23 +550,23 @@ def data(self) -> dict | None: @property def dag(self) -> SerializedDAG: - """The DAG deserialized from the ``data`` column.""" + """The Dag deserialized from the ``data`` column.""" SerializedDAG._load_operator_extra_links = self.load_op_links if isinstance(self.data, dict): data = self.data elif isinstance(self.data, str): data = json.loads(self.data) else: - raise ValueError("invalid or missing serialized DAG data") + raise ValueError("invalid or missing serialized Dag data") return SerializedDAG.from_dict(data) @classmethod @provide_session def has_dag(cls, dag_id: str, session: Session = NEW_SESSION) -> bool: """ - Check a DAG exist in serialized_dag table. + Check a Dag exist in serialized_dag table. - :param dag_id: the DAG to check + :param dag_id: the Dag to check :param session: ORM Session """ return session.scalar(select(literal(True)).where(cls.dag_id == dag_id).limit(1)) is not None @@ -585,7 +585,7 @@ def get(cls, dag_id: str, session: Session = NEW_SESSION) -> SerializedDagModel """ Get the SerializedDAG for the given dag ID. - :param dag_id: the DAG to fetch + :param dag_id: the Dag to fetch :param session: ORM Session """ return session.scalar(cls.latest_item_select_object(dag_id)) @@ -594,9 +594,9 @@ def get(cls, dag_id: str, session: Session = NEW_SESSION) -> SerializedDagModel @provide_session def get_last_updated_datetime(cls, dag_id: str, session: Session = NEW_SESSION) -> datetime | None: """ - Get the date when the Serialized DAG associated to DAG was last updated in serialized_dag table. + Get the date when the Serialized Dag associated to Dag was last updated in serialized_dag table. - :param dag_id: DAG ID + :param dag_id: Dag ID :param session: ORM Session """ return session.scalar( @@ -607,7 +607,7 @@ def get_last_updated_datetime(cls, dag_id: str, session: Session = NEW_SESSION) @provide_session def get_max_last_updated_datetime(cls, session: Session = NEW_SESSION) -> datetime | None: """ - Get the maximum date when any DAG was last updated in serialized_dag table. + Get the maximum date when any Dag was last updated in serialized_dag table. :param session: ORM Session """ @@ -617,11 +617,11 @@ def get_max_last_updated_datetime(cls, session: Session = NEW_SESSION) -> dateti @provide_session def get_latest_version_hash(cls, dag_id: str, session: Session = NEW_SESSION) -> str | None: """ - Get the latest DAG version for a given DAG ID. + Get the latest Dag version for a given Dag ID. - :param dag_id: DAG ID + :param dag_id: Dag ID :param session: ORM Session - :return: DAG Hash, or None if the DAG is not found + :return: Dag Hash, or None if the Dag is not found """ return session.scalar( select(cls.dag_hash).where(cls.dag_id == dag_id).order_by(cls.created_at.desc()).limit(1) @@ -635,12 +635,12 @@ def get_latest_version_hash_and_updated_datetime( session: Session, ) -> tuple[str, datetime] | None: """ - Get the latest version for a DAG ID and the date it was last updated in serialized_dag table. + Get the latest version for a Dag ID and the date it was last updated in serialized_dag table. :meta private: - :param dag_id: DAG ID + :param dag_id: Dag ID :param session: ORM Session - :return: A tuple of DAG Hash and last updated datetime, or None if the DAG is not found + :return: A tuple of Dag Hash and last updated datetime, or None if the Dag is not found """ return session.execute( select(cls.dag_hash, cls.created_at) @@ -653,7 +653,7 @@ def get_latest_version_hash_and_updated_datetime( @provide_session def get_dag_dependencies(cls, session: Session = NEW_SESSION) -> dict[str, list[DagDependency]]: """ - Get the dependencies between DAGs. + Get the dependencies between Dags. :param session: ORM Session """ diff --git a/airflow-core/src/airflow/models/taskinstance.py b/airflow-core/src/airflow/models/taskinstance.py index e81b1691f7000..5a8c26452f5e0 100644 --- a/airflow-core/src/airflow/models/taskinstance.py +++ b/airflow-core/src/airflow/models/taskinstance.py @@ -215,7 +215,7 @@ def clear_task_instances( :param session: current session :param dag_run_state: state to set finished DagRuns to. If set to False, DagRuns state will not be changed. - :param run_on_latest_version: whether to run on latest serialized DAG and Bundle version + :param run_on_latest_version: whether to run on latest serialized Dag and Bundle version :meta private: """ @@ -247,7 +247,7 @@ def clear_task_instances( assert ti.task ti.max_tries = ti.try_number + task.retries else: - # Ignore errors when updating max_tries if the DAG or + # Ignore errors when updating max_tries if the Dag or # task are not found since database records could be # outdated. We make max_tries the maximum value of its # original max_tries or the last attempted try number. @@ -860,7 +860,7 @@ def get_previous_dagrun( from airflow.models.dagrun import DagRun # Avoid circular import # We always ignore schedule in dagrun lookup when `state` is given - # or the DAG is never scheduled. For legacy reasons, when + # or the Dag is never scheduled. For legacy reasons, when # `catchup=True`, we use `get_previous_scheduled_dagrun` unless # `ignore_schedule` is `True`. ignore_schedule = state is not None or not dag.timetable.can_be_scheduled @@ -1063,7 +1063,7 @@ def _check_and_change_state_before_execution( :param verbose: whether to turn on more verbose logging :param ignore_all_deps: Ignore all of the non-critical dependencies, just runs - :param ignore_depends_on_past: Ignore depends_on_past DAG attribute + :param ignore_depends_on_past: Ignore depends_on_past Dag attribute :param wait_for_past_depends_before_skipping: Wait for past depends before mark the ti as skipped :param ignore_task_deps: Don't check the dependencies of this TaskInstance's task :param ignore_ti_state: Disregards previous task instance state @@ -1618,7 +1618,7 @@ def fetch_handle_failure_context( # try_number exceeds the max_tries ... or if force_fail is truthy # Use the original task directly - scheduler only needs to check email settings - # Actual callbacks are handled by the DAG processor, not the scheduler + # Actual callbacks are handled by the Dag processor, not the scheduler task = getattr(ti, "task", None) if not ti.is_eligible_to_retry(): diff --git a/airflow-core/src/airflow/models/taskmap.py b/airflow-core/src/airflow/models/taskmap.py index e48c53aa4034e..2346c637f771a 100644 --- a/airflow-core/src/airflow/models/taskmap.py +++ b/airflow-core/src/airflow/models/taskmap.py @@ -181,7 +181,7 @@ def expand_mapped_task( # The unmapped task instance still exists and is unfinished, i.e. we # haven't tried to run it before. if total_length is None: - # If the DAG is partial, it's likely that the upstream tasks + # If the Dag is partial, it's likely that the upstream tasks # are not done yet, so the task can't fail yet. if not task.dag or not task.dag.partial: unmapped_ti.state = TaskInstanceState.UPSTREAM_FAILED diff --git a/airflow-core/src/airflow/models/trigger.py b/airflow-core/src/airflow/models/trigger.py index 41cdea470a9a1..c4a967083155c 100644 --- a/airflow-core/src/airflow/models/trigger.py +++ b/airflow-core/src/airflow/models/trigger.py @@ -74,7 +74,7 @@ class Trigger(Base): Triggers are a workload that run in an asynchronous event loop shared with other Triggers, and fire off events that will unpause deferred Tasks, - start linked DAGs, etc. + start linked Dags, etc. They are persisted into the database and then re-hydrated into a "triggerer" process, where many are run at once. We model it so that @@ -82,7 +82,7 @@ class Trigger(Base): deduplication logic to use. Rows will be evicted from the database when the triggerer detects no - active Tasks/DAGs using them. Events are not stored in the database; + active Tasks/Dags using them. Events are not stored in the database; when an Event is fired, the triggerer will directly push its data to the appropriate Task/DAG. """ @@ -364,7 +364,7 @@ def get_sorted_triggers(cls, capacity: int, alive_triggerer_ids: list[int] | Sel result: list[int] = [] # Add triggers associated to deadlines first, then tasks, then assets - # It prioritizes deadline triggers, then DAGs over event driven scheduling which is fair + # It prioritizes deadline triggers, then Dags over event driven scheduling which is fair queries = [ # Deadline triggers select(cls.id).where(cls.deadline.has()).order_by(cls.created_date), diff --git a/airflow-core/src/airflow/models/xcom.py b/airflow-core/src/airflow/models/xcom.py index e9fc2ac2bfc9a..7f3810a28e82c 100644 --- a/airflow-core/src/airflow/models/xcom.py +++ b/airflow-core/src/airflow/models/xcom.py @@ -126,9 +126,9 @@ def clear( .. note:: This **will not** purge any data from a custom XCom backend. - :param dag_id: ID of DAG to clear the XCom for. + :param dag_id: ID of Dag to clear the XCom for. :param task_id: ID of task to clear the XCom for. - :param run_id: ID of DAG run to clear the XCom for. + :param run_id: ID of Dag run to clear the XCom for. :param map_index: If given, only clear XCom from this particular mapped task. The default ``None`` clears *all* XComs from the task. :param session: Database session. If not given, a new session will be @@ -172,9 +172,9 @@ def set( :param key: Key to store the XCom. :param value: XCom value to store. - :param dag_id: DAG ID. + :param dag_id: Dag ID. :param task_id: Task ID. - :param run_id: DAG run ID for the task. + :param run_id: Dag run ID for the task. :param map_index: Optional map index to assign XCom for a mapped task. The default is ``-1`` (set for a non-mapped task). :param session: Database session. If not given, a new session will be @@ -190,7 +190,7 @@ def set( dag_run_id = session.query(DagRun.id).filter_by(dag_id=dag_id, run_id=run_id).scalar() if dag_run_id is None: - raise ValueError(f"DAG run not found on DAG {dag_id!r} with ID {run_id!r}") + raise ValueError(f"Dag run not found on Dag {dag_id!r} with ID {run_id!r}") # Seamlessly resolve LazySelectSequence to a list. This intends to work # as a "lazy list" to avoid pulling a ton of XComs unnecessarily, but if @@ -198,7 +198,7 @@ def set( # implications, and this avoids leaking the implementation detail. if isinstance(value, LazySelectSequence): warning_message = ( - "Coercing mapped lazy proxy %s from task %s (DAG %s, run %s) " + "Coercing mapped lazy proxy %s from task %s (Dag %s, run %s) " "to list, which may degrade performance. Review resource " "requirements for this operation, and call list() to suppress " "this message. See Dynamic Task Mapping documentation for " @@ -265,17 +265,17 @@ def get_many( This function returns an SQLAlchemy query of full XCom objects. If you just want one stored value, use :meth:`get_one` instead. - :param run_id: DAG run ID for the task. + :param run_id: Dag run ID for the task. :param key: A key for the XComs. If provided, only XComs with matching keys will be returned. Pass *None* (default) to remove the filter. :param task_ids: Only XComs from task with matching IDs will be pulled. Pass *None* (default) to remove the filter. - :param dag_ids: Only pulls XComs from specified DAGs. Pass *None* + :param dag_ids: Only pulls XComs from specified Dags. Pass *None* (default) to remove the filter. :param map_indexes: Only XComs from matching map indexes will be pulled. Pass *None* (default) to remove the filter. :param include_prior_dates: If *False* (default), only XComs from the - specified DAG run are returned. If *True*, all matching XComs are + specified Dag run are returned. If *True*, all matching XComs are returned regardless of the run it belongs to. :param session: Database session. If not given, a new session will be created for this function. diff --git a/airflow-core/src/airflow/models/xcom_arg.py b/airflow-core/src/airflow/models/xcom_arg.py index 78021e5043123..5a8a80b1f1cef 100644 --- a/airflow-core/src/airflow/models/xcom_arg.py +++ b/airflow-core/src/airflow/models/xcom_arg.py @@ -52,7 +52,7 @@ def _deserialize(cls, data: dict[str, Any], dag: SchedulerDAG) -> Self: The implementation should be the inverse function to ``serialize``, implementing given a data dict converted from this XComArg derivative, - how the original XComArg should be created. DAG serialization relies on + how the original XComArg should be created. Dag serialization relies on additional information added in ``serialize_xcom_arg`` to dispatch data dicts to the correct ``_deserialize`` information, so this function does not need to validate whether the incoming data contains correct keys. @@ -220,7 +220,7 @@ def _(xcom_arg: SchedulerConcatXComArg, run_id: str, *, session: Session): def deserialize_xcom_arg(data: dict[str, Any], dag: SchedulerDAG): - """DAG serialization interface.""" + """Dag serialization interface.""" klass = _XCOM_ARG_TYPES[data.get("type", "")] return klass._deserialize(data, dag) diff --git a/airflow-core/src/airflow/plugins_manager.py b/airflow-core/src/airflow/plugins_manager.py index 20377e6165cd8..b2353be47805f 100644 --- a/airflow-core/src/airflow/plugins_manager.py +++ b/airflow-core/src/airflow/plugins_manager.py @@ -83,7 +83,7 @@ """ Mapping of class names to class of OperatorLinks registered by plugins. -Used by the DAG serialization code to only allow specific classes to be created +Used by the Dag serialization code to only allow specific classes to be created during deserialization """ PLUGINS_ATTRIBUTES_TO_DUMP = { @@ -178,10 +178,10 @@ class AirflowPlugin: # buttons. operator_extra_links: list[Any] = [] - # A list of timetable classes that can be used for DAG scheduling. + # A list of timetable classes that can be used for Dag scheduling. timetables: list[type[Timetable]] = [] - # A list of listeners that can be used for tracking task and DAG states. + # A list of listeners that can be used for tracking task and Dag states. listeners: list[ModuleType | object] = [] # A list of hook lineage reader classes that can be used for reading lineage information from a hook. diff --git a/airflow-core/src/airflow/policies.py b/airflow-core/src/airflow/policies.py index 933ccaa24522c..aa84693a03d35 100644 --- a/airflow-core/src/airflow/policies.py +++ b/airflow-core/src/airflow/policies.py @@ -38,7 +38,7 @@ def task_policy(task: BaseOperator) -> None: Allow altering tasks after they are loaded in the DagBag. It allows administrator to rewire some task's parameters. Alternatively you can raise - ``AirflowClusterPolicyViolation`` exception to stop DAG from being executed. + ``AirflowClusterPolicyViolation`` exception to stop Dag from being executed. Here are a few examples of how this can be useful: @@ -53,16 +53,16 @@ def task_policy(task: BaseOperator) -> None: @local_settings_hookspec def dag_policy(dag: DAG) -> None: """ - Allow altering DAGs after they are loaded in the DagBag. + Allow altering Dags after they are loaded in the DagBag. It allows administrator to rewire some DAG's parameters. Alternatively you can raise ``AirflowClusterPolicyViolation`` exception - to stop DAG from being executed. + to stop Dag from being executed. Here are a few examples of how this can be useful: - * You could enforce default user for DAGs - * Check if every DAG has configured tags + * You could enforce default user for Dags + * Check if every Dag has configured tags :param dag: dag to be mutated """ @@ -108,12 +108,12 @@ def get_airflow_context_vars(context) -> dict[str, str]: # type: ignore[empty-b @local_settings_hookspec(firstresult=True) def get_dagbag_import_timeout(dag_file_path: str) -> int | float: # type: ignore[empty-body] """ - Allow for dynamic control of the DAG file parsing timeout based on the DAG file path. + Allow for dynamic control of the Dag file parsing timeout based on the Dag file path. - It is useful when there are a few DAG files requiring longer parsing times, while others do not. - You can control them separately instead of having one value for all DAG files. + It is useful when there are a few Dag files requiring longer parsing times, while others do not. + You can control them separately instead of having one value for all Dag files. - If the return value is less than or equal to 0, it means no timeout during the DAG parsing. + If the return value is less than or equal to 0, it means no timeout during the Dag parsing. """ diff --git a/airflow-core/src/airflow/security/permissions.py b/airflow-core/src/airflow/security/permissions.py index 6ae47faefbecc..da31bb13cb199 100644 --- a/airflow-core/src/airflow/security/permissions.py +++ b/airflow-core/src/airflow/security/permissions.py @@ -106,7 +106,7 @@ class ResourceDetails(TypedDict): def resource_name(root_dag_id: str, resource: str) -> str: - """Return the resource name for a DAG id.""" + """Return the resource name for a Dag id.""" if root_dag_id in RESOURCE_DETAILS_MAP.keys(): return root_dag_id if root_dag_id.startswith(tuple(PREFIX_RESOURCES_MAP.keys())): @@ -116,7 +116,7 @@ def resource_name(root_dag_id: str, resource: str) -> str: def resource_name_for_dag(root_dag_id: str) -> str: """ - Return the resource name for a DAG id. + Return the resource name for a Dag ID. Note: This function is kept for backwards compatibility. """ diff --git a/airflow-core/src/airflow/serialization/__init__.py b/airflow-core/src/airflow/serialization/__init__.py index ea277edbaf0f4..46588c8f05500 100644 --- a/airflow-core/src/airflow/serialization/__init__.py +++ b/airflow-core/src/airflow/serialization/__init__.py @@ -15,4 +15,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""DAG serialization.""" +"""Dag serialization.""" diff --git a/airflow-core/src/airflow/serialization/enums.py b/airflow-core/src/airflow/serialization/enums.py index 11c37b3bd1a4e..314f6fb48aa49 100644 --- a/airflow-core/src/airflow/serialization/enums.py +++ b/airflow-core/src/airflow/serialization/enums.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Enums for DAG serialization.""" +"""Enums for Dag serialization.""" from __future__ import annotations @@ -34,7 +34,7 @@ class Encoding(str, Enum): # Supported types for encoding. primitives and list are not encoded. @unique class DagAttributeTypes(str, Enum): - """Enum of supported attribute types of DAG.""" + """Enum of supported attribute types of Dag.""" DAG = "dag" ASSET_EVENT_ACCESSORS = "asset_event_accessors" diff --git a/airflow-core/src/airflow/serialization/helpers.py b/airflow-core/src/airflow/serialization/helpers.py index 949b3cb9c9f09..3ff7b78b6bd61 100644 --- a/airflow-core/src/airflow/serialization/helpers.py +++ b/airflow-core/src/airflow/serialization/helpers.py @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Serialized DAG and BaseOperator.""" +"""Serialized Dag and BaseOperator.""" from __future__ import annotations diff --git a/airflow-core/src/airflow/serialization/json_schema.py b/airflow-core/src/airflow/serialization/json_schema.py index c74f207048765..9e12746744bb0 100644 --- a/airflow-core/src/airflow/serialization/json_schema.py +++ b/airflow-core/src/airflow/serialization/json_schema.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""jsonschema for validating serialized DAG and operator.""" +"""jsonschema for validating serialized Dag and operator.""" from __future__ import annotations @@ -55,7 +55,7 @@ def iter_errors(self, instance) -> Iterable[jsonschema.exceptions.ValidationErro def load_dag_schema_dict() -> dict: - """Load & return Json Schema for DAG as Python dict.""" + """Load & return Json Schema for Dag as Python dict.""" schema_file_name = "schema.json" schema_file = pkgutil.get_data(__name__, schema_file_name) @@ -67,7 +67,7 @@ def load_dag_schema_dict() -> dict: def load_dag_schema() -> Validator: - """Load & Validate Json Schema for DAG.""" + """Load & Validate Json Schema for Dag.""" import jsonschema schema = load_dag_schema_dict() diff --git a/airflow-core/src/airflow/serialization/serialized_objects.py b/airflow-core/src/airflow/serialization/serialized_objects.py index 0a33a1ecf25b8..39bf468ee625d 100644 --- a/airflow-core/src/airflow/serialization/serialized_objects.py +++ b/airflow-core/src/airflow/serialization/serialized_objects.py @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Serialized DAG and BaseOperator.""" +"""Serialized Dag and BaseOperator.""" # TODO: update test_recursive_serialize_calls_must_forward_kwargs and re-enable RET505 # ruff: noqa: RET505 @@ -170,7 +170,7 @@ def encode_timezone(var: Timezone | FixedTimezone) -> str | int: if isinstance(var, Timezone): return var.name raise ValueError( - f"DAG timezone should be a pendulum.tz.Timezone, not {var!r}. " + f"Dag timezone should be a pendulum.tz.Timezone, not {var!r}. " f"See {get_docs_url('timezone.html#time-zone-aware-dags')}" ) @@ -593,24 +593,24 @@ class BaseSerialization: @classmethod def to_json(cls, var: DAG | SchedulerOperator | dict | list | set | tuple) -> str: - """Stringify DAGs and operators contained by var and returns a JSON string of var.""" + """Stringify Dags and operators contained by var and returns a JSON string of var.""" return json.dumps(cls.to_dict(var), ensure_ascii=True) @classmethod def to_dict(cls, var: DAG | SchedulerOperator | dict | list | set | tuple) -> dict: - """Stringify DAGs and operators contained by var and returns a dict of var.""" + """Stringify Dags and operators contained by var and returns a dict of var.""" # Don't call on this class directly - only SerializedDAG or # SerializedBaseOperator should be used as the "entrypoint" raise NotImplementedError() @classmethod def from_json(cls, serialized_obj: str) -> BaseSerialization | dict | list | set | tuple: - """Deserialize json_str and reconstructs all DAGs and operators it contains.""" + """Deserialize json_str and reconstructs all Dags and operators it contains.""" return cls.from_dict(json.loads(serialized_obj)) @classmethod def from_dict(cls, serialized_obj: dict[Encoding, Any]) -> BaseSerialization | dict | list | set | tuple: - """Deserialize a dict of type decorators and reconstructs all DAGs and operators it contains.""" + """Deserialize a dict of type decorators and reconstructs all Dags and operators it contains.""" return cls.deserialize(serialized_obj) @classmethod @@ -1030,7 +1030,7 @@ def is_serialized(val): @classmethod def _serialize_params_dict(cls, params: ParamsDict | dict) -> list[tuple[str, dict]]: - """Serialize Params dict for a DAG or task as a list of tuples to ensure ordering.""" + """Serialize Params dict for a Dag or task as a list of tuples to ensure ordering.""" serialized_params = [] for k, v in params.items(): if isinstance(params, ParamsDict): @@ -1043,13 +1043,13 @@ def _serialize_params_dict(cls, params: ParamsDict | dict) -> list[tuple[str, di if class_identity == "airflow.sdk.definitions.param.Param": serialized_params.append((k, cls._serialize_param(v))) else: - # Auto-box other values into Params object like it is done by DAG parsing as well + # Auto-box other values into Params object like it is done by Dag parsing as well serialized_params.append((k, cls._serialize_param(Param(v)))) return serialized_params @classmethod def _deserialize_params_dict(cls, encoded_params: list[tuple[str, dict]]) -> ParamsDict: - """Deserialize a DAG's Params dict.""" + """Deserialize a Dag's Params dict.""" if isinstance(encoded_params, collections.abc.Mapping): # in 2.9.2 or earlier params were serialized as JSON objects encoded_param_pairs: Iterable[tuple[str, dict]] = encoded_params.items() @@ -1110,7 +1110,7 @@ def get_schema_defaults(cls, object_type: str) -> dict[str, Any]: class DependencyDetector: """ - Detects dependencies between DAGs. + Detects dependencies between Dags. :meta private: """ @@ -1193,7 +1193,7 @@ def detect_task_dependencies(task: SdkOperator) -> list[DagDependency]: @staticmethod def detect_dag_dependencies(dag: SdkDag | None) -> Iterable[DagDependency]: - """Detect dependencies set directly on the DAG object.""" + """Detect dependencies set directly on the Dag object.""" if not dag: return yield from dag.timetable.asset_condition.iter_dag_dependencies(source="", target=dag.dag_id) @@ -1211,7 +1211,7 @@ class SerializedBaseOperator(DAGNode, BaseSerialization): 1. Instantiate a :class:`SerializedBaseOperator` object. 2. Populate attributes with :func:`SerializedBaseOperator.populated_operator`. - 3. When the task's containing DAG is available, fix references to the DAG + 3. When the task's containing Dag is available, fix references to the DAG with :func:`SerializedBaseOperator.set_task_dag_references`. """ @@ -1519,7 +1519,7 @@ def populate_operator( This covers simple attributes that don't reference other things in the DAG. Setting references (such as ``op.dag`` and task dependencies) is done in ``set_task_dag_references`` instead, which is called after the - DAG is hydrated. + Dag is hydrated. """ # Apply defaults by merging them into encoded_op BEFORE main deserialization encoded_op = cls._apply_defaults_to_encoded_op(encoded_op, client_defaults) @@ -1658,11 +1658,11 @@ def populate_operator( @staticmethod def set_task_dag_references(task: SchedulerOperator, dag: DAG) -> None: """ - Handle DAG references on an operator. + Handle Dag references on an operator. The operator should have been mostly populated earlier by calling ``populate_operator``. This function further fixes object references - that were not possible before the task's containing DAG is hydrated. + that were not possible before the task's containing Dag is hydrated. """ task.dag = dag @@ -1774,7 +1774,7 @@ def _preprocess_encoded_operator(cls, encoded_op: dict[str, Any]) -> dict[str, A @classmethod def detect_dependencies(cls, op: SdkOperator) -> set[DagDependency]: - """Detect between DAG dependencies for the operator.""" + """Detect between Dag dependencies for the operator.""" dependency_detector = DependencyDetector() deps = set(dependency_detector.detect_task_dependencies(op)) return deps @@ -2115,7 +2115,7 @@ def _apply_defaults_to_encoded_op( encoded_op: The serialized operator data (already includes applied default_args) client_defaults: SDK-specific defaults from client_defaults section - Note: DAG default_args are already applied during task creation in the SDK, + Note: Dag default_args are already applied during task creation in the SDK, so encoded_op contains the final resolved values. Hierarchy (lowest to highest priority): @@ -2143,10 +2143,10 @@ def _iter_all_mapped_downstreams(self) -> Iterator[MappedOperator | MappedTaskGr """ Return mapped nodes that are direct dependencies of the current task. - For now, this walks the entire DAG to find mapped nodes that has this + For now, this walks the entire Dag to find mapped nodes that has this current task as an upstream. We cannot use ``downstream_list`` since it only contains operators, not task groups. In the future, we should - provide a way to record an DAG node's all downstream nodes instead. + provide a way to record an Dag node's all downstream nodes instead. Note that this does not guarantee the returned tasks actually use the current task for task mapping, but only checks those task are mapped @@ -2182,10 +2182,10 @@ def iter_mapped_dependants(self) -> Iterator[MappedOperator | MappedTaskGroup]: """ Return mapped nodes that depend on the current task the expansion. - For now, this walks the entire DAG to find mapped nodes that has this + For now, this walks the entire Dag to find mapped nodes that has this current task as an upstream. We cannot use ``downstream_list`` since it only contains operators, not task groups. In the future, we should - provide a way to record an DAG node's all downstream nodes instead. + provide a way to record an Dag node's all downstream nodes instead. """ return ( downstream @@ -2228,7 +2228,7 @@ def get_needs_expansion(self) -> bool: @methodtools.lru_cache(maxsize=1) def get_parse_time_mapped_ti_count(self) -> int: """ - Return the number of mapped task instances that can be created on DAG run creation. + Return the number of mapped task instances that can be created on Dag run creation. This only considers literal mapped arguments, and would return *None* when any non-literal values are used for mapping. @@ -2250,7 +2250,7 @@ class SerializedDAG(DAG, BaseSerialization): """ A JSON serializable representation of DAG. - A stringified DAG can only be used in the scope of scheduler and webserver, because fields + A stringified Dag can only be used in the scope of scheduler and webserver, because fields that are not serializable, such as functions and customer defined classes, are casted to strings. """ @@ -2275,7 +2275,7 @@ def __get_constructor_defaults(): @classmethod def serialize_dag(cls, dag: SdkDag) -> dict: - """Serialize a DAG into a JSON object.""" + """Serialize a Dag into a JSON object.""" try: serialized_dag = cls.serialize_to_json(dag, cls._decorated_fields) serialized_dag["_processor_dags_folder"] = DAGS_FOLDER @@ -2305,13 +2305,13 @@ def serialize_dag(cls, dag: SdkDag) -> dict: except SerializationError: raise except Exception as e: - raise SerializationError(f"Failed to serialize DAG {dag.dag_id!r}: {e}") + raise SerializationError(f"Failed to serialize Dag {dag.dag_id!r}: {e}") @classmethod def deserialize_dag( cls, encoded_dag: dict[str, Any], client_defaults: dict[str, Any] | None = None ) -> SerializedDAG: - """Deserializes a DAG from a JSON object.""" + """Deserializes a Dag from a JSON object.""" if "dag_id" not in encoded_dag: raise RuntimeError( "Encoded dag object has no dag_id key. You may need to run `airflow dags reserialize`." @@ -2408,7 +2408,7 @@ def _is_excluded(cls, var: Any, attrname: str, op: DAGNode): @classmethod def to_dict(cls, var: Any) -> dict: - """Stringifies DAGs and operators contained by var and returns a dict of var.""" + """Stringifies Dags and operators contained by var and returns a dict of var.""" # Clear any cached client_defaults to ensure fresh generation for this DAG # Clear lru_cache for client defaults SerializedBaseOperator.generate_client_defaults.cache_clear() @@ -2421,7 +2421,7 @@ def to_dict(cls, var: Any) -> dict: if client_defaults: json_dict["client_defaults"] = {"tasks": client_defaults} - # Validate Serialized DAG with Json Schema. Raises Error if it mismatches + # Validate Serialized Dag with Json Schema. Raises Error if it mismatches cls.validate_schema(json_dict) return json_dict @@ -2558,7 +2558,7 @@ def _create_compat_timetable(value): @classmethod def from_dict(cls, serialized_obj: dict) -> SerializedDAG: - """Deserializes a python dict in to the DAG and operators it contains.""" + """Deserializes a python dict in to the Dag and operators it contains.""" ver = serialized_obj.get("__version", "") if ver not in (1, 2): raise ValueError(f"Unsure how to deserialize version {ver!r}") @@ -2689,10 +2689,10 @@ def _has_kubernetes() -> bool: class LazyDeserializedDAG(pydantic.BaseModel): """ - Lazily build information from the serialized DAG structure. + Lazily build information from the serialized Dag structure. - An object that will present "enough" of the DAG like interface to update DAG db models etc, without having - to deserialize the full DAG and Task hierarchy. + An object that will present "enough" of the Dag like interface to update Dag db models etc, without having + to deserialize the full Dag and Task hierarchy. """ data: dict @@ -2795,7 +2795,7 @@ def get_task_assets( def get_run_data_interval(self, run: DagRun) -> DataInterval | None: """Get the data interval of this run.""" if run.dag_id is not None and run.dag_id != self.dag_id: - raise ValueError(f"Arguments refer to different DAGs: {self.dag_id} != {run.dag_id}") + raise ValueError(f"Arguments refer to different Dags: {self.dag_id} != {run.dag_id}") data_interval = _get_model_data_interval(run, "data_interval_start", "data_interval_end") if data_interval is None and run.logical_date is not None: diff --git a/airflow-core/src/airflow/settings.py b/airflow-core/src/airflow/settings.py index 895acf6feabe4..2e436486c34ef 100644 --- a/airflow-core/src/airflow/settings.py +++ b/airflow-core/src/airflow/settings.py @@ -121,7 +121,7 @@ async_engine: AsyncEngine AsyncSession: Callable[..., SAAsyncSession] -# The JSON library to use for DAG Serialization and De-Serialization +# The JSON library to use for Dag Serialization and De-Serialization json = json # Display alerts on the dashboard @@ -249,7 +249,7 @@ def configure_vars(): # If donot_modify_handlers=True, we do not modify logging handlers in task_run command # If the flag is set to False, we remove all handlers from the root logger # and add all handlers from 'airflow.task' logger to the root Logger. This is done - # to get all the logs from the print & log statements in the DAG files before a task is run + # to get all the logs from the print & log statements in the Dag files before a task is run # The handlers are restored after the task completes execution. DONOT_MODIFY_HANDLERS = conf.getboolean("logging", "donot_modify_handlers", fallback=False) @@ -679,15 +679,15 @@ def initialize(): MEGABYTE = KILOBYTE * KILOBYTE WEB_COLORS = {"LIGHTBLUE": "#4d9de0", "LIGHTORANGE": "#FF9933"} -# Updating serialized DAG can not be faster than a minimum interval to reduce database +# Updating serialized Dag can not be faster than a minimum interval to reduce database # write rate. MIN_SERIALIZED_DAG_UPDATE_INTERVAL = conf.getint("core", "min_serialized_dag_update_interval", fallback=30) -# If set to True, serialized DAGs is compressed before writing to DB, +# If set to True, serialized Dags is compressed before writing to DB, COMPRESS_SERIALIZED_DAGS = conf.getboolean("core", "compress_serialized_dags", fallback=False) -# Fetching serialized DAG can not be faster than a minimum interval to reduce database -# read rate. This config controls when your DAGs are updated in the Webserver +# Fetching serialized Dag can not be faster than a minimum interval to reduce database +# read rate. This config controls when your Dags are updated in the Webserver MIN_SERIALIZED_DAG_FETCH_INTERVAL = conf.getint("core", "min_serialized_dag_fetch_interval", fallback=10) CAN_FORK = hasattr(os, "fork") diff --git a/airflow-core/src/airflow/task/priority_strategy.py b/airflow-core/src/airflow/task/priority_strategy.py index 05209fec8a3e3..acafa96efca9f 100644 --- a/airflow-core/src/airflow/task/priority_strategy.py +++ b/airflow-core/src/airflow/task/priority_strategy.py @@ -50,8 +50,8 @@ def deserialize(cls, data: dict[str, Any]) -> PriorityWeightStrategy: """ Deserialize a priority weight strategy from data. - This is called when a serialized DAG is deserialized. ``data`` will be whatever - was returned by ``serialize`` during DAG serialization. The default + This is called when a serialized Dag is deserialized. ``data`` will be whatever + was returned by ``serialize`` during Dag serialization. The default implementation constructs the priority weight strategy without any arguments. """ return cls(**data) @@ -60,9 +60,9 @@ def serialize(self) -> dict[str, Any]: """ Serialize the priority weight strategy for JSON encoding. - This is called during DAG serialization to store priority weight strategy information + This is called during Dag serialization to store priority weight strategy information in the database. This should return a JSON-serializable dict that will be fed into - ``deserialize`` when the DAG is deserialized. The default implementation returns + ``deserialize`` when the Dag is deserialized. The default implementation returns an empty dict. """ return {} diff --git a/airflow-core/src/airflow/ti_deps/dep_context.py b/airflow-core/src/airflow/ti_deps/dep_context.py index 056b633f36122..778ffef2755d0 100644 --- a/airflow-core/src/airflow/ti_deps/dep_context.py +++ b/airflow-core/src/airflow/ti_deps/dep_context.py @@ -59,7 +59,7 @@ class DepContext: side effects). :param ignore_all_deps: Whether or not the context should ignore all ignorable dependencies. Overrides the other ignore_* parameters - :param ignore_depends_on_past: Ignore depends_on_past parameter of DAGs (e.g. for + :param ignore_depends_on_past: Ignore depends_on_past parameter of Dags (e.g. for Backfills) :param wait_for_past_depends_before_skipping: Wait for past depends before marking the ti as skipped :param ignore_in_retry_period: Ignore the retry period for task instances @@ -92,7 +92,7 @@ def ensure_finished_tis(self, dag_run: DagRun, session: Session) -> list[TaskIns Ensure finished_tis is populated if it's currently None, which allows running tasks without dag_run. :param dag_run: The DagRun for which to find finished tasks - :return: A list of all the finished tasks of this DAG and logical_date + :return: A list of all the finished tasks of this Dag and logical_date """ if self.finished_tis is None: finished_tis = dag_run.get_task_instances(state=State.finished, session=session) @@ -101,7 +101,7 @@ def ensure_finished_tis(self, dag_run: DagRun, session: Session) -> list[TaskIns continue with contextlib.suppress(TaskNotFound): # TODO (GH-52141): get_task in scheduler should contain scheduler - # types instead, but currently it inherits SDK's DAG. + # types instead, but currently it inherits SDK's Dag. ti.task = cast("MappedOperator | SerializedBaseOperator", dag.get_task(ti.task_id)) self.finished_tis = finished_tis else: diff --git a/airflow-core/src/airflow/ti_deps/deps/dag_ti_slots_available_dep.py b/airflow-core/src/airflow/ti_deps/deps/dag_ti_slots_available_dep.py index 550695afeb04a..b44d21fc7209f 100644 --- a/airflow-core/src/airflow/ti_deps/deps/dag_ti_slots_available_dep.py +++ b/airflow-core/src/airflow/ti_deps/deps/dag_ti_slots_available_dep.py @@ -22,7 +22,7 @@ class DagTISlotsAvailableDep(BaseTIDep): - """Determines whether a DAG maximum number of running tasks has been reached.""" + """Determines whether a Dag maximum number of running tasks has been reached.""" NAME = "Task Instance Slots Available" IGNORABLE = True @@ -33,6 +33,6 @@ def _get_dep_statuses(self, ti, session, dep_context): yield self._failing_status( reason=( f"The maximum number of running tasks ({ti.task.dag.max_active_tasks}) for " - f"this task's DAG '{ti.dag_id}' has been reached." + f"this task's Dag '{ti.dag_id}' has been reached." ) ) diff --git a/airflow-core/src/airflow/ti_deps/deps/dag_unpaused_dep.py b/airflow-core/src/airflow/ti_deps/deps/dag_unpaused_dep.py index a854d21632d7d..ca8d2fd272580 100644 --- a/airflow-core/src/airflow/ti_deps/deps/dag_unpaused_dep.py +++ b/airflow-core/src/airflow/ti_deps/deps/dag_unpaused_dep.py @@ -22,7 +22,7 @@ class DagUnpausedDep(BaseTIDep): - """Determines whether a task's DAG is not paused.""" + """Determines whether a task's Dag is not paused.""" NAME = "Dag Not Paused" IGNORABLE = True @@ -30,4 +30,4 @@ class DagUnpausedDep(BaseTIDep): @provide_session def _get_dep_statuses(self, ti, session, dep_context): if ti.task.dag.get_is_paused(session): - yield self._failing_status(reason=f"Task's DAG '{ti.dag_id}' is paused.") + yield self._failing_status(reason=f"Task's Dag '{ti.dag_id}' is paused.") diff --git a/airflow-core/src/airflow/ti_deps/deps/prev_dagrun_dep.py b/airflow-core/src/airflow/ti_deps/deps/prev_dagrun_dep.py index 71a6f583f2907..a75e13bebf836 100644 --- a/airflow-core/src/airflow/ti_deps/deps/prev_dagrun_dep.py +++ b/airflow-core/src/airflow/ti_deps/deps/prev_dagrun_dep.py @@ -61,7 +61,7 @@ def _push_past_deps_met_xcom_if_needed(ti: TI, dep_context): @staticmethod def _has_tis(dagrun: DagRun, task_id: str, *, session: Session) -> bool: """ - Check if a task has presence in the specified DAG run. + Check if a task has presence in the specified Dag run. This function exists for easy mocking in tests. """ @@ -139,7 +139,7 @@ def _get_dep_statuses(self, ti: TI, session: Session, dep_context): assert ti.task if dep_context.ignore_depends_on_past: self._push_past_deps_met_xcom_if_needed(ti, dep_context) - reason = "The context specified that the state of past DAGs could be ignored." + reason = "The context specified that the state of past Dags could be ignored." yield self._passing_status(reason=reason) return @@ -171,13 +171,13 @@ def _get_dep_statuses(self, ti: TI, session: Session, dep_context): last_dagrun = DagRun.get_previous_scheduled_dagrun(dr.id, session) else: last_dagrun = DagRun.get_previous_dagrun(dr, session=session) - # First ever run for this DAG. + # First ever run for this Dag. if not last_dagrun: self._push_past_deps_met_xcom_if_needed(ti, dep_context) yield self._passing_status(reason="This task instance was the first task instance for its task.") return - # There was a DAG run, but the task wasn't active back then. + # There was a Dag run, but the task wasn't active back then. if catchup and last_dagrun.logical_date < ti.task.start_date: self._push_past_deps_met_xcom_if_needed(ti, dep_context) yield self._passing_status(reason="This task instance was the first task instance for its task.") diff --git a/airflow-core/src/airflow/ti_deps/deps/trigger_rule_dep.py b/airflow-core/src/airflow/ti_deps/deps/trigger_rule_dep.py index ea53a582dcfef..e7b9d4540bb6c 100644 --- a/airflow-core/src/airflow/ti_deps/deps/trigger_rule_dep.py +++ b/airflow-core/src/airflow/ti_deps/deps/trigger_rule_dep.py @@ -187,7 +187,7 @@ def _get_relevant_upstream_map_indexes(upstream_id: str) -> int | range | None: return None return ti.get_relevant_upstream_map_indexes( # TODO (GH-52141): task_dict in scheduler should contain - # scheduler types instead, but currently it inherits SDK's DAG. + # scheduler types instead, but currently it inherits SDK's Dag. upstream=cast("MappedOperator | SerializedBaseOperator", ti.task.dag.task_dict[upstream_id]), ti_count=expanded_ti_count, session=session, diff --git a/airflow-core/src/airflow/timetables/base.py b/airflow-core/src/airflow/timetables/base.py index 47f7344b32b8c..9653f65502b47 100644 --- a/airflow-core/src/airflow/timetables/base.py +++ b/airflow-core/src/airflow/timetables/base.py @@ -87,16 +87,16 @@ def exact(cls, at: DateTime) -> DataInterval: class TimeRestriction(NamedTuple): """ - Restriction on when a DAG can be scheduled for a run. + Restriction on when a Dag can be scheduled for a run. Specifically, the run must not be earlier than ``earliest``, nor later than ``latest``. If ``catchup`` is *False*, the run must also not be earlier than the current time, i.e. "missed" schedules are not backfilled. - These values are generally set on the DAG or task's ``start_date``, + These values are generally set on the Dag or task's ``start_date``, ``end_date``, and ``catchup`` arguments. - Both ``earliest`` and ``latest``, if not *None*, are inclusive; a DAG run + Both ``earliest`` and ``latest``, if not *None*, are inclusive; a Dag run can happen exactly at either point of time. They are guaranteed to be aware (i.e. contain timezone information) for ``TimeRestriction`` instances created by Airflow. @@ -181,20 +181,20 @@ class Timetable(Protocol): run_ordering: Sequence[str] = ("data_interval_end", "logical_date") """How runs triggered from this timetable should be ordered in UI. - This should be a list of field names on the DAG run object. + This should be a list of field names on the Dag run object. """ active_runs_limit: int | None = None - """Maximum active runs that can be active at one time for a DAG. + """Maximum active runs that can be active at one time for a Dag. - This is called during DAG initialization, and the return value is used as + This is called during Dag initialization, and the return value is used as the DAG's default ``max_active_runs``. This should generally return *None*, - but there are good reasons to limit DAG run parallelism in some cases, such + but there are good reasons to limit Dag run parallelism in some cases, such as for :class:`~airflow.timetable.simple.ContinuousTimetable`. """ asset_condition: BaseAsset = _NullAsset() - """The asset condition that triggers a DAG using this timetable. + """The asset condition that triggers a Dag using this timetable. If this is not *None*, this should be an asset, or a combination of, that controls the DAG's asset triggers. @@ -205,8 +205,8 @@ def deserialize(cls, data: dict[str, Any]) -> Timetable: """ Deserialize a timetable from data. - This is called when a serialized DAG is deserialized. ``data`` will be - whatever was returned by ``serialize`` during DAG serialization. The + This is called when a serialized Dag is deserialized. ``data`` will be + whatever was returned by ``serialize`` during Dag serialization. The default implementation constructs the timetable without any arguments. """ return cls() @@ -215,9 +215,9 @@ def serialize(self) -> dict[str, Any]: """ Serialize the timetable for JSON encoding. - This is called during DAG serialization to store timetable information + This is called during Dag serialization to store timetable information in the database. This should return a JSON-serializable dict that will - be fed into ``deserialize`` when the DAG is deserialized. The default + be fed into ``deserialize`` when the Dag is deserialized. The default implementation returns an empty dict. """ return {} @@ -246,7 +246,7 @@ def summary(self) -> str: def infer_manual_data_interval(self, *, run_after: DateTime) -> DataInterval: """ - When a DAG run is manually triggered, infer a data interval for it. + When a Dag run is manually triggered, infer a data interval for it. This is used for e.g. manually-triggered runs, where ``run_after`` would be when the user triggers the run. The default implementation raises @@ -267,7 +267,7 @@ def next_dagrun_info( :param last_automated_data_interval: The data interval of the associated DAG's last scheduled or backfilled run (manual runs not considered). - :param restriction: Restriction to apply when scheduling the DAG run. + :param restriction: Restriction to apply when scheduling the Dag run. See documentation of :class:`TimeRestriction` for details. :return: Information on when the next DagRun can be scheduled. None @@ -288,8 +288,8 @@ def generate_run_id( """ Generate a unique run ID. - :param run_type: The type of DAG run. + :param run_type: The type of Dag run. :param run_after: the datetime before which to Dag cannot run. - :param data_interval: The data interval of the DAG run. + :param data_interval: The data interval of the Dag run. """ return run_type.generate_run_id(suffix=run_after.isoformat()) diff --git a/airflow-core/src/airflow/timetables/events.py b/airflow-core/src/airflow/timetables/events.py index d8e70626d409a..c85f215c74c10 100644 --- a/airflow-core/src/airflow/timetables/events.py +++ b/airflow-core/src/airflow/timetables/events.py @@ -33,11 +33,11 @@ class EventsTimetable(Timetable): """ - Timetable that schedules DAG runs at specific listed datetimes. + Timetable that schedules Dag runs at specific listed datetimes. Suitable for predictable but truly irregular scheduling such as sporting events. - :param event_dates: List of datetimes for the DAG to run at. Duplicates will be ignored. Must be finite + :param event_dates: List of datetimes for the Dag to run at. Duplicates will be ignored. Must be finite and of reasonable size as it will be loaded in its entirety. :param restrict_to_events: Whether manual runs should use the most recent event or the current time diff --git a/airflow-core/src/airflow/timetables/interval.py b/airflow-core/src/airflow/timetables/interval.py index e248dd67da206..a4dbd10933a81 100644 --- a/airflow-core/src/airflow/timetables/interval.py +++ b/airflow-core/src/airflow/timetables/interval.py @@ -101,10 +101,10 @@ def next_dagrun_info( return None start = earliest else: # There's a previous run. - # Alignment is needed when DAG has new schedule interval. + # Alignment is needed when Dag has new schedule interval. align_last_data_interval_end = self._align_to_prev(last_automated_data_interval.end) if earliest is not None: - # Catchup is False or DAG has new start date in the future. + # Catchup is False or Dag has new start date in the future. # Make sure we get the later one. start = max(align_last_data_interval_end, earliest) else: @@ -166,7 +166,7 @@ def _skip_to_latest(self, earliest: DateTime | None) -> DateTime: return max(new_start, self._align_to_next(earliest)) def infer_manual_data_interval(self, *, run_after: DateTime) -> DataInterval: - # Get the last complete period before run_after, e.g. if a DAG run is + # Get the last complete period before run_after, e.g. if a Dag run is # scheduled at each midnight, the data interval of a manually triggered # run at 1am 25th is between 0am 24th and 0am 25th. end = self._align_to_prev(run_after) diff --git a/airflow-core/src/airflow/timetables/simple.py b/airflow-core/src/airflow/timetables/simple.py index b5b6f2468f369..6e395603926e3 100644 --- a/airflow-core/src/airflow/timetables/simple.py +++ b/airflow-core/src/airflow/timetables/simple.py @@ -101,9 +101,9 @@ def next_dagrun_info( ) -> DagRunInfo | None: if last_automated_data_interval is not None: return None # Already run, no more scheduling. - # If the user does not specify an explicit start_date, the dag is ready. + # If the user does not specify an explicit start_date, the Dag is ready. run_after = restriction.earliest or timezone.coerce_datetime(timezone.utcnow()) - # "@once" always schedule to the start_date determined by the DAG and + # "@once" always schedule to the start_date determined by the Dag and # tasks, regardless of catchup or not. This has been the case since 1.10 # and we're inheriting it. if restriction.latest is not None and run_after > restriction.latest: @@ -160,7 +160,7 @@ class AssetTriggeredTimetable(_TrivialTimetable): """ Timetable that never schedules anything. - This should not be directly used anywhere, but only set if a DAG is triggered by assets. + This should not be directly used anywhere, but only set if a Dag is triggered by assets. :meta private: """ diff --git a/airflow-core/src/airflow/timetables/trigger.py b/airflow-core/src/airflow/timetables/trigger.py index ed2f65cf24511..6615f15f8df08 100644 --- a/airflow-core/src/airflow/timetables/trigger.py +++ b/airflow-core/src/airflow/timetables/trigger.py @@ -127,12 +127,12 @@ def next_dagrun_info( class DeltaTriggerTimetable(DeltaMixin, _TriggerTimetable): """ - Timetable that triggers DAG runs according to a cron expression. + Timetable that triggers Dag runs according to a cron expression. This is different from ``DeltaDataIntervalTimetable``, where the delta value - specifies the *data interval* of a DAG run. With this timetable, the data + specifies the *data interval* of a Dag run. With this timetable, the data intervals are specified independently. Also for the same reason, this - timetable kicks off a DAG run immediately at the start of the period, + timetable kicks off a Dag run immediately at the start of the period, instead of needing to wait for one data interval to pass. :param delta: How much time to wait between each run. @@ -167,12 +167,12 @@ def _calc_first_run(self) -> DateTime: class CronTriggerTimetable(CronMixin, _TriggerTimetable): """ - Timetable that triggers DAG runs according to a cron expression. + Timetable that triggers Dag runs according to a cron expression. This is different from ``CronDataIntervalTimetable``, where the cron - expression specifies the *data interval* of a DAG run. With this timetable, + expression specifies the *data interval* of a Dag run. With this timetable, the data intervals are specified independently from the cron expression. - Also for the same reason, this timetable kicks off a DAG run immediately at + Also for the same reason, this timetable kicks off a Dag run immediately at the start of the period (similar to POSIX cron), instead of needing to wait for one data interval to pass. @@ -183,12 +183,12 @@ class CronTriggerTimetable(CronMixin, _TriggerTimetable): :param interval: timedelta that defines the data interval start. Default 0. *run_immediately* controls, if no *start_time* is given to the DAG, when - the first run of the DAG should be scheduled. It has no effect if there + the first run of the Dag should be scheduled. It has no effect if there already exist runs for this DAG. - * If *True*, always run immediately the most recent possible DAG run. + * If *True*, always run immediately the most recent possible Dag run. * If *False*, wait to run until the next scheduled time in the future. - * If passed a ``timedelta``, will run the most recent possible DAG run + * If passed a ``timedelta``, will run the most recent possible Dag run if that run's ``data_interval_end`` is within timedelta of now. * If *None*, the timedelta is calculated as 10% of the time between the most recent past scheduled time and the next scheduled time. E.g. if @@ -256,10 +256,10 @@ def _calc_first_run(self) -> DateTime: class MultipleCronTriggerTimetable(Timetable): """ - Timetable that triggers DAG runs according to multiple cron expressions. + Timetable that triggers Dag runs according to multiple cron expressions. This combines multiple ``CronTriggerTimetable`` instances underneath, and - triggers a DAG run whenever one of the timetables want to trigger a run. + triggers a Dag run whenever one of the timetables want to trigger a run. Only at most one run is triggered for any given time, even if more than one timetable fires at the same time. diff --git a/airflow-core/src/airflow/traces/utils.py b/airflow-core/src/airflow/traces/utils.py index 9932c249f0772..f2a478626a293 100644 --- a/airflow-core/src/airflow/traces/utils.py +++ b/airflow-core/src/airflow/traces/utils.py @@ -60,7 +60,7 @@ def gen_span_id_from_ti_key(ti_key: TaskInstanceKey, as_int: bool = False) -> st def gen_dag_span_id(dag_run: DagRun, as_int: bool = False) -> str | int: - """Generate dag's root span id using dag_run.""" + """Generate Dag's root span id using dag_run.""" if dag_run.start_date is None: return NO_TRACE_ID diff --git a/airflow-core/src/airflow/triggers/base.py b/airflow-core/src/airflow/triggers/base.py index 490423da5fda2..56b0a38184d3d 100644 --- a/airflow-core/src/airflow/triggers/base.py +++ b/airflow-core/src/airflow/triggers/base.py @@ -128,7 +128,7 @@ def __repr__(self) -> str: class BaseEventTrigger(BaseTrigger): """ - Base class for triggers used to schedule DAGs based on external events. + Base class for triggers used to schedule Dags based on external events. ``BaseEventTrigger`` is a subclass of ``BaseTrigger`` designed to identify triggers compatible with event-driven scheduling. diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts index 4e8aee079327e..3fc77b63beb0c 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts @@ -256,9 +256,9 @@ export const ensureUseDagRunServiceGetUpstreamAssetEventsData = (queryClient: Qu }) => queryClient.ensureQueryData({ queryKey: Common.UseDagRunServiceGetUpstreamAssetEventsKeyFn({ dagId, dagRunId }), queryFn: () => DagRunService.getUpstreamAssetEvents({ dagId, dagRunId }) }); /** * Get Dag Runs -* Get all DAG Runs. +* Get all Dag Runs. * -* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -383,7 +383,7 @@ export const ensureUseDagStatsServiceGetDagStatsData = (queryClient: QueryClient } = {}) => queryClient.ensureQueryData({ queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }), queryFn: () => DagStatsService.getDagStats({ dagIds }) }); /** * Get Dag Reports -* Get DAG report. +* Get Dag report. * @param data The data for the request. * @param data.subdir * @returns unknown Successful Response @@ -427,7 +427,7 @@ export const ensureUseConfigServiceGetConfigValueData = (queryClient: QueryClien export const ensureUseConfigServiceGetConfigsData = (queryClient: QueryClient) => queryClient.ensureQueryData({ queryKey: Common.UseConfigServiceGetConfigsKeyFn(), queryFn: () => ConfigService.getConfigs() }); /** * List Dag Warnings -* Get a list of DAG warnings. +* Get a list of Dag warnings. * @param data The data for the request. * @param data.dagId * @param data.warningType @@ -446,7 +446,7 @@ export const ensureUseDagWarningServiceListDagWarningsData = (queryClient: Query } = {}) => queryClient.ensureQueryData({ queryKey: Common.UseDagWarningServiceListDagWarningsKeyFn({ dagId, limit, offset, orderBy, warningType }), queryFn: () => DagWarningService.listDagWarnings({ dagId, limit, offset, orderBy, warningType }) }); /** * Get Dags -* Get all DAGs. +* Get all Dags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -460,8 +460,8 @@ export const ensureUseDagWarningServiceListDagWarningsData = (queryClient: Query * @param data.lastDagRunState * @param data.bundleName * @param data.bundleVersion -* @param data.hasAssetSchedule Filter DAGs with asset-based scheduling -* @param data.assetDependency Filter DAGs by asset dependency (name or URI) +* @param data.hasAssetSchedule Filter Dags with asset-based scheduling +* @param data.assetDependency Filter Dags by asset dependency (name or URI) * @param data.dagRunStartDateGte * @param data.dagRunStartDateGt * @param data.dagRunStartDateLte @@ -527,7 +527,7 @@ export const ensureUseDagServiceGetDagDetailsData = (queryClient: QueryClient, { }) => queryClient.ensureQueryData({ queryKey: Common.UseDagServiceGetDagDetailsKeyFn({ dagId }), queryFn: () => DagService.getDagDetails({ dagId }) }); /** * Get Dag Tags -* Get all DAG tags. +* Get all Dag tags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -544,7 +544,7 @@ export const ensureUseDagServiceGetDagTagsData = (queryClient: QueryClient, { li } = {}) => queryClient.ensureQueryData({ queryKey: Common.UseDagServiceGetDagTagsKeyFn({ limit, offset, orderBy, tagNamePattern }), queryFn: () => DagService.getDagTags({ limit, offset, orderBy, tagNamePattern }) }); /** * Get Dags -* Get DAGs with recent DagRun. +* Get Dags with recent DagRun. * @param data The data for the request. * @param data.dagRunsLimit * @param data.limit @@ -562,8 +562,8 @@ export const ensureUseDagServiceGetDagTagsData = (queryClient: QueryClient, { li * @param data.bundleVersion * @param data.orderBy * @param data.isFavorite -* @param data.hasAssetSchedule Filter DAGs with asset-based scheduling -* @param data.assetDependency Filter DAGs by asset dependency (name or URI) +* @param data.hasAssetSchedule Filter Dags with asset-based scheduling +* @param data.assetDependency Filter Dags by asset dependency (name or URI) * @returns DAGWithLatestDagRunsCollectionResponse Successful Response * @throws ApiError */ @@ -865,8 +865,8 @@ export const ensureUseTaskInstanceServiceGetMappedTaskInstanceData = (queryClien * Get Task Instances * Get list of task instances. * -* This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all DAGs -* and DAG runs. +* This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all Dags +* and Dag runs. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -1183,7 +1183,7 @@ export const ensureUseXcomServiceGetXcomEntryData = (queryClient: QueryClient, { * Get Xcom Entries * Get all XCom entries. * -* This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. +* This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all Dags. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -1299,9 +1299,9 @@ export const ensureUseDagVersionServiceGetDagVersionData = (queryClient: QueryCl }) => queryClient.ensureQueryData({ queryKey: Common.UseDagVersionServiceGetDagVersionKeyFn({ dagId, versionNumber }), queryFn: () => DagVersionService.getDagVersion({ dagId, versionNumber }) }); /** * Get Dag Versions -* Get all DAG Versions. +* Get all Dag Versions. * -* This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -1452,7 +1452,7 @@ export const ensureUseDashboardServiceHistoricalMetricsData = (queryClient: Quer }) => queryClient.ensureQueryData({ queryKey: Common.UseDashboardServiceHistoricalMetricsKeyFn({ endDate, startDate }), queryFn: () => DashboardService.historicalMetrics({ endDate, startDate }) }); /** * Dag Stats -* Return basic DAG stats with counts of DAGs in various states. +* Return basic Dag stats with counts of Dags in various states. * @returns DashboardDagStatsResponse Successful Response * @throws ApiError */ @@ -1554,7 +1554,7 @@ export const ensureUseGridServiceGetGridTiSummariesData = (queryClient: QueryCli }) => queryClient.ensureQueryData({ queryKey: Common.UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId }), queryFn: () => GridService.getGridTiSummaries({ dagId, runId }) }); /** * Get Calendar -* Get calendar data for a DAG including historical and planned DAG runs. +* Get calendar data for a Dag including historical and planned Dag runs. * @param data The data for the request. * @param data.dagId * @param data.granularity diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts index aa3fd9fc85dcb..63a51d3983643 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts @@ -256,9 +256,9 @@ export const prefetchUseDagRunServiceGetUpstreamAssetEvents = (queryClient: Quer }) => queryClient.prefetchQuery({ queryKey: Common.UseDagRunServiceGetUpstreamAssetEventsKeyFn({ dagId, dagRunId }), queryFn: () => DagRunService.getUpstreamAssetEvents({ dagId, dagRunId }) }); /** * Get Dag Runs -* Get all DAG Runs. +* Get all Dag Runs. * -* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -383,7 +383,7 @@ export const prefetchUseDagStatsServiceGetDagStats = (queryClient: QueryClient, } = {}) => queryClient.prefetchQuery({ queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }), queryFn: () => DagStatsService.getDagStats({ dagIds }) }); /** * Get Dag Reports -* Get DAG report. +* Get Dag report. * @param data The data for the request. * @param data.subdir * @returns unknown Successful Response @@ -427,7 +427,7 @@ export const prefetchUseConfigServiceGetConfigValue = (queryClient: QueryClient, export const prefetchUseConfigServiceGetConfigs = (queryClient: QueryClient) => queryClient.prefetchQuery({ queryKey: Common.UseConfigServiceGetConfigsKeyFn(), queryFn: () => ConfigService.getConfigs() }); /** * List Dag Warnings -* Get a list of DAG warnings. +* Get a list of Dag warnings. * @param data The data for the request. * @param data.dagId * @param data.warningType @@ -446,7 +446,7 @@ export const prefetchUseDagWarningServiceListDagWarnings = (queryClient: QueryCl } = {}) => queryClient.prefetchQuery({ queryKey: Common.UseDagWarningServiceListDagWarningsKeyFn({ dagId, limit, offset, orderBy, warningType }), queryFn: () => DagWarningService.listDagWarnings({ dagId, limit, offset, orderBy, warningType }) }); /** * Get Dags -* Get all DAGs. +* Get all Dags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -460,8 +460,8 @@ export const prefetchUseDagWarningServiceListDagWarnings = (queryClient: QueryCl * @param data.lastDagRunState * @param data.bundleName * @param data.bundleVersion -* @param data.hasAssetSchedule Filter DAGs with asset-based scheduling -* @param data.assetDependency Filter DAGs by asset dependency (name or URI) +* @param data.hasAssetSchedule Filter Dags with asset-based scheduling +* @param data.assetDependency Filter Dags by asset dependency (name or URI) * @param data.dagRunStartDateGte * @param data.dagRunStartDateGt * @param data.dagRunStartDateLte @@ -527,7 +527,7 @@ export const prefetchUseDagServiceGetDagDetails = (queryClient: QueryClient, { d }) => queryClient.prefetchQuery({ queryKey: Common.UseDagServiceGetDagDetailsKeyFn({ dagId }), queryFn: () => DagService.getDagDetails({ dagId }) }); /** * Get Dag Tags -* Get all DAG tags. +* Get all Dag tags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -544,7 +544,7 @@ export const prefetchUseDagServiceGetDagTags = (queryClient: QueryClient, { limi } = {}) => queryClient.prefetchQuery({ queryKey: Common.UseDagServiceGetDagTagsKeyFn({ limit, offset, orderBy, tagNamePattern }), queryFn: () => DagService.getDagTags({ limit, offset, orderBy, tagNamePattern }) }); /** * Get Dags -* Get DAGs with recent DagRun. +* Get Dags with recent DagRun. * @param data The data for the request. * @param data.dagRunsLimit * @param data.limit @@ -562,8 +562,8 @@ export const prefetchUseDagServiceGetDagTags = (queryClient: QueryClient, { limi * @param data.bundleVersion * @param data.orderBy * @param data.isFavorite -* @param data.hasAssetSchedule Filter DAGs with asset-based scheduling -* @param data.assetDependency Filter DAGs by asset dependency (name or URI) +* @param data.hasAssetSchedule Filter Dags with asset-based scheduling +* @param data.assetDependency Filter Dags by asset dependency (name or URI) * @returns DAGWithLatestDagRunsCollectionResponse Successful Response * @throws ApiError */ @@ -865,8 +865,8 @@ export const prefetchUseTaskInstanceServiceGetMappedTaskInstance = (queryClient: * Get Task Instances * Get list of task instances. * -* This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all DAGs -* and DAG runs. +* This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all Dags +* and Dag runs. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -1183,7 +1183,7 @@ export const prefetchUseXcomServiceGetXcomEntry = (queryClient: QueryClient, { d * Get Xcom Entries * Get all XCom entries. * -* This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. +* This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all Dags. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -1299,9 +1299,9 @@ export const prefetchUseDagVersionServiceGetDagVersion = (queryClient: QueryClie }) => queryClient.prefetchQuery({ queryKey: Common.UseDagVersionServiceGetDagVersionKeyFn({ dagId, versionNumber }), queryFn: () => DagVersionService.getDagVersion({ dagId, versionNumber }) }); /** * Get Dag Versions -* Get all DAG Versions. +* Get all Dag Versions. * -* This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -1452,7 +1452,7 @@ export const prefetchUseDashboardServiceHistoricalMetrics = (queryClient: QueryC }) => queryClient.prefetchQuery({ queryKey: Common.UseDashboardServiceHistoricalMetricsKeyFn({ endDate, startDate }), queryFn: () => DashboardService.historicalMetrics({ endDate, startDate }) }); /** * Dag Stats -* Return basic DAG stats with counts of DAGs in various states. +* Return basic Dag stats with counts of Dags in various states. * @returns DashboardDagStatsResponse Successful Response * @throws ApiError */ @@ -1554,7 +1554,7 @@ export const prefetchUseGridServiceGetGridTiSummaries = (queryClient: QueryClien }) => queryClient.prefetchQuery({ queryKey: Common.UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId }), queryFn: () => GridService.getGridTiSummaries({ dagId, runId }) }); /** * Get Calendar -* Get calendar data for a DAG including historical and planned DAG runs. +* Get calendar data for a Dag including historical and planned Dag runs. * @param data The data for the request. * @param data.dagId * @param data.granularity diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts index 43a4cedca6450..7e7cb544861b2 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts @@ -256,9 +256,9 @@ export const useDagRunServiceGetUpstreamAssetEvents = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDagRunServiceGetUpstreamAssetEventsKeyFn({ dagId, dagRunId }, queryKey), queryFn: () => DagRunService.getUpstreamAssetEvents({ dagId, dagRunId }) as TData, ...options }); /** * Get Dag Runs -* Get all DAG Runs. +* Get all Dag Runs. * -* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -383,7 +383,7 @@ export const useDagStatsServiceGetDagStats = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }, queryKey), queryFn: () => DagStatsService.getDagStats({ dagIds }) as TData, ...options }); /** * Get Dag Reports -* Get DAG report. +* Get Dag report. * @param data The data for the request. * @param data.subdir * @returns unknown Successful Response @@ -427,7 +427,7 @@ export const useConfigServiceGetConfigValue = = unknown[]>(queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseConfigServiceGetConfigsKeyFn(queryKey), queryFn: () => ConfigService.getConfigs() as TData, ...options }); /** * List Dag Warnings -* Get a list of DAG warnings. +* Get a list of Dag warnings. * @param data The data for the request. * @param data.dagId * @param data.warningType @@ -446,7 +446,7 @@ export const useDagWarningServiceListDagWarnings = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDagWarningServiceListDagWarningsKeyFn({ dagId, limit, offset, orderBy, warningType }, queryKey), queryFn: () => DagWarningService.listDagWarnings({ dagId, limit, offset, orderBy, warningType }) as TData, ...options }); /** * Get Dags -* Get all DAGs. +* Get all Dags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -460,8 +460,8 @@ export const useDagWarningServiceListDagWarnings = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDagServiceGetDagDetailsKeyFn({ dagId }, queryKey), queryFn: () => DagService.getDagDetails({ dagId }) as TData, ...options }); /** * Get Dag Tags -* Get all DAG tags. +* Get all Dag tags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -544,7 +544,7 @@ export const useDagServiceGetDagTags = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDagServiceGetDagTagsKeyFn({ limit, offset, orderBy, tagNamePattern }, queryKey), queryFn: () => DagService.getDagTags({ limit, offset, orderBy, tagNamePattern }) as TData, ...options }); /** * Get Dags -* Get DAGs with recent DagRun. +* Get Dags with recent DagRun. * @param data The data for the request. * @param data.dagRunsLimit * @param data.limit @@ -562,8 +562,8 @@ export const useDagServiceGetDagTags = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDagVersionServiceGetDagVersionKeyFn({ dagId, versionNumber }, queryKey), queryFn: () => DagVersionService.getDagVersion({ dagId, versionNumber }) as TData, ...options }); /** * Get Dag Versions -* Get all DAG Versions. +* Get all Dag Versions. * -* This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -1452,7 +1452,7 @@ export const useDashboardServiceHistoricalMetrics = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseDashboardServiceHistoricalMetricsKeyFn({ endDate, startDate }, queryKey), queryFn: () => DashboardService.historicalMetrics({ endDate, startDate }) as TData, ...options }); /** * Dag Stats -* Return basic DAG stats with counts of DAGs in various states. +* Return basic Dag stats with counts of Dags in various states. * @returns DashboardDagStatsResponse Successful Response * @throws ApiError */ @@ -1554,7 +1554,7 @@ export const useGridServiceGetGridTiSummaries = , "queryKey" | "queryFn">) => useQuery({ queryKey: Common.UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId }, queryKey), queryFn: () => GridService.getGridTiSummaries({ dagId, runId }) as TData, ...options }); /** * Get Calendar -* Get calendar data for a DAG including historical and planned DAG runs. +* Get calendar data for a Dag including historical and planned Dag runs. * @param data The data for the request. * @param data.dagId * @param data.granularity @@ -1588,7 +1588,7 @@ export const useAssetServiceCreateAssetEvent = ({ mutationFn: ({ requestBody }) => AssetService.createAssetEvent({ requestBody }) as unknown as Promise, ...options }); /** * Materialize Asset -* Materialize an asset by triggering a DAG run that produces it. +* Materialize an asset by triggering a Dag run that produces it. * @param data The data for the request. * @param data.assetId * @returns DAGRunResponse Successful Response @@ -1696,7 +1696,7 @@ export const useDagRunServiceTriggerDagRun = ({ mutationFn: ({ dagId, requestBody }) => DagRunService.triggerDagRun({ dagId, requestBody }) as unknown as Promise, ...options }); /** * Get List Dag Runs Batch -* Get a list of DAG Runs. +* Get a list of Dag Runs. * @param data The data for the request. * @param data.dagId * @param data.requestBody @@ -1712,7 +1712,7 @@ export const useDagRunServiceGetListDagRunsBatch = ({ mutationFn: ({ dagId, requestBody }) => DagRunService.getListDagRunsBatch({ dagId, requestBody }) as unknown as Promise, ...options }); /** * Favorite Dag -* Mark the DAG as favorite. +* Mark the Dag as favorite. * @param data The data for the request. * @param data.dagId * @returns void Successful Response @@ -1725,7 +1725,7 @@ export const useDagServiceFavoriteDag = ({ mutationFn: ({ dagId }) => DagService.favoriteDag({ dagId }) as unknown as Promise, ...options }); /** * Unfavorite Dag -* Unmark the DAG as favorite. +* Unmark the Dag as favorite. * @param data The data for the request. * @param data.dagId * @returns void Successful Response @@ -1857,7 +1857,7 @@ export const useBackfillServiceCancelBackfill = ({ mutationFn: ({ backfillId }) => BackfillService.cancelBackfill({ backfillId }) as unknown as Promise, ...options }); /** * Reparse Dag File -* Request re-parsing a DAG file. +* Request re-parsing a Dag file. * @param data The data for the request. * @param data.fileToken * @returns null Successful Response @@ -1902,7 +1902,7 @@ export const useConnectionServiceBulkConnections = ({ mutationFn: ({ requestBody }) => ConnectionService.bulkConnections({ requestBody }) as unknown as Promise, ...options }); /** * Patch Dag Run -* Modify a DAG Run. +* Modify a Dag Run. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -1924,7 +1924,7 @@ export const useDagRunServicePatchDagRun = ({ mutationFn: ({ dagId, dagRunId, requestBody, updateMask }) => DagRunService.patchDagRun({ dagId, dagRunId, requestBody, updateMask }) as unknown as Promise, ...options }); /** * Patch Dags -* Patch multiple DAGs. +* Patch multiple Dags. * @param data The data for the request. * @param data.requestBody * @param data.updateMask @@ -2291,7 +2291,7 @@ export const useConnectionServiceDeleteConnection = ({ mutationFn: ({ connectionId }) => ConnectionService.deleteConnection({ connectionId }) as unknown as Promise, ...options }); /** * Delete Dag Run -* Delete a DAG Run entry. +* Delete a Dag Run entry. * @param data The data for the request. * @param data.dagId * @param data.dagRunId diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts index 312a3196e7a79..e12c07d638e1a 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts @@ -256,9 +256,9 @@ export const useDagRunServiceGetUpstreamAssetEventsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDagRunServiceGetUpstreamAssetEventsKeyFn({ dagId, dagRunId }, queryKey), queryFn: () => DagRunService.getUpstreamAssetEvents({ dagId, dagRunId }) as TData, ...options }); /** * Get Dag Runs -* Get all DAG Runs. +* Get all Dag Runs. * -* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -383,7 +383,7 @@ export const useDagStatsServiceGetDagStatsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }, queryKey), queryFn: () => DagStatsService.getDagStats({ dagIds }) as TData, ...options }); /** * Get Dag Reports -* Get DAG report. +* Get Dag report. * @param data The data for the request. * @param data.subdir * @returns unknown Successful Response @@ -427,7 +427,7 @@ export const useConfigServiceGetConfigValueSuspense = = unknown[]>(queryKey?: TQueryKey, options?: Omit, "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseConfigServiceGetConfigsKeyFn(queryKey), queryFn: () => ConfigService.getConfigs() as TData, ...options }); /** * List Dag Warnings -* Get a list of DAG warnings. +* Get a list of Dag warnings. * @param data The data for the request. * @param data.dagId * @param data.warningType @@ -446,7 +446,7 @@ export const useDagWarningServiceListDagWarningsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDagWarningServiceListDagWarningsKeyFn({ dagId, limit, offset, orderBy, warningType }, queryKey), queryFn: () => DagWarningService.listDagWarnings({ dagId, limit, offset, orderBy, warningType }) as TData, ...options }); /** * Get Dags -* Get all DAGs. +* Get all Dags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -460,8 +460,8 @@ export const useDagWarningServiceListDagWarningsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDagServiceGetDagDetailsKeyFn({ dagId }, queryKey), queryFn: () => DagService.getDagDetails({ dagId }) as TData, ...options }); /** * Get Dag Tags -* Get all DAG tags. +* Get all Dag tags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -544,7 +544,7 @@ export const useDagServiceGetDagTagsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDagServiceGetDagTagsKeyFn({ limit, offset, orderBy, tagNamePattern }, queryKey), queryFn: () => DagService.getDagTags({ limit, offset, orderBy, tagNamePattern }) as TData, ...options }); /** * Get Dags -* Get DAGs with recent DagRun. +* Get Dags with recent DagRun. * @param data The data for the request. * @param data.dagRunsLimit * @param data.limit @@ -562,8 +562,8 @@ export const useDagServiceGetDagTagsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDagVersionServiceGetDagVersionKeyFn({ dagId, versionNumber }, queryKey), queryFn: () => DagVersionService.getDagVersion({ dagId, versionNumber }) as TData, ...options }); /** * Get Dag Versions -* Get all DAG Versions. +* Get all Dag Versions. * -* This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions for all DAGs. +* This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -1452,7 +1452,7 @@ export const useDashboardServiceHistoricalMetricsSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseDashboardServiceHistoricalMetricsKeyFn({ endDate, startDate }, queryKey), queryFn: () => DashboardService.historicalMetrics({ endDate, startDate }) as TData, ...options }); /** * Dag Stats -* Return basic DAG stats with counts of DAGs in various states. +* Return basic Dag stats with counts of Dags in various states. * @returns DashboardDagStatsResponse Successful Response * @throws ApiError */ @@ -1554,7 +1554,7 @@ export const useGridServiceGetGridTiSummariesSuspense = , "queryKey" | "queryFn">) => useSuspenseQuery({ queryKey: Common.UseGridServiceGetGridTiSummariesKeyFn({ dagId, runId }, queryKey), queryFn: () => GridService.getGridTiSummaries({ dagId, runId }) as TData, ...options }); /** * Get Calendar -* Get calendar data for a DAG including historical and planned DAG runs. +* Get calendar data for a Dag including historical and planned Dag runs. * @param data The data for the request. * @param data.dagId * @param data.granularity diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts index 0452da45a665c..8aa1ff5997f6b 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts @@ -1584,7 +1584,7 @@ export const $DAGCollectionResponse = { type: 'object', required: ['dags', 'total_entries'], title: 'DAGCollectionResponse', - description: 'DAG Collection serializer for responses.' + description: 'Dag Collection serializer for responses.' } as const; export const $DAGDetailsResponse = { @@ -1971,7 +1971,7 @@ Deprecated: Use max_active_tasks instead.`, type: 'object', required: ['dag_id', 'dag_display_name', 'is_paused', 'is_stale', 'last_parsed_time', 'last_expired', 'bundle_name', 'bundle_version', 'relative_fileloc', 'fileloc', 'description', 'timetable_summary', 'timetable_description', 'tags', 'max_active_tasks', 'max_active_runs', 'max_consecutive_failed_dag_runs', 'has_task_concurrency_limits', 'has_import_errors', 'next_dagrun_logical_date', 'next_dagrun_data_interval_start', 'next_dagrun_data_interval_end', 'next_dagrun_run_after', 'owners', 'catchup', 'dag_run_timeout', 'asset_expression', 'doc_md', 'start_date', 'end_date', 'is_paused_upon_creation', 'params', 'render_template_as_native_obj', 'template_search_path', 'timezone', 'last_parsed', 'default_args', 'file_token', 'concurrency', 'latest_dag_version'], title: 'DAGDetailsResponse', - description: 'Specific serializer for DAG Details responses.' + description: 'Specific serializer for Dag Details responses.' } as const; export const $DAGPatchBody = { @@ -2199,7 +2199,7 @@ export const $DAGResponse = { type: 'object', required: ['dag_id', 'dag_display_name', 'is_paused', 'is_stale', 'last_parsed_time', 'last_expired', 'bundle_name', 'bundle_version', 'relative_fileloc', 'fileloc', 'description', 'timetable_summary', 'timetable_description', 'tags', 'max_active_tasks', 'max_active_runs', 'max_consecutive_failed_dag_runs', 'has_task_concurrency_limits', 'has_import_errors', 'next_dagrun_logical_date', 'next_dagrun_data_interval_start', 'next_dagrun_data_interval_end', 'next_dagrun_run_after', 'owners', 'file_token'], title: 'DAGResponse', - description: 'DAG serializer for responses.' + description: 'Dag serializer for responses.' } as const; export const $DAGRunClearBody = { @@ -2224,7 +2224,7 @@ export const $DAGRunClearBody = { additionalProperties: false, type: 'object', title: 'DAGRunClearBody', - description: 'DAG Run serializer for clear endpoint body.' + description: 'Dag Run serializer for clear endpoint body.' } as const; export const $DAGRunCollectionResponse = { @@ -2244,7 +2244,7 @@ export const $DAGRunCollectionResponse = { type: 'object', required: ['dag_runs', 'total_entries'], title: 'DAGRunCollectionResponse', - description: 'DAG Run Collection serializer for responses.' + description: 'Dag Run Collection serializer for responses.' } as const; export const $DAGRunPatchBody = { @@ -2275,14 +2275,14 @@ export const $DAGRunPatchBody = { additionalProperties: false, type: 'object', title: 'DAGRunPatchBody', - description: 'DAG Run Serializer for PATCH requests.' + description: 'Dag Run Serializer for PATCH requests.' } as const; export const $DAGRunPatchStates = { type: 'string', enum: ['queued', 'success', 'failed'], title: 'DAGRunPatchStates', - description: 'Enum for DAG Run states when updating a DAG Run.' + description: 'Enum for Dag Run states when updating a Dag Run.' } as const; export const $DAGRunResponse = { @@ -2471,7 +2471,7 @@ export const $DAGRunResponse = { type: 'object', required: ['dag_run_id', 'dag_id', 'logical_date', 'queued_at', 'start_date', 'end_date', 'duration', 'data_interval_start', 'data_interval_end', 'run_after', 'last_scheduling_decision', 'run_type', 'state', 'triggered_by', 'triggering_user_name', 'conf', 'note', 'dag_versions', 'bundle_version', 'dag_display_name'], title: 'DAGRunResponse', - description: 'DAG Run serializer for responses.' + description: 'Dag Run serializer for responses.' } as const; export const $DAGRunsBatchBody = { @@ -2730,7 +2730,7 @@ export const $DAGRunsBatchBody = { additionalProperties: false, type: 'object', title: 'DAGRunsBatchBody', - description: 'List DAG Runs body for batch endpoint.' + description: 'List Dag Runs body for batch endpoint.' } as const; export const $DAGSourceResponse = { @@ -2769,7 +2769,7 @@ export const $DAGSourceResponse = { type: 'object', required: ['content', 'dag_id', 'version_number', 'dag_display_name'], title: 'DAGSourceResponse', - description: 'DAG Source serializer for responses.' + description: 'Dag Source serializer for responses.' } as const; export const $DAGTagCollectionResponse = { @@ -2789,7 +2789,7 @@ export const $DAGTagCollectionResponse = { type: 'object', required: ['tags', 'total_entries'], title: 'DAGTagCollectionResponse', - description: 'DAG Tags Collection serializer for responses.' + description: 'Dag Tags Collection serializer for responses.' } as const; export const $DAGVersionCollectionResponse = { @@ -2809,7 +2809,7 @@ export const $DAGVersionCollectionResponse = { type: 'object', required: ['dag_versions', 'total_entries'], title: 'DAGVersionCollectionResponse', - description: 'DAG Version Collection serializer for responses.' + description: 'Dag Version Collection serializer for responses.' } as const; export const $DAGWarningCollectionResponse = { @@ -2829,7 +2829,7 @@ export const $DAGWarningCollectionResponse = { type: 'object', required: ['dag_warnings', 'total_entries'], title: 'DAGWarningCollectionResponse', - description: 'DAG warning collection serializer for responses.' + description: 'Dag warning collection serializer for responses.' } as const; export const $DAGWarningResponse = { @@ -2858,7 +2858,7 @@ export const $DAGWarningResponse = { type: 'object', required: ['dag_id', 'warning_type', 'message', 'timestamp', 'dag_display_name'], title: 'DAGWarningResponse', - description: 'DAG Warning serializer for responses.' + description: 'Dag Warning serializer for responses.' } as const; export const $DagProcessorInfoResponse = { @@ -3013,7 +3013,7 @@ export const $DagScheduleAssetReference = { type: 'object', required: ['dag_id', 'created_at', 'updated_at'], title: 'DagScheduleAssetReference', - description: 'DAG schedule reference serializer for assets.' + description: 'Dag schedule reference serializer for assets.' } as const; export const $DagStatsCollectionResponse = { @@ -3033,7 +3033,7 @@ export const $DagStatsCollectionResponse = { type: 'object', required: ['dags', 'total_entries'], title: 'DagStatsCollectionResponse', - description: 'DAG Stats Collection serializer for responses.' + description: 'Dag Stats Collection serializer for responses.' } as const; export const $DagStatsResponse = { @@ -3057,7 +3057,7 @@ export const $DagStatsResponse = { type: 'object', required: ['dag_id', 'dag_display_name', 'stats'], title: 'DagStatsResponse', - description: 'DAG Stats serializer for responses.' + description: 'Dag Stats serializer for responses.' } as const; export const $DagStatsStateResponse = { @@ -3094,7 +3094,7 @@ export const $DagTagResponse = { type: 'object', required: ['name', 'dag_id', 'dag_display_name'], title: 'DagTagResponse', - description: 'DAG Tag serializer for responses.' + description: 'Dag Tag serializer for responses.' } as const; export const $DagVersionResponse = { @@ -3166,7 +3166,7 @@ export const $DagWarningType = { type: 'string', enum: ['asset conflict', 'non-existent pool'], title: 'DagWarningType', - description: `Enum for DAG warning types. + description: `Enum for Dag warning types. This is the set of allowable values for the \`\`warning_type\`\` field in the DagWarning model.` @@ -6038,7 +6038,7 @@ export const $TriggerDAGRunPostBody = { type: 'object', required: ['logical_date'], title: 'TriggerDAGRunPostBody', - description: 'Trigger DAG Run Serializer for POST body.' + description: 'Trigger Dag Run Serializer for POST body.' } as const; export const $TriggerResponse = { @@ -6604,7 +6604,7 @@ export const $CalendarTimeRangeResponse = { type: 'object', required: ['date', 'state', 'count'], title: 'CalendarTimeRangeResponse', - description: 'Represents a summary of DAG runs for a specific calendar time range.' + description: 'Represents a summary of Dag runs for a specific calendar time range.' } as const; export const $ConfigResponse = { @@ -6841,7 +6841,7 @@ export const $DAGRunLightResponse = { type: 'object', required: ['id', 'dag_id', 'run_id', 'logical_date', 'run_after', 'start_date', 'end_date', 'state'], title: 'DAGRunLightResponse', - description: 'DAG Run serializer for responses.' + description: 'Dag Run serializer for responses.' } as const; export const $DAGRunStates = { @@ -6866,7 +6866,7 @@ export const $DAGRunStates = { type: 'object', required: ['queued', 'running', 'success', 'failed'], title: 'DAGRunStates', - description: 'DAG Run States for responses.' + description: 'Dag Run States for responses.' } as const; export const $DAGRunTypes = { @@ -6891,7 +6891,7 @@ export const $DAGRunTypes = { type: 'object', required: ['backfill', 'scheduled', 'manual', 'asset_triggered'], title: 'DAGRunTypes', - description: 'DAG Run Types for responses.' + description: 'Dag Run Types for responses.' } as const; export const $DAGWithLatestDagRunsCollectionResponse = { @@ -6911,7 +6911,7 @@ export const $DAGWithLatestDagRunsCollectionResponse = { type: 'object', required: ['total_entries', 'dags'], title: 'DAGWithLatestDagRunsCollectionResponse', - description: 'DAG with latest dag runs collection response serializer.' + description: 'Dag with latest dag runs collection response serializer.' } as const; export const $DAGWithLatestDagRunsResponse = { @@ -7144,7 +7144,7 @@ export const $DAGWithLatestDagRunsResponse = { type: 'object', required: ['dag_id', 'dag_display_name', 'is_paused', 'is_stale', 'last_parsed_time', 'last_expired', 'bundle_name', 'bundle_version', 'relative_fileloc', 'fileloc', 'description', 'timetable_summary', 'timetable_description', 'tags', 'max_active_tasks', 'max_active_runs', 'max_consecutive_failed_dag_runs', 'has_task_concurrency_limits', 'has_import_errors', 'next_dagrun_logical_date', 'next_dagrun_data_interval_start', 'next_dagrun_data_interval_end', 'next_dagrun_run_after', 'owners', 'asset_expression', 'latest_dag_runs', 'file_token'], title: 'DAGWithLatestDagRunsResponse', - description: 'DAG with latest dag runs response serializer.' + description: 'Dag with latest dag runs response serializer.' } as const; export const $DashboardDagStatsResponse = { @@ -7169,7 +7169,7 @@ export const $DashboardDagStatsResponse = { type: 'object', required: ['active_dag_count', 'failed_dag_count', 'running_dag_count', 'queued_dag_count'], title: 'DashboardDagStatsResponse', - description: 'Dashboard DAG Stats serializer for responses.' + description: 'Dashboard Dag Stats serializer for responses.' } as const; export const $EdgeResponse = { @@ -7389,7 +7389,7 @@ export const $GridTISummaries = { type: 'object', required: ['run_id', 'dag_id', 'task_instances'], title: 'GridTISummaries', - description: 'DAG Run model for the Grid UI.' + description: 'Dag Run model for the Grid UI.' } as const; export const $HistoricalMetricDataResponse = { diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts index 873f2cfbee206..afe59c8e972b4 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts @@ -167,7 +167,7 @@ export class AssetService { /** * Materialize Asset - * Materialize an asset by triggering a DAG run that produces it. + * Materialize an asset by triggering a Dag run that produces it. * @param data The data for the request. * @param data.assetId * @returns DAGRunResponse Successful Response @@ -852,7 +852,7 @@ export class DagRunService { /** * Delete Dag Run - * Delete a DAG Run entry. + * Delete a Dag Run entry. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -879,7 +879,7 @@ export class DagRunService { /** * Patch Dag Run - * Modify a DAG Run. + * Modify a Dag Run. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -967,9 +967,9 @@ export class DagRunService { /** * Get Dag Runs - * Get all DAG Runs. + * Get all Dag Runs. * - * This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all DAGs. + * This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -1110,7 +1110,7 @@ export class DagRunService { /** * Get List Dag Runs Batch - * Get a list of DAG Runs. + * Get a list of Dag Runs. * @param data The data for the request. * @param data.dagId * @param data.requestBody @@ -1240,7 +1240,7 @@ export class DagStatsService { export class DagReportService { /** * Get Dag Reports - * Get DAG report. + * Get Dag report. * @param data The data for the request. * @param data.subdir * @returns unknown Successful Response @@ -1344,7 +1344,7 @@ export class ConfigService { export class DagWarningService { /** * List Dag Warnings - * Get a list of DAG warnings. + * Get a list of Dag warnings. * @param data The data for the request. * @param data.dagId * @param data.warningType @@ -1378,7 +1378,7 @@ export class DagWarningService { export class DagService { /** * Get Dags - * Get all DAGs. + * Get all Dags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -1392,8 +1392,8 @@ export class DagService { * @param data.lastDagRunState * @param data.bundleName * @param data.bundleVersion - * @param data.hasAssetSchedule Filter DAGs with asset-based scheduling - * @param data.assetDependency Filter DAGs by asset dependency (name or URI) + * @param data.hasAssetSchedule Filter Dags with asset-based scheduling + * @param data.assetDependency Filter Dags by asset dependency (name or URI) * @param data.dagRunStartDateGte * @param data.dagRunStartDateGt * @param data.dagRunStartDateLte @@ -1449,7 +1449,7 @@ export class DagService { /** * Patch Dags - * Patch multiple DAGs. + * Patch multiple Dags. * @param data The data for the request. * @param data.requestBody * @param data.updateMask @@ -1600,7 +1600,7 @@ export class DagService { /** * Favorite Dag - * Mark the DAG as favorite. + * Mark the Dag as favorite. * @param data The data for the request. * @param data.dagId * @returns void Successful Response @@ -1624,7 +1624,7 @@ export class DagService { /** * Unfavorite Dag - * Unmark the DAG as favorite. + * Unmark the Dag as favorite. * @param data The data for the request. * @param data.dagId * @returns void Successful Response @@ -1649,7 +1649,7 @@ export class DagService { /** * Get Dag Tags - * Get all DAG tags. + * Get all Dag tags. * @param data The data for the request. * @param data.limit * @param data.offset @@ -1678,7 +1678,7 @@ export class DagService { /** * Get Dags - * Get DAGs with recent DagRun. + * Get Dags with recent DagRun. * @param data The data for the request. * @param data.dagRunsLimit * @param data.limit @@ -1696,8 +1696,8 @@ export class DagService { * @param data.bundleVersion * @param data.orderBy * @param data.isFavorite - * @param data.hasAssetSchedule Filter DAGs with asset-based scheduling - * @param data.assetDependency Filter DAGs by asset dependency (name or URI) + * @param data.hasAssetSchedule Filter Dags with asset-based scheduling + * @param data.assetDependency Filter Dags by asset dependency (name or URI) * @returns DAGWithLatestDagRunsCollectionResponse Successful Response * @throws ApiError */ @@ -2291,8 +2291,8 @@ export class TaskInstanceService { * Get Task Instances * Get list of task instances. * - * This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all DAGs - * and DAG runs. + * This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve Task Instances for all Dags + * and Dag runs. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -3113,7 +3113,7 @@ export class XcomService { * Get Xcom Entries * Get all XCom entries. * - * This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. + * This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all Dags. * @param data The data for the request. * @param data.dagId * @param data.dagRunId @@ -3429,7 +3429,7 @@ export class VariableService { export class DagParsingService { /** * Reparse Dag File - * Request re-parsing a DAG file. + * Request re-parsing a Dag file. * @param data The data for the request. * @param data.fileToken * @returns null Successful Response @@ -3482,9 +3482,9 @@ export class DagVersionService { /** * Get Dag Versions - * Get all DAG Versions. + * Get all Dag Versions. * - * This endpoint allows specifying `~` as the dag_id to retrieve DAG Versions for all DAGs. + * This endpoint allows specifying `~` as the dag_id to retrieve Dag Versions for all Dags. * @param data The data for the request. * @param data.dagId * @param data.limit @@ -3807,7 +3807,7 @@ export class DashboardService { /** * Dag Stats - * Return basic DAG stats with counts of DAGs in various states. + * Return basic Dag stats with counts of Dags in various states. * @returns DashboardDagStatsResponse Successful Response * @throws ApiError */ @@ -3975,7 +3975,7 @@ export class GridService { export class CalendarService { /** * Get Calendar - * Get calendar data for a DAG including historical and planned DAG runs. + * Get calendar data for a Dag including historical and planned Dag runs. * @param data The data for the request. * @param data.dagId * @param data.granularity diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts index 74fa8d93c69d9..02da380fd53c6 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts @@ -478,7 +478,7 @@ export type CreateAssetEventsBody = { }; /** - * DAG Collection serializer for responses. + * Dag Collection serializer for responses. */ export type DAGCollectionResponse = { dags: Array; @@ -486,7 +486,7 @@ export type DAGCollectionResponse = { }; /** - * Specific serializer for DAG Details responses. + * Specific serializer for Dag Details responses. */ export type DAGDetailsResponse = { dag_id: string; @@ -559,7 +559,7 @@ export type DAGPatchBody = { }; /** - * DAG serializer for responses. + * Dag serializer for responses. */ export type DAGResponse = { dag_id: string; @@ -593,7 +593,7 @@ export type DAGResponse = { }; /** - * DAG Run serializer for clear endpoint body. + * Dag Run serializer for clear endpoint body. */ export type DAGRunClearBody = { dry_run?: boolean; @@ -605,7 +605,7 @@ export type DAGRunClearBody = { }; /** - * DAG Run Collection serializer for responses. + * Dag Run Collection serializer for responses. */ export type DAGRunCollectionResponse = { dag_runs: Array; @@ -613,7 +613,7 @@ export type DAGRunCollectionResponse = { }; /** - * DAG Run Serializer for PATCH requests. + * Dag Run Serializer for PATCH requests. */ export type DAGRunPatchBody = { state?: DAGRunPatchStates | null; @@ -621,12 +621,12 @@ export type DAGRunPatchBody = { }; /** - * Enum for DAG Run states when updating a DAG Run. + * Enum for Dag Run states when updating a Dag Run. */ export type DAGRunPatchStates = 'queued' | 'success' | 'failed'; /** - * DAG Run serializer for responses. + * Dag Run serializer for responses. */ export type DAGRunResponse = { dag_run_id: string; @@ -654,7 +654,7 @@ export type DAGRunResponse = { }; /** - * List DAG Runs body for batch endpoint. + * List Dag Runs body for batch endpoint. */ export type DAGRunsBatchBody = { order_by?: string | null; @@ -681,7 +681,7 @@ export type DAGRunsBatchBody = { }; /** - * DAG Source serializer for responses. + * Dag Source serializer for responses. */ export type DAGSourceResponse = { content: string | null; @@ -691,7 +691,7 @@ export type DAGSourceResponse = { }; /** - * DAG Tags Collection serializer for responses. + * Dag Tags Collection serializer for responses. */ export type DAGTagCollectionResponse = { tags: Array<(string)>; @@ -699,7 +699,7 @@ export type DAGTagCollectionResponse = { }; /** - * DAG Version Collection serializer for responses. + * Dag Version Collection serializer for responses. */ export type DAGVersionCollectionResponse = { dag_versions: Array; @@ -707,7 +707,7 @@ export type DAGVersionCollectionResponse = { }; /** - * DAG warning collection serializer for responses. + * Dag warning collection serializer for responses. */ export type DAGWarningCollectionResponse = { dag_warnings: Array; @@ -715,7 +715,7 @@ export type DAGWarningCollectionResponse = { }; /** - * DAG Warning serializer for responses. + * Dag Warning serializer for responses. */ export type DAGWarningResponse = { dag_id: string; @@ -767,7 +767,7 @@ export type DagRunTriggeredByType = 'cli' | 'operator' | 'rest_api' | 'ui' | 'te export type DagRunType = 'backfill' | 'scheduled' | 'manual' | 'asset_triggered'; /** - * DAG schedule reference serializer for assets. + * Dag schedule reference serializer for assets. */ export type DagScheduleAssetReference = { dag_id: string; @@ -776,7 +776,7 @@ export type DagScheduleAssetReference = { }; /** - * DAG Stats Collection serializer for responses. + * Dag Stats Collection serializer for responses. */ export type DagStatsCollectionResponse = { dags: Array; @@ -784,7 +784,7 @@ export type DagStatsCollectionResponse = { }; /** - * DAG Stats serializer for responses. + * Dag Stats serializer for responses. */ export type DagStatsResponse = { dag_id: string; @@ -801,7 +801,7 @@ export type DagStatsStateResponse = { }; /** - * DAG Tag serializer for responses. + * Dag Tag serializer for responses. */ export type DagTagResponse = { name: string; @@ -824,7 +824,7 @@ export type DagVersionResponse = { }; /** - * Enum for DAG warning types. + * Enum for Dag warning types. * * This is the set of allowable values for the ``warning_type`` field * in the DagWarning model. @@ -1460,7 +1460,7 @@ export type TimeDelta = { }; /** - * Trigger DAG Run Serializer for POST body. + * Trigger Dag Run Serializer for POST body. */ export type TriggerDAGRunPostBody = { dag_run_id?: string | null; @@ -1652,7 +1652,7 @@ export type CalendarTimeRangeCollectionResponse = { }; /** - * Represents a summary of DAG runs for a specific calendar time range. + * Represents a summary of Dag runs for a specific calendar time range. */ export type CalendarTimeRangeResponse = { date: string; @@ -1715,7 +1715,7 @@ export type ConnectionHookMetaData = { }; /** - * DAG Run serializer for responses. + * Dag Run serializer for responses. */ export type DAGRunLightResponse = { id: number; @@ -1729,7 +1729,7 @@ export type DAGRunLightResponse = { }; /** - * DAG Run States for responses. + * Dag Run States for responses. */ export type DAGRunStates = { queued: number; @@ -1739,7 +1739,7 @@ export type DAGRunStates = { }; /** - * DAG Run Types for responses. + * Dag Run Types for responses. */ export type DAGRunTypes = { backfill: number; @@ -1749,7 +1749,7 @@ export type DAGRunTypes = { }; /** - * DAG with latest dag runs collection response serializer. + * Dag with latest dag runs collection response serializer. */ export type DAGWithLatestDagRunsCollectionResponse = { total_entries: number; @@ -1757,7 +1757,7 @@ export type DAGWithLatestDagRunsCollectionResponse = { }; /** - * DAG with latest dag runs response serializer. + * Dag with latest dag runs response serializer. */ export type DAGWithLatestDagRunsResponse = { dag_id: string; @@ -1795,7 +1795,7 @@ export type DAGWithLatestDagRunsResponse = { }; /** - * Dashboard DAG Stats serializer for responses. + * Dashboard Dag Stats serializer for responses. */ export type DashboardDagStatsResponse = { active_dag_count: number; @@ -1847,7 +1847,7 @@ export type GridRunsResponse = { }; /** - * DAG Run model for the Grid UI. + * Dag Run model for the Grid UI. */ export type GridTISummaries = { run_id: string; @@ -2341,7 +2341,7 @@ export type ListDagWarningsResponse = DAGWarningCollectionResponse; export type GetDagsData = { /** - * Filter DAGs by asset dependency (name or URI) + * Filter Dags by asset dependency (name or URI) */ assetDependency?: string | null; bundleName?: string | null; @@ -2365,7 +2365,7 @@ export type GetDagsData = { dagRunState?: Array<(string)>; excludeStale?: boolean; /** - * Filter DAGs with asset-based scheduling + * Filter Dags with asset-based scheduling */ hasAssetSchedule?: boolean | null; isFavorite?: boolean | null; @@ -2451,7 +2451,7 @@ export type GetDagTagsResponse = DAGTagCollectionResponse; export type GetDagsUiData = { /** - * Filter DAGs by asset dependency (name or URI) + * Filter Dags by asset dependency (name or URI) */ assetDependency?: string | null; bundleName?: string | null; @@ -2468,7 +2468,7 @@ export type GetDagsUiData = { dagRunsLimit?: number; excludeStale?: boolean; /** - * Filter DAGs with asset-based scheduling + * Filter Dags with asset-based scheduling */ hasAssetSchedule?: boolean | null; isFavorite?: boolean | null; diff --git a/airflow-core/src/airflow/utils/cli.py b/airflow-core/src/airflow/utils/cli.py index b33e50cc12c91..a4946c32851b1 100644 --- a/airflow-core/src/airflow/utils/cli.py +++ b/airflow-core/src/airflow/utils/cli.py @@ -226,7 +226,7 @@ def process_subdir(subdir: str | None): def get_dag_by_file_location(dag_id: str): - """Return DAG of a given dag_id by looking up file location.""" + """Return Dag of a given dag_id by looking up file location.""" # TODO: AIP-66 - investigate more, can we use serdag? from airflow.models import DagBag, DagModel @@ -265,7 +265,7 @@ def get_dag( bundle_names: list | None, dag_id: str, from_db: bool = False, dagfile_path: str | None = None ) -> DAG: """ - Return DAG of a given dag_id. + Return Dag of a given dag_id. First we'll try to use the given subdir. If that doesn't work, we'll try to find the correct path (assuming it's a file) and failing that, use the configured @@ -313,7 +313,7 @@ def get_dag( def get_dags(bundle_names: list | None, dag_id: str, use_regex: bool = False, from_db: bool = False): - """Return DAG(s) matching a given regex or dag_id.""" + """Return Dag(s) matching a given regex or dag_id.""" from airflow.models import DagBag bundle_names = bundle_names or [] diff --git a/airflow-core/src/airflow/utils/dag_cycle_tester.py b/airflow-core/src/airflow/utils/dag_cycle_tester.py index 91a266e63c261..af2087e7eeccf 100644 --- a/airflow-core/src/airflow/utils/dag_cycle_tester.py +++ b/airflow-core/src/airflow/utils/dag_cycle_tester.py @@ -38,7 +38,7 @@ def check_cycle(dag: DAG) -> None: .. deprecated:: 3.1.0 This function is deprecated. Use `dag.check_cycle()` method instead. - :param dag: The DAG to check for cycles + :param dag: The Dag to check for cycles :raises AirflowDagCycleException: If cycle is found in the DAG. """ # No warning here since we already warned on import diff --git a/airflow-core/src/airflow/utils/dag_edges.py b/airflow-core/src/airflow/utils/dag_edges.py index f8ed846f25532..d07470b0e8966 100644 --- a/airflow-core/src/airflow/utils/dag_edges.py +++ b/airflow-core/src/airflow/utils/dag_edges.py @@ -40,7 +40,7 @@ def dag_edges(dag: DAG): all edges are directed onto the proxy nodes. This is to cut down the number of edges on the graph. - For example: A DAG with TaskGroups group1 and group2: + For example: A Dag with TaskGroups group1 and group2: group1: task1, task2, task3 group2: task4, task5, task6 @@ -113,7 +113,7 @@ def collect_edges(task_group): setup_teardown_edges = set() # TODO (GH-52141): 'roots' in scheduler needs to return scheduler types - # instead, but currently it inherits SDK's DAG. + # instead, but currently it inherits SDK's Dag. tasks_to_trace = cast("list[Operator]", dag.roots) while tasks_to_trace: tasks_to_trace_next: list[Operator] = [] diff --git a/airflow-core/src/airflow/utils/dot_renderer.py b/airflow-core/src/airflow/utils/dot_renderer.py index 50911572d3971..1c3329c2a3348 100644 --- a/airflow-core/src/airflow/utils/dot_renderer.py +++ b/airflow-core/src/airflow/utils/dot_renderer.py @@ -16,7 +16,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Renderer DAG (tasks and dependencies) to the graphviz object.""" +"""Renderer Dag (tasks and dependencies) to the graphviz object.""" from __future__ import annotations @@ -161,9 +161,9 @@ def _draw_nodes( def render_dag_dependencies(deps: dict[str, list[DagDependency]]) -> graphviz.Digraph: """ - Render the DAG dependency to the DOT object. + Render the Dag dependency to the DOT object. - :param deps: List of DAG dependencies + :param deps: List of Dag dependencies :return: Graphviz object """ if not graphviz: @@ -194,11 +194,11 @@ def render_dag_dependencies(deps: dict[str, list[DagDependency]]) -> graphviz.Di def render_dag(dag: DAG, tis: list[TaskInstance] | None = None) -> graphviz.Digraph: """ - Render the DAG object to the DOT object. + Render the Dag object to the DOT object. If an task instance list is passed, the nodes will be painted according to task statuses. - :param dag: DAG that will be rendered. + :param dag: Dag that will be rendered. :param tis: List of task instances :return: Graphviz object """ diff --git a/airflow-core/src/airflow/utils/file.py b/airflow-core/src/airflow/utils/file.py index 21bd5c0511a7c..d26f0f1f984c6 100644 --- a/airflow-core/src/airflow/utils/file.py +++ b/airflow-core/src/airflow/utils/file.py @@ -208,7 +208,7 @@ def _find_path_from_directory( dirpath = (Path(root) / sd).resolve() if dirpath in patterns_by_dir: raise RuntimeError( - "Detected recursive loop when walking DAG directory " + "Detected recursive loop when walking Dag directory " f"{base_dir_path}: {dirpath} has appeared more than once." ) patterns_by_dir.update({dirpath: patterns.copy()}) @@ -250,7 +250,7 @@ def list_py_file_paths( :param directory: the directory to traverse :param safe_mode: whether to use a heuristic to determine whether a file - contains Airflow DAG definitions. If not provided, use the + contains Airflow Dag definitions. If not provided, use the core.DAG_DISCOVERY_SAFE_MODE configuration setting. If not set, default to safe. :return: a list of paths to Python files in the specified directory @@ -266,7 +266,7 @@ def list_py_file_paths( def find_dag_file_paths(directory: str | os.PathLike[str], safe_mode: bool) -> list[str]: - """Find file paths of all DAG files.""" + """Find file paths of all Dag files.""" file_paths = [] for file_path in find_path_from_directory(directory, ".airflowignore"): @@ -286,7 +286,7 @@ def find_dag_file_paths(directory: str | os.PathLike[str], safe_mode: bool) -> l def might_contain_dag(file_path: str, safe_mode: bool, zip_file: zipfile.ZipFile | None = None) -> bool: """ - Check whether a Python file contains Airflow DAGs. + Check whether a Python file contains Airflow Dags. When safe_mode is off (with False value), this function always returns True. @@ -305,11 +305,11 @@ def might_contain_dag(file_path: str, safe_mode: bool, zip_file: zipfile.ZipFile def might_contain_dag_via_default_heuristic(file_path: str, zip_file: zipfile.ZipFile | None = None) -> bool: """ - Heuristic that guesses whether a Python file contains an Airflow DAG definition. + Heuristic that guesses whether a Python file contains an Airflow Dag definition. :param file_path: Path to the file to be checked. :param zip_file: if passed, checks the archive. Otherwise, check local filesystem. - :return: True, if file might contain DAGs. + :return: True, if file might contain Dags. """ if zip_file: with zip_file.open(file_path) as current_file: diff --git a/airflow-core/src/airflow/utils/helpers.py b/airflow-core/src/airflow/utils/helpers.py index 112b6e70c9866..4e1501ec3deb2 100644 --- a/airflow-core/src/airflow/utils/helpers.py +++ b/airflow-core/src/airflow/utils/helpers.py @@ -231,7 +231,7 @@ def render_template(template: Any, context: MutableMapping[str, Any], *, native: :param template: A Jinja2 template to render. :param context: The Airflow task context to render the template with. :param native: If set to *True*, render the template into a native type. A - DAG can enable this with ``render_template_as_native_obj=True``. + Dag can enable this with ``render_template_as_native_obj=True``. :returns: The render result. """ context = copy.copy(context) diff --git a/airflow-core/src/airflow/utils/log/file_processor_handler.py b/airflow-core/src/airflow/utils/log/file_processor_handler.py index ea3151be1db92..2da7f26fe2941 100644 --- a/airflow-core/src/airflow/utils/log/file_processor_handler.py +++ b/airflow-core/src/airflow/utils/log/file_processor_handler.py @@ -84,11 +84,11 @@ def close(self): self.handler.close() def _render_filename(self, filename): - # Airflow log path used to be generated by `os.path.relpath(filename, self.dag_dir)`, however all DAGs - # in airflow source code are not located in the DAG dir as other DAGs. + # Airflow log path used to be generated by `os.path.relpath(filename, self.dag_dir)`, however all Dags + # in airflow source code are not located in the Dag dir as other Dags. # That will create a log filepath which is not under control since it could be outside - # of the log dir. The change here is to make sure the log path for DAGs in airflow code - # is always inside the log dir as other DAGs. To be differentiate with regular DAGs, + # of the log dir. The change here is to make sure the log path for Dags in airflow code + # is always inside the log dir as other Dags. To be differentiate with regular Dags, # their logs will be in the `log_dir/native_dags`. import airflow diff --git a/airflow-core/src/airflow/utils/state.py b/airflow-core/src/airflow/utils/state.py index b392a02352574..410695aa4ef44 100644 --- a/airflow-core/src/airflow/utils/state.py +++ b/airflow-core/src/airflow/utils/state.py @@ -59,7 +59,7 @@ class TaskInstanceState(str, Enum): # Use None instead if need this state. # Set by the scheduler - REMOVED = TerminalTIState.REMOVED # Task vanished from DAG before it ran + REMOVED = TerminalTIState.REMOVED # Task vanished from Dag before it ran SCHEDULED = IntermediateTIState.SCHEDULED # Task should run and will be handed to executor soon # Set by the task instance itself diff --git a/airflow-core/src/airflow/utils/types.py b/airflow-core/src/airflow/utils/types.py index 276901f94bcd9..1a52e42942acb 100644 --- a/airflow-core/src/airflow/utils/types.py +++ b/airflow-core/src/airflow/utils/types.py @@ -62,8 +62,8 @@ class DagRunTriggeredByType(enum.Enum): CLI = "cli" # for the trigger subcommand of the CLI: airflow dags trigger OPERATOR = "operator" # for the TriggerDagRunOperator - REST_API = "rest_api" # for triggering the DAG via RESTful API - UI = "ui" # for clicking the `Trigger DAG` button + REST_API = "rest_api" # for triggering the Dag via RESTful API + UI = "ui" # for clicking the `Trigger Dag` button TEST = "test" # for dag.test() TIMETABLE = "timetable" # for timetable based triggering ASSET = "asset" # for asset_triggered run type diff --git a/airflow-core/tests/conftest.py b/airflow-core/tests/conftest.py index bffa1c61e8912..627928c9b8d44 100644 --- a/airflow-core/tests/conftest.py +++ b/airflow-core/tests/conftest.py @@ -96,13 +96,13 @@ def _config_bundles(bundles: dict[str, Path | str]): @pytest.fixture def configure_dag_bundles(): - """Configure arbitrary DAG bundles with the provided paths""" + """Configure arbitrary Dag bundles with the provided paths""" return _config_bundles @pytest.fixture def configure_testing_dag_bundle(): - """Configure a "testing" DAG bundle with the provided path""" + """Configure a "testing" Dag bundle with the provided path""" @contextmanager def _config_bundle(path_to_parse: Path | str): diff --git a/airflow-core/tests/integration/otel/test_otel.py b/airflow-core/tests/integration/otel/test_otel.py index 03f427227c113..4eade0b4d523f 100644 --- a/airflow-core/tests/integration/otel/test_otel.py +++ b/airflow-core/tests/integration/otel/test_otel.py @@ -79,7 +79,7 @@ def unpause_trigger_dag_and_get_run_id(dag_id: str) -> str: def wait_for_dag_run_and_check_span_status( dag_id: str, run_id: str, max_wait_time: int, span_status: str | None ): - # max_wait_time, is the timeout for the DAG run to complete. The value is in seconds. + # max_wait_time, is the timeout for the Dag run to complete. The value is in seconds. start_time = timezone.utcnow().timestamp() while timezone.utcnow().timestamp() - start_time < max_wait_time: @@ -98,10 +98,10 @@ def wait_for_dag_run_and_check_span_status( continue dag_run_state = dag_run.state - log.debug("DAG Run state: %s.", dag_run_state) + log.debug("Dag Run state: %s.", dag_run_state) dag_run_span_status = dag_run.span_status - log.debug("DAG Run span status: %s.", dag_run_span_status) + log.debug("Dag Run span status: %s.", dag_run_span_status) if dag_run_state in [State.SUCCESS, State.FAILED]: break @@ -648,7 +648,7 @@ def setup_class(cls): @classmethod def serialize_and_get_dags(cls) -> dict[str, DAG]: log.info("Serializing Dags from directory %s", cls.dag_folder) - # Load DAGs from the dag directory. + # Load Dags from the dag directory. dag_bag = DagBag(dag_folder=cls.dag_folder, include_examples=False) dag_ids = dag_bag.dag_ids @@ -660,9 +660,9 @@ def serialize_and_get_dags(cls) -> dict[str, DAG]: dag = dag_bag.get_dag(dag_id) dag_dict[dag_id] = dag - assert dag is not None, f"DAG with ID {dag_id} not found." + assert dag is not None, f"Dag with ID {dag_id} not found." - # Sync the DAG to the database. + # Sync the Dag to the database. if AIRFLOW_V_3_0_PLUS: from airflow.models.dagbundle import DagBundleModel diff --git a/airflow-core/tests/system/example_empty.py b/airflow-core/tests/system/example_empty.py index a452cd6382376..45a130bf9c922 100644 --- a/airflow-core/tests/system/example_empty.py +++ b/airflow-core/tests/system/example_empty.py @@ -44,5 +44,5 @@ from tests_common.test_utils.system_tests import get_test_run # noqa: E402 -# Needed to run the example DAG with pytest (see: tests/system/README.md#run_via_pytest) +# Needed to run the example Dag with pytest (see: tests/system/README.md#run_via_pytest) test_run = get_test_run(dag) diff --git a/airflow-core/tests/unit/api_fastapi/common/db/test_dags.py b/airflow-core/tests/unit/api_fastapi/common/db/test_dags.py index c6128a9323618..07e59abea97d4 100644 --- a/airflow-core/tests/unit/api_fastapi/common/db/test_dags.py +++ b/airflow-core/tests/unit/api_fastapi/common/db/test_dags.py @@ -112,7 +112,7 @@ def dag_with_running_run(self, session): return dag_model, dagrun def test_includes_queued_run_without_start_date(self, dag_with_queued_run, session): - """DAGs with QUEUED runs and null start_date should be included when no filters are applied, and joined DagRun state must not be None.""" + """Dags with QUEUED runs and null start_date should be included when no filters are applied, and joined DagRun state must not be None.""" dag_model, _ = dag_with_queued_run query = generate_dag_with_latest_run_query( max_run_filters=[], @@ -130,7 +130,7 @@ def test_includes_queued_run_without_start_date(self, dag_with_queued_run, sessi def test_includes_queued_run_when_ordering_by_state( self, dag_with_queued_run, dag_with_running_run, session ): - """DAGs with QUEUED runs and null start_date, and RUNNING runs must all have joined DagRun info not None.""" + """Dags with QUEUED runs and null start_date, and RUNNING runs must all have joined DagRun info not None.""" queued_dag_model, _ = dag_with_queued_run running_dag_model, _ = dag_with_running_run @@ -156,7 +156,7 @@ def test_includes_queued_run_when_ordering_by_state( def test_includes_queued_run_when_ordering_by_start_date( self, dag_with_queued_run, dag_with_running_run, session ): - """DAGs with QUEUED runs and RUNNING runs must all have joined DagRun info not None when ordering by start_date.""" + """Dags with QUEUED runs and RUNNING runs must all have joined DagRun info not None when ordering by start_date.""" queued_dag_model, _ = dag_with_queued_run running_dag_model, _ = dag_with_running_run @@ -229,9 +229,9 @@ def test_queued_runs_with_null_start_date_are_properly_joined( self, dag_with_queued_run, dag_with_running_run, session ): """ - Verifies that DAGs with null start_date are properly joined in the query. + Verifies that Dags with null start_date are properly joined in the query. - If a WHERE clause filters out null start_dates, these DAGs would be excluded. + If a WHERE clause filters out null start_dates, these Dags would be excluded. This test ensures they are still present and joined correctly. """ @@ -258,7 +258,7 @@ def test_queued_runs_with_null_start_date_are_properly_joined( elif dag_model.dag_id == running_dag_model.dag_id: running_dag_result = row - # Assert both DAGs are present + # Assert both Dags are present assert queued_dag_result is not None, f"Queued DAG {queued_dag_model.dag_id} should be in results" assert running_dag_result is not None, f"Running DAG {running_dag_model.dag_id} should be in results" 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 b49e5bb6b3e64..331e81953ac68 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 @@ -116,7 +116,7 @@ def _create_dag_tags(self, session=None): session.add(DagTag(dag_id=DAG3_ID, name="tag_1")) def _create_asset_test_data(self, session=None): - """Create test assets and asset-scheduled DAGs.""" + """Create test assets and asset-scheduled Dags.""" # Create assets asset1 = AssetModel(uri="test://asset1", name="test_asset_1", group="test-group") asset2 = AssetModel(uri="s3://bucket/dataset", name="dataset_asset", group="test-group") @@ -143,7 +143,7 @@ def _create_asset_test_data(self, session=None): has_import_errors=False, ) - # Create DAGs with asset dependencies + # Create Dags with asset dependencies asset_dep_dag = DagModel( dag_id=ASSET_DEP_DAG_ID, bundle_name="dag_maker", @@ -240,7 +240,7 @@ def teardown_method(self) -> None: class TestGetDags(TestDagEndpoint): - """Unit tests for Get DAGs.""" + """Unit tests for Get Dags.""" @pytest.mark.parametrize( "query_params, expected_total_entries, expected_ids", @@ -470,7 +470,7 @@ def test_get_dags_should_call_authorized_dag_ids(self, mock_get_authorized_dag_i def test_get_dags_filter_favorites( self, session, test_client, setup_favorites, expected_total_entries, expected_ids ): - """Test filtering DAGs by is_favorite=true.""" + """Test filtering Dags by is_favorite=true.""" for dag_id in setup_favorites: session.add(DagFavorite(user_id="test", dag_id=dag_id)) session.commit() @@ -582,7 +582,7 @@ def test_patch_dag_audit_log_payload(self, test_client, is_paused_value, session class TestPatchDags(TestDagEndpoint): - """Unit tests for Patch DAGs.""" + """Unit tests for Patch Dags.""" @pytest.mark.parametrize( "query_params, body, expected_status_code, expected_ids, expected_paused_ids", diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py index 173e57592e49f..683b2ac764d40 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py @@ -216,7 +216,7 @@ def test_should_raises_403_unauthorized__user_can_not_read_any_dags_in_file( mock_is_authorized_dag.assert_called_once_with(method="GET", user=mock.ANY) mock_get_authorized_dag_ids.assert_called_once_with(user=mock.ANY) assert response.status_code == 403 - assert response.json() == {"detail": "You do not have read permission on any of the DAGs in the file"} + assert response.json() == {"detail": "You do not have read permission on any of the Dags in the file"} @mock.patch("airflow.api_fastapi.core_api.routes.public.import_error.get_auth_manager") def test_get_import_error__user_dont_have_read_permission_to_read_all_dags_in_file( @@ -233,7 +233,7 @@ def test_get_import_error__user_dont_have_read_permission_to_read_all_dags_in_fi "import_error_id": import_error_id, "timestamp": from_datetime_to_zulu_without_ms(TIMESTAMP1), "filename": FILENAME1, - "stack_trace": "REDACTED - you do not have read permission on all DAGs in the file", + "stack_trace": "REDACTED - you do not have read permission on all Dags in the file", "bundle_name": BUNDLE_NAME, } @@ -348,7 +348,7 @@ def test_should_raises_403_unauthorized(self, unauthorized_test_client): pytest.param(True, STACKTRACE1, id="user_has_read_access_to_all_dags_in_current_file"), pytest.param( False, - "REDACTED - you do not have read permission on all DAGs in the file", + "REDACTED - you do not have read permission on all Dags in the file", id="user_does_not_have_read_access_to_all_dags_in_current_file", ), ], diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py index 192e461a9f6bb..aeb486b48f59e 100644 --- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py +++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py @@ -163,7 +163,7 @@ def test_latest_run_should_response_403(self, unauthorized_test_client): ], ) def test_asset_filtering(self, test_client, query_params, expected_dag_count, session): - """Test asset-based filtering on the UI DAGs endpoint.""" + """Test asset-based filtering on the UI Dags endpoint.""" self._create_asset_test_data(session) diff --git a/airflow-core/tests/unit/cli/commands/test_dag_command.py b/airflow-core/tests/unit/cli/commands/test_dag_command.py index cd02de96d4961..37c175d6454b0 100644 --- a/airflow-core/tests/unit/cli/commands/test_dag_command.py +++ b/airflow-core/tests/unit/cli/commands/test_dag_command.py @@ -478,21 +478,21 @@ def test_pause_non_existing_dag_do_not_error(self, stdout_capture): with stdout_capture as temp_stdout: dag_command.dag_pause(args) out = temp_stdout.splitlines()[-1] - assert out == "No unpaused DAGs were found" + assert out == "No unpaused Dags were found" def test_unpause_non_existing_dag_do_not_error(self, stdout_capture): args = self.parser.parse_args(["dags", "unpause", "non_existing_dag"]) with stdout_capture as temp_stdout: dag_command.dag_unpause(args) out = temp_stdout.splitlines()[-1] - assert out == "No paused DAGs were found" + assert out == "No paused Dags were found" def test_unpause_already_unpaused_dag_do_not_error(self, stdout_capture): args = self.parser.parse_args(["dags", "unpause", "example_bash_operator", "--yes"]) with stdout_capture as temp_stdout: dag_command.dag_unpause(args) out = temp_stdout.splitlines()[-1] - assert out == "No paused DAGs were found" + assert out == "No paused Dags were found" def test_pausing_already_paused_dag_do_not_error(self, stdout_capture): args = self.parser.parse_args(["dags", "pause", "example_bash_operator", "--yes"]) @@ -500,7 +500,7 @@ def test_pausing_already_paused_dag_do_not_error(self, stdout_capture): dag_command.dag_pause(args) dag_command.dag_pause(args) out = temp_stdout.splitlines()[-1] - assert out == "No unpaused DAGs were found" + assert out == "No unpaused Dags were found" def test_trigger_dag(self): dag_command.dag_trigger( @@ -950,7 +950,7 @@ def test_dag_test_with_mark_success(self, mock__execute_task): @conf_vars({("core", "load_examples"): "false"}) def test_get_dag_excludes_examples_with_bundle(self, configure_testing_dag_bundle): - """Test that example DAGs are excluded when bundle names are passed.""" + """Test that example Dags are excluded when bundle names are passed.""" from airflow.utils.cli import get_dag with configure_testing_dag_bundle(TEST_DAGS_FOLDER / "test_sensor.py"): diff --git a/airflow-core/tests/unit/core/test_impersonation_tests.py b/airflow-core/tests/unit/core/test_impersonation_tests.py index 62c8effb5b275..fdf4f04c89c3e 100644 --- a/airflow-core/tests/unit/core/test_impersonation_tests.py +++ b/airflow-core/tests/unit/core/test_impersonation_tests.py @@ -168,7 +168,7 @@ def setup_impersonation_tests(self, create_airflow_home): def get_dagbag(dag_folder): """Get DagBag and print statistic into the log.""" dagbag = DagBag(dag_folder=dag_folder, include_examples=False) - logger.info("Loaded DAGs:") + logger.info("Loaded Dags:") logger.info(dagbag.dagbag_report()) return dagbag diff --git a/airflow-core/tests/unit/dag_processing/test_collection.py b/airflow-core/tests/unit/dag_processing/test_collection.py index 924f7757b33e1..e485d6e86d892 100644 --- a/airflow-core/tests/unit/dag_processing/test_collection.py +++ b/airflow-core/tests/unit/dag_processing/test_collection.py @@ -439,7 +439,7 @@ def test_sync_to_db_is_retried( assert serialized_dags_count == 0 def test_serialized_dags_are_written_to_db_on_sync(self, testing_dag_bundle, session): - """Test DAGs are Serialized and written to DB when parsing result is updated""" + """Test Dags are Serialized and written to DB when parsing result is updated""" serialized_dags_count = session.query(func.count(SerializedDagModel.dag_id)).scalar() assert serialized_dags_count == 0 diff --git a/airflow-core/tests/unit/dag_processing/test_manager.py b/airflow-core/tests/unit/dag_processing/test_manager.py index b2f76e8114dea..4aa30e04c60b6 100644 --- a/airflow-core/tests/unit/dag_processing/test_manager.py +++ b/airflow-core/tests/unit/dag_processing/test_manager.py @@ -444,7 +444,7 @@ def test_parsing_requests_only_bundles_being_parsed(self, testing_dag_bundle): def test_scan_stale_dags(self, testing_dag_bundle): """ - Ensure that DAGs are marked inactive when the file is parsed but the + Ensure that Dags are marked inactive when the file is parsed but the DagModel.last_parsed_time is not updated. """ manager = DagFileProcessorManager( diff --git a/airflow-core/tests/unit/dags/README.md b/airflow-core/tests/unit/dags/README.md index 364fe92e64773..b33db9a1302b2 100644 --- a/airflow-core/tests/unit/dags/README.md +++ b/airflow-core/tests/unit/dags/README.md @@ -21,7 +21,7 @@ This folder contains DAGs for Airflow unit testing. -To access a DAG in this folder, use the following code inside a unit test. Note this only works when `test_mode` is on; otherwise the normal Airflow `DAGS_FOLDER` will take precedence. +To access a Dag in this folder, use the following code inside a unit test. Note this only works when `test_mode` is on; otherwise the normal Airflow `DAGS_FOLDER` will take precedence. ```python dagbag = DagBag() diff --git a/airflow-core/tests/unit/dags/test_dag_for_db_queries_counter.py b/airflow-core/tests/unit/dags/test_dag_for_db_queries_counter.py index edd9a34556cb7..e1dc126082b24 100644 --- a/airflow-core/tests/unit/dags/test_dag_for_db_queries_counter.py +++ b/airflow-core/tests/unit/dags/test_dag_for_db_queries_counter.py @@ -39,6 +39,6 @@ def create_dag(suffix): # 26 queries for parsing file with one DAG, 17 queries more for each new dag. -# As a result 94 queries for this file with 5 DAGs. +# As a result 94 queries for this file with 5 Dags. for i in range(0, 5): globals()[f"dag_{i}"] = create_dag(f"dag_{i}") diff --git a/airflow-core/tests/unit/dags_corrupted/README.md b/airflow-core/tests/unit/dags_corrupted/README.md index d91e568a6139a..249045d1a0349 100644 --- a/airflow-core/tests/unit/dags_corrupted/README.md +++ b/airflow-core/tests/unit/dags_corrupted/README.md @@ -22,7 +22,7 @@ This folder contains DAGs for Airflow unit testing. These files contain defects that prevent the default Python interpreter from loading this file. -To access a DAG in this folder, use the following code inside a unit test. +To access a Dag in this folder, use the following code inside a unit test. ```python TEST_DAG_FOLDER = os.path.join(os.path.dirname(os.path.realpath(__file__)), "dags_corrupted") diff --git a/airflow-core/tests/unit/dags_corrupted/test_impersonation_custom.py b/airflow-core/tests/unit/dags_corrupted/test_impersonation_custom.py index 832c1c0820ba1..5a3d78962abdb 100644 --- a/airflow-core/tests/unit/dags_corrupted/test_impersonation_custom.py +++ b/airflow-core/tests/unit/dags_corrupted/test_impersonation_custom.py @@ -20,7 +20,7 @@ from datetime import datetime, timedelta # Originally, impersonation tests were incomplete missing the use case when -# DAGs access custom packages usually made available through the PYTHONPATH environment +# Dags access custom packages usually made available through the PYTHONPATH environment # variable. This file includes a DAG that imports a custom package made available and if # run via the previous implementation of impersonation, will fail by not being able to # import the custom package. diff --git a/airflow-core/tests/unit/jobs/test_scheduler_job.py b/airflow-core/tests/unit/jobs/test_scheduler_job.py index adf3fddc41af9..b00df2318a234 100644 --- a/airflow-core/tests/unit/jobs/test_scheduler_job.py +++ b/airflow-core/tests/unit/jobs/test_scheduler_job.py @@ -1033,7 +1033,7 @@ def test_find_executable_task_instances_in_default_pool(self, dag_maker, mock_ex session.close() def test_queued_task_instances_fails_with_missing_dag(self, dag_maker, session): - """Check that task instances of missing DAGs are failed""" + """Check that task instances of missing Dags are failed""" dag_id = "SchedulerJobTest.test_find_executable_task_instances_not_in_dagbag" task_id_1 = "dummy" task_id_2 = "dummydummy" @@ -3093,7 +3093,7 @@ def test_dagrun_root_after_dagrun_unfinished(self, mock_executor, testing_dag_bu def test_scheduler_start_date(self, testing_dag_bundle): """ - Test that the scheduler respects start_dates, even when DAGs have run + Test that the scheduler respects start_dates, even when Dags have run """ dagbag = DagBag(TEST_DAG_FOLDER, include_examples=False) with create_session() as session: @@ -3655,7 +3655,7 @@ def test_retry_still_in_executor(self, dag_maker, session): @provide_session def do_schedule(session): # Use a empty file since the above mock will return the - # expected DAGs. Also specify only a single file so that it doesn't + # expected Dags. Also specify only a single file so that it doesn't # try to schedule the above DAG repeatedly. scheduler_job = Job(executor=executor) self.job_runner = SchedulerJobRunner(job=scheduler_job, num_runs=1) @@ -6260,7 +6260,7 @@ def test_mapped_dag(self, dag_id, session, testing_dag_bundle): def test_should_mark_empty_task_as_success(self, testing_dag_bundle): dag_file = Path(__file__).parents[1] / "dags/test_only_empty_tasks.py" - # Write DAGs to dag and serialized_dag table + # Write Dags to dag and serialized_dag table dagbag = DagBag(dag_folder=dag_file, include_examples=False) sync_bag_to_db(dagbag, "testing", None) @@ -6947,7 +6947,7 @@ def per_test(self) -> Generator: [ (21, 1, 1), # One DAG with one task per DAG file. (21, 1, 5), # One DAG with five tasks per DAG file. - (148, 10, 10), # 10 DAGs with 10 tasks per DAG file. + (148, 10, 10), # 10 Dags with 10 tasks per DAG file. ], ) def test_execute_queries_count_with_harvested_dags( @@ -7031,7 +7031,7 @@ def test_execute_queries_count_with_harvested_dags( ([25, 28, 32, 36], 1, 5, "1d", "30m", "binary_tree"), ([25, 28, 32, 36], 1, 5, "1d", "30m", "star"), ([25, 28, 32, 36], 1, 5, "1d", "30m", "grid"), - # 10 DAGs with 10 tasks per DAG file. + # 10 Dags with 10 tasks per DAG file. ([10, 10, 10, 10], 10, 10, "1d", "None", "no_structure"), ([10, 10, 10, 10], 10, 10, "1d", "None", "linear"), ([218, 69, 69, 69], 10, 10, "1d", "@once", "no_structure"), diff --git a/airflow-core/tests/unit/models/test_dag.py b/airflow-core/tests/unit/models/test_dag.py index 867dc5aaaa555..ccc7f28c1dd15 100644 --- a/airflow-core/tests/unit/models/test_dag.py +++ b/airflow-core/tests/unit/models/test_dag.py @@ -1273,7 +1273,7 @@ def test_fractional_seconds(self): def test_rich_comparison_ops(self): test_dag_id = "test_rich_comparison_ops" - class DAGsubclass(DAG): + class Dagsubclass(DAG): pass args = {"owner": "airflow", "start_date": DEFAULT_DATE} @@ -1284,8 +1284,8 @@ class DAGsubclass(DAG): dag_diff_load_time = DAG(test_dag_id, schedule=None, default_args=args) dag_diff_name = DAG(test_dag_id + "_neq", schedule=None, default_args=args) - dag_subclass = DAGsubclass(test_dag_id, schedule=None, default_args=args) - dag_subclass_diff_name = DAGsubclass(test_dag_id + "2", schedule=None, default_args=args) + dag_subclass = Dagsubclass(test_dag_id, schedule=None, default_args=args) + dag_subclass_diff_name = Dagsubclass(test_dag_id + "2", schedule=None, default_args=args) for dag_ in [dag_eq, dag_diff_name, dag_subclass, dag_subclass_diff_name]: dag_.last_loaded = dag.last_loaded @@ -2279,7 +2279,7 @@ def test_max_active_runs_not_none(self, testing_dag_bundle): def test_dags_needing_dagruns_only_unpaused(self, testing_dag_bundle): """ - We should never create dagruns for unpaused DAGs + We should never create dagruns for unpaused Dags """ dag = DAG(dag_id="test_dags", schedule=None, start_date=DEFAULT_DATE) EmptyOperator(task_id="dummy", dag=dag, owner="airflow") diff --git a/airflow-core/tests/unit/models/test_dagbag.py b/airflow-core/tests/unit/models/test_dagbag.py index c2668755c0670..dd4faeb2215d9 100644 --- a/airflow-core/tests/unit/models/test_dagbag.py +++ b/airflow-core/tests/unit/models/test_dagbag.py @@ -87,7 +87,7 @@ def test_timeout_context_manager_raises_exception(self): def test_get_existing_dag(self, tmp_path): """ - Test that we're able to parse some example DAGs and retrieve them + Test that we're able to parse some example Dags and retrieve them """ dagbag = DagBag(dag_folder=os.fspath(tmp_path), include_examples=True) @@ -212,7 +212,7 @@ def test_zip_skip_log(self, caplog, test_zip_path): assert dagbag.has_logged assert ( f"File {test_zip_path}:file_no_airflow_dag.py " - "assumed to contain no DAGs. Skipping." in caplog.text + "assumed to contain no Dags. Skipping." in caplog.text ) def test_zip(self, tmp_path, test_zip_path): diff --git a/airflow-core/tests/unit/models/test_dagcode.py b/airflow-core/tests/unit/models/test_dagcode.py index 818fb4915fd78..afccde54d1d8e 100644 --- a/airflow-core/tests/unit/models/test_dagcode.py +++ b/airflow-core/tests/unit/models/test_dagcode.py @@ -44,7 +44,7 @@ def make_example_dags(module): - """Loads DAGs from a module for test.""" + """Loads Dags from a module for test.""" # TODO: AIP-66 dedup with tests/models/test_serdag from airflow.models.dagbundle import DagBundleModel from airflow.utils.session import create_session diff --git a/airflow-core/tests/unit/models/test_dagrun.py b/airflow-core/tests/unit/models/test_dagrun.py index 9c85dc041e618..a82b3ce316906 100644 --- a/airflow-core/tests/unit/models/test_dagrun.py +++ b/airflow-core/tests/unit/models/test_dagrun.py @@ -1052,7 +1052,7 @@ def test_wait_for_downstream(self, dag_maker, session, prev_ti_state, is_ti_sche @pytest.mark.parametrize("state", [DagRunState.QUEUED, DagRunState.RUNNING]) def test_next_dagruns_to_examine_only_unpaused(self, session, state, testing_dag_bundle): """ - Check that "next_dagruns_to_examine" ignores runs from paused/inactive DAGs + Check that "next_dagruns_to_examine" ignores runs from paused/inactive Dags and gets running/queued dagruns """ dag = DAG(dag_id="test_dags", schedule=datetime.timedelta(days=1), start_date=DEFAULT_DATE) diff --git a/airflow-core/tests/unit/models/test_serialized_dag.py b/airflow-core/tests/unit/models/test_serialized_dag.py index f6277038dd96c..2cd16eeca6591 100644 --- a/airflow-core/tests/unit/models/test_serialized_dag.py +++ b/airflow-core/tests/unit/models/test_serialized_dag.py @@ -50,7 +50,7 @@ # To move it to a shared module. def make_example_dags(module): - """Loads DAGs from a module for test.""" + """Loads Dags from a module for test.""" from airflow.models.dagbundle import DagBundleModel from airflow.utils.session import create_session @@ -91,7 +91,7 @@ def _write_example_dags(self): return example_dags def test_write_dag(self, testing_dag_bundle): - """DAGs can be written into database""" + """Dags can be written into database""" example_dags = self._write_example_dags() with create_session() as session: @@ -180,7 +180,7 @@ def test_serialized_dag_is_updated_if_dag_is_changed(self, testing_dag_bundle): assert dag_updated is True def test_read_dags(self): - """DAGs can be read from database.""" + """Dags can be read from database.""" example_dags = self._write_example_dags() serialized_dags = SDM.read_all_dags() assert len(example_dags) == len(serialized_dags) @@ -197,7 +197,7 @@ def test_read_all_dags_only_picks_the_latest_serdags(self, session): dag = example_dags.get("example_bash_operator") - # DAGs are serialized and deserialized to access create_dagrun object + # Dags are serialized and deserialized to access create_dagrun object sdag = SerializedDAG.deserialize_dag(SerializedDAG.serialize_dag(dag=dag)) sdag.create_dagrun( run_id="test1", diff --git a/airflow-core/tests/unit/models/test_taskinstance.py b/airflow-core/tests/unit/models/test_taskinstance.py index a730fa8d8d8df..c67b1f3bda40f 100644 --- a/airflow-core/tests/unit/models/test_taskinstance.py +++ b/airflow-core/tests/unit/models/test_taskinstance.py @@ -155,7 +155,7 @@ def teardown_method(self): def test_set_task_dates(self, dag_maker): """ - Test that tasks properly take start/end dates from DAGs + Test that tasks properly take start/end dates from Dags """ with dag_maker("dag", end_date=DEFAULT_DATE + datetime.timedelta(days=10)) as dag: pass @@ -243,7 +243,7 @@ def test_infer_dag(self, create_dummy_dag): op1.set_downstream(op2) assert op2.dag is dag - # can't assign across multiple DAGs + # can't assign across multiple Dags with pytest.raises(RuntimeError): op1.set_downstream(op4) with pytest.raises(RuntimeError): diff --git a/airflow-core/tests/unit/serialization/test_dag_serialization.py b/airflow-core/tests/unit/serialization/test_dag_serialization.py index e4f0535493359..88730b90f608f 100644 --- a/airflow-core/tests/unit/serialization/test_dag_serialization.py +++ b/airflow-core/tests/unit/serialization/test_dag_serialization.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Unit tests for stringified DAGs.""" +"""Unit tests for stringified Dags.""" from __future__ import annotations @@ -248,7 +248,7 @@ "test_role": { "__type": "dict", "__var": { - "DAGs": { + "Dags": { "__type": "set", "__var": [ permissions.ACTION_CAN_READ, @@ -327,7 +327,7 @@ def make_simple_dag(): def make_user_defined_macro_filter_dag(): """ - Make DAGs with user defined macros and filters using locally defined methods. + Make Dags with user defined macros and filters using locally defined methods. For Webserver, we do not include ``user_defined_macros`` & ``user_defined_filters``. @@ -376,7 +376,7 @@ def get_excluded_patterns() -> Generator[str, None, None]: def collect_dags(dag_folder=None): - """Collects DAGs to test.""" + """Collects Dags to test.""" dags = {} import_errors = {} dags.update({"simple_dag": make_simple_dag()}) @@ -436,8 +436,8 @@ def timetable_plugin(monkeypatch): ) -class TestStringifiedDAGs: - """Unit tests for stringified DAGs.""" +class TestStringifiedDags: + """Unit tests for stringified Dags.""" def setup_method(self): logging.config.dictConfig(DEFAULT_LOGGING_CONFIG) @@ -565,7 +565,7 @@ def test_dag_serialization_unregistered_custom_timetable(self): SerializedDAG.to_dict(dag) message = ( - "Failed to serialize DAG 'simple_dag': Timetable class " + "Failed to serialize Dag 'simple_dag': Timetable class " "'tests_common.test_utils.timetables.CustomSerializationTimetable' " "is not registered or " "you have a top level database access that disrupted the session. " @@ -574,7 +574,7 @@ def test_dag_serialization_unregistered_custom_timetable(self): assert str(ctx.value) == message def prepare_ser_dags_for_comparison(self, actual, expected): - """Verify serialized DAGs match the ground truth.""" + """Verify serialized Dags match the ground truth.""" assert actual["dag"]["fileloc"].split("/")[-1] == "test_dag_serialization.py" actual["dag"]["fileloc"] = None @@ -627,7 +627,7 @@ def test_deserialization_across_process(self): dags, _ = collect_dags("airflow/example_dags") assert set(stringified_dags.keys()) == set(dags.keys()) - # Verify deserialized DAGs. + # Verify deserialized Dags. for dag_id in stringified_dags: self.validate_deserialized_dag(stringified_dags[dag_id], dags[dag_id]) @@ -641,7 +641,7 @@ def test_roundtrip_provider_example_dags(self): ] ) - # Verify deserialized DAGs. + # Verify deserialized Dags. for dag in dags.values(): serialized_dag = SerializedDAG.from_json(SerializedDAG.to_json(dag)) self.validate_deserialized_dag(serialized_dag, dag) @@ -663,7 +663,7 @@ def test_dag_roundtrip_from_timetable(self, timetable): def validate_deserialized_dag(self, serialized_dag: DAG, dag: DAG): """ - Verify that all example DAGs work with DAG Serialization by + Verify that all example Dags work with DAG Serialization by checking fields between Serialized Dags & non-Serialized Dags """ exclusion_list = { @@ -1033,7 +1033,7 @@ def test_roundtrip_relativedelta(self, val, expected): ) def test_dag_params_roundtrip(self, val, expected_val): """ - Test that params work both on Serialized DAGs & Tasks + Test that params work both on Serialized Dags & Tasks """ if expected_val == ParamValidationError: with pytest.raises(ParamValidationError): @@ -1117,7 +1117,7 @@ def test_full_param_roundtrip(self, param: Param): ) def test_task_params_roundtrip(self, val, expected_val): """ - Test that params work both on Serialized DAGs & Tasks + Test that params work both on Serialized Dags & Tasks """ dag = DAG(dag_id="simple_dag", schedule=None) if expected_val == ParamValidationError: @@ -1340,7 +1340,7 @@ def test_templated_fields_exist_in_serialized_dag(self, templated_field, expecte def test_dag_serialized_fields_with_schema(self): """ - Additional Properties are disabled on DAGs. This test verifies that all the + Additional Properties are disabled on Dags. This test verifies that all the keys in DAG.get_serialized_fields are listed in Schema definition. """ dag_schema: dict = load_dag_schema_dict()["definitions"]["dag"]["properties"] @@ -2362,7 +2362,7 @@ def execute(self, context: Context): AirflowException, match=re.escape( dedent( - """Failed to serialize DAG 'test_dag': Cannot template BaseOperator field: + """Failed to serialize Dag 'test_dag': Cannot template BaseOperator field: 'execution_timeout' op.__class__.__name__='TestOperator' op.template_fields=('execution_timeout', 'run_as_user')""" ) ), @@ -2799,7 +2799,7 @@ def x(arg1, arg2, arg3): # Ensure the serialized operator can also be correctly pickled, to ensure # correct interaction between DAG pickling and serialization. This is done # here so we don't need to duplicate tests between pickled and non-pickled - # DAGs everywhere else. + # Dags everywhere else. pickled = pickle.loads(pickle.dumps(deserialized)) assert pickled.op_kwargs_expand_input == _ExpandInputRef( key="dict-of-lists", @@ -2889,7 +2889,7 @@ def x(arg1, arg2, arg3): # Ensure the serialized operator can also be correctly pickled, to ensure # correct interaction between DAG pickling and serialization. This is done # here so we don't need to duplicate tests between pickled and non-pickled - # DAGs everywhere else. + # Dags everywhere else. pickled = pickle.loads(pickle.dumps(deserialized)) assert pickled.op_kwargs_expand_input == _ExpandInputRef( "list-of-dicts", @@ -3136,7 +3136,7 @@ def test_handle_v1_serdag(): "test_role": { "__type": "dict", "__var": { - "DAGs": { + "Dags": { "__type": "set", "__var": [permissions.ACTION_CAN_READ, permissions.ACTION_CAN_EDIT], } @@ -3454,7 +3454,7 @@ def test_task_callback_properties_exist(): ], ) def test_task_callback_backward_compatibility(old_callback_name, new_callback_name): - """Test that old serialized DAGs with on_*_callback keys are correctly converted to has_on_*_callback.""" + """Test that old serialized Dags with on_*_callback keys are correctly converted to has_on_*_callback.""" old_serialized_task = { "is_setup": False, diff --git a/airflow-core/tests/unit/serialization/test_serialized_objects.py b/airflow-core/tests/unit/serialization/test_serialized_objects.py index 6b6fa9a52602e..575594915bb0d 100644 --- a/airflow-core/tests/unit/serialization/test_serialized_objects.py +++ b/airflow-core/tests/unit/serialization/test_serialized_objects.py @@ -662,7 +662,7 @@ def test_get_task_assets(): def test_lazy_dag_run_interval_wrong_dag(): lazy = LazyDeserializedDAG(data={"dag": {"dag_id": "dag1"}}) - with pytest.raises(ValueError, match="different DAGs"): + with pytest.raises(ValueError, match="different Dags"): lazy.get_run_data_interval(DAG_RUN) diff --git a/airflow-core/tests/unit/timetables/test_assets_timetable.py b/airflow-core/tests/unit/timetables/test_assets_timetable.py index 8386f26338ff5..2630472901dab 100644 --- a/airflow-core/tests/unit/timetables/test_assets_timetable.py +++ b/airflow-core/tests/unit/timetables/test_assets_timetable.py @@ -287,7 +287,7 @@ def test_asset_dag_run_queue_processing(self, session, dag_maker, create_test_as session.add(AssetDagRunQueue(asset_id=am.id, target_dag_id=dag.dag_id)) session.commit() - # Fetch and evaluate asset triggers for all DAGs affected by asset events + # Fetch and evaluate asset triggers for all Dags affected by asset events records = session.scalars(select(AssetDagRunQueue)).all() dag_statuses = defaultdict(lambda: defaultdict(bool)) for record in records: diff --git a/airflow-ctl/src/airflowctl/api/datamodels/generated.py b/airflow-ctl/src/airflowctl/api/datamodels/generated.py index 1fe8689c3c889..884761a55517c 100644 --- a/airflow-ctl/src/airflowctl/api/datamodels/generated.py +++ b/airflow-ctl/src/airflowctl/api/datamodels/generated.py @@ -255,7 +255,7 @@ class DAGPatchBody(BaseModel): class DAGRunClearBody(BaseModel): """ - DAG Run serializer for clear endpoint body. + Dag Run serializer for clear endpoint body. """ model_config = ConfigDict( @@ -274,7 +274,7 @@ class DAGRunClearBody(BaseModel): class DAGRunPatchStates(str, Enum): """ - Enum for DAG Run states when updating a DAG Run. + Enum for Dag Run states when updating a Dag Run. """ QUEUED = "queued" @@ -284,7 +284,7 @@ class DAGRunPatchStates(str, Enum): class DAGSourceResponse(BaseModel): """ - DAG Source serializer for responses. + Dag Source serializer for responses. """ content: Annotated[str | None, Field(title="Content")] = None @@ -295,7 +295,7 @@ class DAGSourceResponse(BaseModel): class DAGTagCollectionResponse(BaseModel): """ - DAG Tags Collection serializer for responses. + Dag Tags Collection serializer for responses. """ tags: Annotated[list[str], Field(title="Tags")] @@ -374,7 +374,7 @@ class DagRunType(str, Enum): class DagScheduleAssetReference(BaseModel): """ - DAG schedule reference serializer for assets. + Dag schedule reference serializer for assets. """ model_config = ConfigDict( @@ -396,7 +396,7 @@ class DagStatsStateResponse(BaseModel): class DagTagResponse(BaseModel): """ - DAG Tag serializer for responses. + Dag Tag serializer for responses. """ name: Annotated[str, Field(title="Name")] @@ -421,7 +421,7 @@ class DagVersionResponse(BaseModel): class DagWarningType(str, Enum): """ - Enum for DAG warning types. + Enum for Dag warning types. This is the set of allowable values for the ``warning_type`` field in the DagWarning model. @@ -845,7 +845,7 @@ class TimeDelta(BaseModel): class TriggerDAGRunPostBody(BaseModel): """ - Trigger DAG Run Serializer for POST body. + Trigger Dag Run Serializer for POST body. """ model_config = ConfigDict( @@ -1218,7 +1218,7 @@ class ConnectionCollectionResponse(BaseModel): class DAGDetailsResponse(BaseModel): """ - Specific serializer for DAG Details responses. + Specific serializer for Dag Details responses. """ dag_id: Annotated[str, Field(title="Dag Id")] @@ -1278,7 +1278,7 @@ class DAGDetailsResponse(BaseModel): class DAGResponse(BaseModel): """ - DAG serializer for responses. + Dag serializer for responses. """ dag_id: Annotated[str, Field(title="Dag Id")] @@ -1314,7 +1314,7 @@ class DAGResponse(BaseModel): class DAGRunPatchBody(BaseModel): """ - DAG Run Serializer for PATCH requests. + Dag Run Serializer for PATCH requests. """ model_config = ConfigDict( @@ -1326,7 +1326,7 @@ class DAGRunPatchBody(BaseModel): class DAGRunResponse(BaseModel): """ - DAG Run serializer for responses. + Dag Run serializer for responses. """ dag_run_id: Annotated[str, Field(title="Dag Run Id")] @@ -1353,7 +1353,7 @@ class DAGRunResponse(BaseModel): class DAGRunsBatchBody(BaseModel): """ - List DAG Runs body for batch endpoint. + List Dag Runs body for batch endpoint. """ model_config = ConfigDict( @@ -1384,7 +1384,7 @@ class DAGRunsBatchBody(BaseModel): class DAGVersionCollectionResponse(BaseModel): """ - DAG Version Collection serializer for responses. + Dag Version Collection serializer for responses. """ dag_versions: Annotated[list[DagVersionResponse], Field(title="Dag Versions")] @@ -1393,7 +1393,7 @@ class DAGVersionCollectionResponse(BaseModel): class DAGWarningResponse(BaseModel): """ - DAG Warning serializer for responses. + Dag Warning serializer for responses. """ dag_id: Annotated[str, Field(title="Dag Id")] @@ -1405,7 +1405,7 @@ class DAGWarningResponse(BaseModel): class DagStatsResponse(BaseModel): """ - DAG Stats serializer for responses. + Dag Stats serializer for responses. """ dag_id: Annotated[str, Field(title="Dag Id")] @@ -1779,7 +1779,7 @@ class BulkDeleteActionVariableBody(BaseModel): class DAGCollectionResponse(BaseModel): """ - DAG Collection serializer for responses. + Dag Collection serializer for responses. """ dags: Annotated[list[DAGResponse], Field(title="Dags")] @@ -1788,7 +1788,7 @@ class DAGCollectionResponse(BaseModel): class DAGRunCollectionResponse(BaseModel): """ - DAG Run Collection serializer for responses. + Dag Run Collection serializer for responses. """ dag_runs: Annotated[list[DAGRunResponse], Field(title="Dag Runs")] @@ -1797,7 +1797,7 @@ class DAGRunCollectionResponse(BaseModel): class DAGWarningCollectionResponse(BaseModel): """ - DAG warning collection serializer for responses. + Dag warning collection serializer for responses. """ dag_warnings: Annotated[list[DAGWarningResponse], Field(title="Dag Warnings")] @@ -1806,7 +1806,7 @@ class DAGWarningCollectionResponse(BaseModel): class DagStatsCollectionResponse(BaseModel): """ - DAG Stats Collection serializer for responses. + Dag Stats Collection serializer for responses. """ dags: Annotated[list[DagStatsResponse], Field(title="Dags")] diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_bash_operator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_bash_operator.py index a4fb3161ab67d..3dc305c0805cf 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_bash_operator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_bash_operator.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the BashOperator.""" +"""Example Dag demonstrating the usage of the BashOperator.""" from __future__ import annotations diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_datetime_operator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_datetime_operator.py index 710bdb1de898c..d60f0fcc8b9b8 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_datetime_operator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_datetime_operator.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating the usage of DateTimeBranchOperator with datetime as well as time objects as +Example Dag demonstrating the usage of DateTimeBranchOperator with datetime as well as time objects as targets. """ diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_day_of_week_operator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_day_of_week_operator.py index 43400522468f7..120b08c94725b 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_day_of_week_operator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_day_of_week_operator.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating the usage of BranchDayOfWeekOperator. +Example Dag demonstrating the usage of BranchDayOfWeekOperator. """ from __future__ import annotations diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator.py index c3cf4856ba565..5e52cc56bbd05 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the Classic branching Python operators. +"""Example Dag demonstrating the usage of the Classic branching Python operators. It is showcasing the basic BranchPythonOperator and its sisters BranchExternalPythonOperator and BranchPythonVirtualenvOperator.""" diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator_decorator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator_decorator.py index 2419138aa9514..850f0b04f838d 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator_decorator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_branch_operator_decorator.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the branching TaskFlow API decorators. +"""Example Dag demonstrating the usage of the branching TaskFlow API decorators. It shows how to use standard Python ``@task.branch`` as well as the external Python version ``@task.branch_external_python`` which calls an external Python interpreter and diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_external_task_marker_dag.py b/providers/standard/src/airflow/providers/standard/example_dags/example_external_task_marker_dag.py index b8fad182549f1..ba2914da7c887 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_external_task_marker_dag.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_external_task_marker_dag.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating setting up inter-DAG dependencies using ExternalTaskSensor and +Example Dag demonstrating setting up inter-Dag dependencies using ExternalTaskSensor and ExternalTaskMarker. In this example, child_task1 in example_external_task_marker_child depends on parent_task in diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_python_decorator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_python_decorator.py index ac9938d92eac2..be0977d39af61 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_python_decorator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_python_decorator.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating the usage of the TaskFlow API to execute Python functions natively and within a +Example Dag demonstrating the usage of the TaskFlow API to execute Python functions natively and within a virtual environment. """ @@ -66,7 +66,7 @@ def log_sql(**kwargs): # Generate 5 sleeping tasks, sleeping from 0.0 to 0.4 seconds respectively @task def my_sleeping_function(random_base): - """This is a function that will run within the DAG execution""" + """This is a function that will run within the Dag execution""" time.sleep(random_base) for i in range(5): diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py index 18aa8f207e3b0..0f004b57e293f 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. """ -Example DAG demonstrating the usage of the classic Python operators to execute Python functions natively and +Example Dag demonstrating the usage of the classic Python operators to execute Python functions natively and within a virtual environment. """ @@ -77,7 +77,7 @@ def log_sql(**kwargs): # [START howto_operator_python_kwargs] # Generate 5 sleeping tasks, sleeping from 0.0 to 0.4 seconds respectively def my_sleeping_function(random_base): - """This is a function that will run within the DAG execution""" + """This is a function that will run within the Dag execution""" time.sleep(random_base) for i in range(5): diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_sensor_decorator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_sensor_decorator.py index 64ea80400ceb8..63401ccafc9d2 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_sensor_decorator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_sensor_decorator.py @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the sensor decorator.""" +"""Example Dag demonstrating the usage of the sensor decorator.""" from __future__ import annotations diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_decorator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_decorator.py index 4bb248fb94ce0..2ed6855957f86 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_decorator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_decorator.py @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the `@task.short_circuit()` TaskFlow decorator.""" +"""Example Dag demonstrating the usage of the `@task.short_circuit()` TaskFlow decorator.""" from __future__ import annotations diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_operator.py b/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_operator.py index b054d9ec6dd51..2d40b21180c01 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_operator.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_short_circuit_operator.py @@ -15,7 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -"""Example DAG demonstrating the usage of the ShortCircuitOperator.""" +"""Example Dag demonstrating the usage of the ShortCircuitOperator.""" from __future__ import annotations diff --git a/providers/standard/src/airflow/providers/standard/example_dags/example_trigger_controller_dag.py b/providers/standard/src/airflow/providers/standard/example_dags/example_trigger_controller_dag.py index 8ca49e34b3dcd..601fb91ef3c2b 100644 --- a/providers/standard/src/airflow/providers/standard/example_dags/example_trigger_controller_dag.py +++ b/providers/standard/src/airflow/providers/standard/example_dags/example_trigger_controller_dag.py @@ -16,9 +16,9 @@ # specific language governing permissions and limitations # under the License. """ -Example usage of the TriggerDagRunOperator. This example holds 2 DAGs: -1. 1st DAG (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG -2. 2nd DAG (example_trigger_target_dag) which will be triggered by the TriggerDagRunOperator in the 1st DAG +Example usage of the TriggerDagRunOperator. This example holds 2 Dags: +1. 1st Dag (example_trigger_controller_dag) holds a TriggerDagRunOperator, which will trigger the 2nd DAG +2. 2nd Dag (example_trigger_target_dag) which will be triggered by the TriggerDagRunOperator in the 1st DAG """ from __future__ import annotations @@ -39,7 +39,7 @@ trigger = TriggerDagRunOperator( task_id="test_trigger_dagrun", - trigger_dag_id="example_trigger_target_dag", # Ensure this equals the dag_id of the DAG to trigger + trigger_dag_id="example_trigger_target_dag", # Ensure this equals the dag_id of the Dag to trigger conf={"message": "Hello World"}, ) diff --git a/task-sdk/src/airflow/sdk/api/datamodels/_generated.py b/task-sdk/src/airflow/sdk/api/datamodels/_generated.py index 3eb44c2f06f12..21a1502185542 100644 --- a/task-sdk/src/airflow/sdk/api/datamodels/_generated.py +++ b/task-sdk/src/airflow/sdk/api/datamodels/_generated.py @@ -137,7 +137,7 @@ class DagRunState(str, Enum): class DagRunStateResponse(BaseModel): """ - Schema for DAG Run State response. + Schema for Dag Run State response. """ state: DagRunState @@ -341,7 +341,7 @@ class TerminalStateNonSuccess(str, Enum): class TriggerDAGRunPayload(BaseModel): """ - Schema for Trigger DAG Run API request. + Schema for Trigger Dag Run API request. """ model_config = ConfigDict(