flyte icon indicating copy to clipboard operation
flyte copied to clipboard

[v2] `flyte.map`: allow a per-item display name for spawned tasks

Open earlybard opened this issue 4 months ago • 3 comments

What

When mapping a task over N inputs, every spawned action shows in the UI under the same label — the task name (e.g. ingest_one) — so the N runs are visually indistinguishable. I'd like each action to carry a caller-supplied name derived from its input:

flyte.map(ingest_one, items, name_fn=lambda x: x.id)

Why

Over hundreds of tasks, there's no way to find "the action processing X" in the console, or tell at a glance which item a running/failed action corresponds to.

Proposed shape

  • A per-action display name, distinct from the action id and the task's registered name (so caching and task identity are unaffected).
  • Surfaced via a name_fn callable on flyte.map (and ideally a direct task call), applied per item, sanitized/truncated to whatever the label constraints require.

earlybard avatar Jul 22 '26 22:07 earlybard

It seems likely that Flyte's current flyte.map API does not support a per-item display name or a name_fn parameter for mapped actions. All spawned actions under a map operation share the same label (the task name), making it difficult to distinguish individual actions in the UI. There is no mention of a name_fn or similar feature in the documented flyte.map signature and parameters or related examples.

The data sources describe grouping mapped actions under a single label via the group_name parameter, but do not mention any mechanism for customizing the display name of each spawned action based on its input. Thus, your proposed feature is not currently available in Flyte as per the provided documentation.

Would you like more detail on how mapped actions are currently labeled or on possible workarounds?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @herald to ask follow-up questions. See runllm.com for more!

runllm avatar Jul 22 '26 22:07 runllm

Hi @earlybard! I'd love to work on this issue.

The proposed approach using a name_fn parameter on flyte.map makes a lot of sense. Since Flyte tasks already support overriding short_name via with_overrides(short_name=...), we can dynamically apply the resolved name per mapped item in _map.py without affecting task identity or caching.

Could you please assign this to me? I can open a PR with the implementation and tests.

muskan-creates352 avatar Oct 25 '26 06:10 muskan-creates352

I can't assign, but feel free to have a go mate!

earlybard avatar Nov 05 '26 04:11 earlybard