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


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -870,8 +870,16 @@ async def create_triggers(self):
             await asyncio.sleep(0)
 
             try:
-                kwargs = Trigger._decrypt_kwargs(workload.encrypted_kwargs)
-                trigger_instance = trigger_class(**kwargs)
+                from airflow.serialization.serialized_objects import 
smart_decode_trigger_kwargs
+
+                # Decrypt and clean trigger kwargs before for execution
+                # Note: We only clean up serialization artifacts (__var, 
__type keys) here,
+                # not in `_decrypt_kwargs` because it is used during hash 
comparison in
+                # add_asset_trigger_references and could lead to adverse 
effects like hash mismatches
+                # that could cause None values in collections.
+                kw = Trigger._decrypt_kwargs(workload.encrypted_kwargs)
+                deserialised_kwargs = {k: smart_decode_trigger_kwargs(v) for 
k, v in kw.items()}

Review Comment:
   We should probably fix the docstring of `smart_decode_trigger_kwargs` in 
this case since it’s no longer just used for UI.



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