uranusjr commented on code in PR #54383:
URL: https://github.com/apache/airflow/pull/54383#discussion_r2300103565


##########
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))
     ti, _ = _get_ti(
-        task, args.map_index, 
logical_date_or_run_id=args.logical_date_or_run_id, create_if_necessary="memory"
+        # TODO (GH-52141): get_task in scheduler needs to return scheduler 
types
+        # instead, but currently it inherits SDK's DAG.
+        cast("Operator", serialized_dag.get_task(task_id=args.task_id)),

Review Comment:
   Yes. SerializedDAG should always return SerializedBaseOperator or 
models.MappedOperator (should be renamed SerializedMappedOperator at some 
point), and sdk.DAG always returns BaseOperator or (SDK) MappedOperator.



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