uranusjr commented on PR #36797:
URL: https://github.com/apache/airflow/pull/36797#issuecomment-1897873975

   I’m thinking the following flow:
   
   1. Define `map_index_template` on the operator (done)
   2. Instead of just forwarding the template to TaskInstance, we only store 
the _rendered_ result on it.
       * Say we call it `map_rendered_name` (bikeshedding welcomed)
       * We don’t really want to show the template anywhere anyway (it’s 
arguably worse than map_index without rendering since every mapped instance 
will have the exact same value).
       * When a task instance is created (not yet run), the field will be NULL 
in the database (trivial, all columns are nullable by default).
   4. In `_run_raw_task`, we render the value (like you already did), and store 
the result in `self.map_rendered_name`.
       * This will be flushed to the database when the function ends along with 
other states.
   5. Show the value in the web UI.
   
   We’ll also need a database migration for the new field on TaskInstance.
   
   Does this sound reasonable?


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