potiuk commented on code in PR #30432:
URL: https://github.com/apache/airflow/pull/30432#discussion_r1155344475
##########
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:
Yes. Transposed. No we do not need to have special type. We are free to
output it in the form that will be readable. Table format is for human to look
at, so having it laid out in the way that will be easier for human just makes
sense as the only way of outputting it in --table form.
--
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]