amoghrajesh commented on code in PR #52693:
URL: https://github.com/apache/airflow/pull/52693#discussion_r2179502122
##########
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:
Had similar thoughts earlier, and the reason i didn't do that is:
> I have not added the fix to Trigger._decrypt_kwargs because that is used
in here
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/trigger.py#L121-L124
due to which there could be issues in add_asset_trigger_references while
writing to DB due to no triggers being found due to different hashes.
Mentioned in PR title too
--
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]