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


##########
task-sdk/src/airflow/sdk/definitions/dag.py:
##########
@@ -1429,17 +1429,22 @@ def _run_task(
             ti.task = create_scheduler_operator(taskrun_result.ti.task)
 
             if ti.state == TaskInstanceState.DEFERRED and isinstance(msg, 
DeferTask) and run_triggerer:
+                from airflow.sdk.serde import deserialize, serialize
                 from airflow.utils.session import create_session
 
                 # API Server expects the task instance to be in QUEUED state 
before
                 # resuming from deferral.
                 ti.set_state(TaskInstanceState.QUEUED)
 
                 log.info("[DAG TEST] running trigger in line")
-                trigger = import_string(msg.classpath)(**msg.trigger_kwargs)
+                # trigger_kwargs need to be deserialized before passing to the 
trigger class since they are in serde encoded format
+                kwargs = deserialize(msg.trigger_kwargs)  # type: 
ignore[type-var]  # needed to convince mypy that trigger_kwargs is a dict or a 
str because its unable to infer JsonValue

Review Comment:
   What’s the error if this ignore isn’t added?



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