gopidesupavan commented on code in PR #48949:
URL: https://github.com/apache/airflow/pull/48949#discussion_r2039012933


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -376,46 +377,49 @@ def _handle_request(self, msg: ToTriggerSupervisor, log: 
FilteringBoundLogger) -
                 workload = self.creating_triggers.popleft()
                 response.to_create.append(workload)
             self.running_triggers.update(m.id for m in response.to_create)
-            resp = response.model_dump_json().encode()
+            resp = response
 
         elif isinstance(msg, GetConnection):
             conn = self.client.connections.get(msg.conn_id)
             if isinstance(conn, ConnectionResponse):
                 conn_result = ConnectionResult.from_conn_response(conn)
-                resp = conn_result.model_dump_json(exclude_unset=True, 
by_alias=True).encode()
+                resp = conn_result
+                dump_opts = {"exclude_unset": True}
             else:
-                resp = conn.model_dump_json().encode()
+                resp = conn
         elif isinstance(msg, GetVariable):
             var = self.client.variables.get(msg.key)
             if isinstance(var, VariableResponse):
                 var_result = VariableResult.from_variable_response(var)
-                resp = var_result.model_dump_json(exclude_unset=True).encode()
+                resp = var_result
+                dump_opts = {"exclude_unset": True}
             else:
-                resp = var.model_dump_json().encode()
+                resp = var
         elif isinstance(msg, GetXCom):
             xcom = self.client.xcoms.get(msg.dag_id, msg.run_id, msg.task_id, 
msg.key, msg.map_index)
             if isinstance(xcom, XComResponse):
                 xcom_result = XComResult.from_xcom_response(xcom)
-                resp = xcom_result.model_dump_json(exclude_unset=True).encode()
+                resp = xcom_result
+                dump_opts = {"exclude_unset": True}
             else:
-                resp = xcom.model_dump_json().encode()
+                resp = xcom
         elif isinstance(msg, GetDRCount):
             dr_count = self.client.dag_runs.get_count(
                 dag_id=msg.dag_id,
                 logical_dates=msg.logical_dates,
                 run_ids=msg.run_ids,
                 states=msg.states,
             )
-            resp = dr_count.model_dump_json().encode()
+            resp = dr_count
         elif isinstance(msg, GetDagRunState):
             dr_resp = self.client.dag_runs.get_state(msg.dag_id, msg.run_id)
-            resp = 
DagRunStateResult.from_api_response(dr_resp).model_dump_json().encode()

Review Comment:
   Looks like this removal caused the failure. we can keep `resp = 
DagRunStateResult.from_api_response(dr_resp)`



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