You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/15 09:33:03 UTC

[GitHub] [airflow] uranusjr commented on issue #23020: Names for expanded tasks

uranusjr commented on issue #23020:
URL: https://github.com/apache/airflow/issues/23020#issuecomment-1099997002

   We could use a heuristic similar to pytest. I’m not sure what their exact logic is, but it seems to be something like if the mapped value is simple (int, float, or a short-ish str), use `str()` to convert it directly, otherwise use something like `arg1` (we could use `[0]`, `[1]` etc.).
   
   Some things I can think of now:
   
   1. Calculating the label may be expensive since this requires the view to re-pull upstream XCom. We may need to do this eagerly when the task instance is being executed, which means adding a new field on TaskInstance to store this for later use.
   2. The logic becomes difficult when we eventually add functional tools to task mapping e.g. `produce`, `zip` etc. 
   3. Pytest allows using `id` to supply custom IDs when the auto-generated label is not good enough (but you don’t want the non-descriptive `arg1`). We can’t do this since the indexes are dynamically calculated, but maybe an argument on BaseOperator to let the user provide a string template for this would be useful.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org