FrankYang0529 commented on code in PR #69915:
URL: https://github.com/apache/airflow/pull/69915#discussion_r3630364858
##########
airflow-ctl/src/airflowctl/ctl/commands/dag_command.py:
##########
@@ -108,53 +108,61 @@ def next_execution(args, api_client=NEW_API_CLIENT) ->
dict | None:
return result
-def _parse_logical_date(value: str) -> datetime.datetime | None:
- """Parse an ISO-formatted logical date."""
+def _get_dag_run_by_run_id(api_client, dag_id: str, run_id: str) ->
DAGRunResponse:
+ """Get a Dag run by its run ID."""
+ try:
+ return api_client.dag_runs.get(dag_id=dag_id, dag_run_id=run_id,
suppress_error_log=True)
+ except ServerResponseError as e:
+ if e.response.status_code != 404:
+ raise
+ rich.print(f"[red]Dag run {run_id!r} of Dag {dag_id!r} not found[/red]")
+ sys.exit(1)
Review Comment:
Updated it. Thanks.
--
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]