uranusjr commented on code in PR #28021: URL: https://github.com/apache/airflow/pull/28021#discussion_r1036754973
########## docs/apache-airflow/concepts/dags.rst: ########## @@ -796,39 +796,32 @@ the dependency graph. The dependency detector is configurable, so you can implement your own logic different than the defaults in :class:`~airflow.serialization.serialized_objects.DependencyDetector` -DAG pausing, deactivation and deletion +Unschedule or Delete a DAG -------------------------------------- -The DAGs have several states when it comes to being "not running". DAGs can be paused, deactivated -and finally all metadata for the DAG can be deleted. +There are several ways to prevent a dag from running. DAGs can be paused, deactivated, or deleted. Review Comment: ```suggestion A DAG can be prevented from running by either being paused, deactivated, or deleted. ``` ########## docs/apache-airflow/concepts/dags.rst: ########## @@ -796,39 +796,32 @@ the dependency graph. The dependency detector is configurable, so you can implement your own logic different than the defaults in :class:`~airflow.serialization.serialized_objects.DependencyDetector` -DAG pausing, deactivation and deletion +Unschedule or Delete a DAG -------------------------------------- -The DAGs have several states when it comes to being "not running". DAGs can be paused, deactivated -and finally all metadata for the DAG can be deleted. +There are several ways to prevent a dag from running. DAGs can be paused, deactivated, or deleted. -Dag can be paused via UI when it is present in the ``DAGS_FOLDER``, and scheduler stored it in -the database, but the user chose to disable it via the UI. The "pause" and "unpause" actions are available -via UI and API. Paused DAG is not scheduled by the Scheduler, but you can trigger them via UI for -manual runs. In the UI, you can see Paused DAGs (in ``Paused`` tab). The DAGs that are un-paused +A DAG can be paused, which prevents scheduled runs. The Scheduler will not schedule a paused DAG, +but you can trigger it manually via the UI. The "pause" and "unpause" actions are available +via the UI and the API. In the UI, you can see Paused DAGs in the ``Paused`` tab. DAGs that are un-paused Review Comment: ```suggestion via the UI and the API. In the UI, you can see Paused DAGs in the ``Paused`` tab. DAGs that are unpaused ``` ########## docs/apache-airflow/concepts/dags.rst: ########## @@ -796,39 +796,32 @@ the dependency graph. The dependency detector is configurable, so you can implement your own logic different than the defaults in :class:`~airflow.serialization.serialized_objects.DependencyDetector` -DAG pausing, deactivation and deletion +Unschedule or Delete a DAG -------------------------------------- -The DAGs have several states when it comes to being "not running". DAGs can be paused, deactivated -and finally all metadata for the DAG can be deleted. +There are several ways to prevent a dag from running. DAGs can be paused, deactivated, or deleted. -Dag can be paused via UI when it is present in the ``DAGS_FOLDER``, and scheduler stored it in -the database, but the user chose to disable it via the UI. The "pause" and "unpause" actions are available -via UI and API. Paused DAG is not scheduled by the Scheduler, but you can trigger them via UI for -manual runs. In the UI, you can see Paused DAGs (in ``Paused`` tab). The DAGs that are un-paused +A DAG can be paused, which prevents scheduled runs. The Scheduler will not schedule a paused DAG, +but you can trigger it manually via the UI. The "pause" and "unpause" actions are available +via the UI and the API. In the UI, you can see Paused DAGs in the ``Paused`` tab. DAGs that are un-paused can be found in the ``Active`` tab. -Dag can be deactivated (do not confuse it with ``Active`` tag in the UI) by removing them from the -``DAGS_FOLDER``. When scheduler parses the ``DAGS_FOLDER`` and misses the DAG that it had seen -before and stored in the database it will set is as deactivated. The metadata and history of the -DAG` is kept for deactivated DAGs and when the DAG is re-added to the ``DAGS_FOLDER`` it will be again -activated and history will be visible. You cannot activate/deactivate DAG via UI or API, this -can only be done by removing files from the ``DAGS_FOLDER``. Once again - no data for historical runs of the -DAG are lost when it is deactivated by the scheduler. Note that the ``Active`` tab in Airflow UI -refers to DAGs that are not both ``Activated`` and ``Not paused`` so this might initially be a -little confusing. - -You can't see the deactivated DAGs in the UI - you can sometimes see the historical runs, but when you try to -see the information about those you will see the error that the DAG is missing. - -You can also delete the DAG metadata from the metadata database using UI or API, but it does not -always result in disappearing of the DAG from the UI - which might be also initially a bit confusing. -If the DAG is still in ``DAGS_FOLDER`` when you delete the metadata, the DAG will re-appear as -Scheduler will parse the folder, only historical runs information for the DAG will be removed. - -This all means that if you want to actually delete a DAG and its all historical metadata, you need to do -it in three steps: - -* pause the DAG -* delete the historical metadata from the database, via UI or API -* delete the DAG file from the ``DAGS_FOLDER`` and wait until it becomes inactive +A DAG can also be deactivated. A deactivated DAG will not run, cannot be triggered, and won't show up in the UI but its metadata +and history persists in the database. If a DAG is reactivated all of its history and metadata will be present. Review Comment: ```suggestion A DAG can also be deactivated. A deactivated DAG will not be scheduled, cannot be triggered, and won't show up in the UI, but its metadata and history are still persisted in the database. All of the DAG's history and metadata will still be present when it is reactivated. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
