ashb commented on code in PR #57952:
URL: https://github.com/apache/airflow/pull/57952#discussion_r2532194166


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -1414,7 +1415,15 @@ def _run_task(
                 trigger = import_string(msg.classpath)(**msg.trigger_kwargs)
                 event = _run_inline_trigger(trigger, task_sdk_ti)
                 ti.next_method = msg.next_method
-                ti.next_kwargs = {"event": event.payload} if event else 
msg.next_kwargs
+
+                # Deserialize next_kwargs if it's a string (encrypted dict), 
similar to what the API server does
+                next_kwargs_value = {"event": event.payload} if event else 
msg.next_kwargs
+                if isinstance(next_kwargs_value, str):
+                    from airflow.serialization.serialized_objects import 
BaseSerialization
+
+                    ti.next_kwargs = 
BaseSerialization.deserialize(next_kwargs_value)
+                else:
+                    ti.next_kwargs = next_kwargs_value

Review Comment:
   That's because the type on the model is wrong then: 
`SQLCoreOperations[dict[Any, Any] | None]` should be `dict[str,Any]`, not 
`dict[Any, Any]`



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