potiuk commented on code in PR #30432:
URL: https://github.com/apache/airflow/pull/30432#discussion_r1155350167
##########
airflow/cli/commands/dag_command.py:
##########
@@ -343,6 +344,24 @@ def dag_list_dags(args):
)
+@cli_utils.action_cli
+@suppress_logs_and_warning
+@provide_session
+def dag_details(args, session=NEW_SESSION):
+ """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")
+ dag_detail = dag_schema.dump(dag)
+ for key, value in dag_detail.items():
+ if isinstance(value, dict):
+ print(f"\t{key}:")
+ for subkey, subvalue in value.items():
+ print(f"\t\t{subkey}: {subvalue}")
+ else:
+ print(f"\t{key}: {value}")
Review Comment:
Convert attributes of the dag_detail object into rows simply.
--
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]