namanjain24-sudo commented on PR #75179:
URL: https://github.com/apache/airflow/pull/75179#issuecomment-6375242941

   Heads up — I think this one misses the case the issue reports, and I only 
noticed because I'd opened #75431 against the same issue before spotting yours.
   
   The repro in #75172 puts the `TriggerDagRunOperator` inside an expanded task 
group. That child task is a plain operator, not a `MappedOperator`, and it has 
no `partial_kwargs` at all — the mapped value arrives on the attribute itself:
   
   ```
   task_id: g.trigger
     type              : TriggerDagRunOperator
     is MappedOperator : False
     trigger_dag_id    : MappedArgument(...)
     partial_kwargs    : None
   ```
   
   So the `elif isinstance(task, MappedOperator) and ... "trigger_dag_id" in 
task.partial_kwargs` branch this guards is never reached for that Dag; it goes 
through the earlier `isinstance(task, TriggerDagRunOperator)` branch, which 
still does `target=getattr(task, "trigger_dag_id")`.
   
   I applied this branch to current `main` and re-ran the issue's Dag to check 
rather than guess, plus the
   `ExternalTaskSensor` equivalent, which has the same shape on 
`external_dag_id`:
   
   ```
   With #75179 applied to current main:
     trigger: FAILS -> SerializationError: Failed to serialize DAG 'd_trigger': 
unhashable type: 'MappedArgument'
     sensor:  FAILS -> SerializationError: Failed to serialize DAG 'd_sensor': 
unhashable type: 'MappedArgument'
   ```
   
   So there are four branches that need the guard rather than one: 
`TriggerDagRunOperator` and
   `ExternalTaskSensor`, each reachable directly and through `partial_kwargs`.
   
   Happy either way on how this lands — if you want to extend this PR to cover 
the other branches I'm glad to close mine, or feel free to take whatever is 
useful from #75431.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @namanjain24-sudo before 
posting
   


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