yuseok89 commented on code in PR #68650:
URL: https://github.com/apache/airflow/pull/68650#discussion_r3432205569


##########
airflow-core/src/airflow/cli/commands/dag_command.py:
##########
@@ -236,32 +237,43 @@ def _bulk_clear_runs(
 
 
 @cli_utils.action_cli
+@deprecated_for_airflowctl("airflowctl dags pause")
 @providers_configuration_loaded
 def dag_pause(args) -> None:
     """Pauses a DAG."""
     set_is_paused(True, args)
 
 
 @cli_utils.action_cli
+@deprecated_for_airflowctl("airflowctl dags unpause")
 @providers_configuration_loaded
 def dag_unpause(args) -> None:
     """Unpauses a DAG."""
     set_is_paused(False, args)
 
 
 @providers_configuration_loaded
-@provide_session
-def set_is_paused(is_paused: bool, args, *, session: Session = NEW_SESSION) -> 
None:
-    """Set is_paused for DAG by a given dag_id."""
-    query = select(DagModel)
+@provide_api_client
+def set_is_paused(is_paused: bool, args, api_client: Client = NEW_API_CLIENT) 
-> None:
+    """Set is_paused for DAG by a given dag_id through the API server."""

Review Comment:
   Thanks @bugraoz93!
   Both CLIs now share `set_dag_paused_state` in `ctl/commands/dag_command.py`.



-- 
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]

Reply via email to