uranusjr commented on code in PR #54383:
URL: https://github.com/apache/airflow/pull/54383#discussion_r2300099728
##########
airflow-core/src/airflow/cli/commands/task_command.py:
##########
@@ -429,25 +431,38 @@ def task_test(args, dag: DAG | None = None) -> None:
def task_render(args, dag: DAG | None = None) -> None:
"""Render and displays templated fields for a given task."""
if not dag:
- dag = get_dag(args.bundle_name, args.dag_id)
- # TODO (GH-52141): get_task in scheduler needs to return scheduler types
- # instead, but currently it inherits SDK's DAG.
- task = cast("Operator", dag.get_task(task_id=args.task_id))
+ dag = get_bagged_dag(args.bundle_name, args.dag_id)
+ serialized_dag =
SerializedDAG.deserialize_dag(SerializedDAG.serialize_dag(dag))
Review Comment:
I created one for tests, but this pattern is not (should not be) used often
in core since `serialize_dag` should happen in the dag processor instead. Only
the CLI would have this pattern because the CLI is a mess, but we should also
try to eliminate most (of not all) of them eventually.
--
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]