Skip to content

UI: Filter task instances by rendered map index#66008

Open
pierrejeambrun wants to merge 3 commits into
apache:mainfrom
astronomer:feature/search-rendered-map-index
Open

UI: Filter task instances by rendered map index#66008
pierrejeambrun wants to merge 3 commits into
apache:mainfrom
astronomer:feature/search-rendered-map-index

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun commented Apr 28, 2026

Summary

Closes #51820.

Adds a rendered_map_index exact-match filter (list-of-strings, ANY_EQUAL) to the public listMapped and listTaskInstances endpoints, mirroring the existing map_index filter, and surfaces it in the Task Instances filter bar in the UI. Users can now find a dynamically mapped task by the named mapping that's already shown in the column — no more "search by what you see" gap.

Test plan

  • Unit tests pass (pytest test_task_instances.py -k rendered_map_index_filter)
  • TypeScript + ESLint clean
  • Manually verified in breeze with the customer-reported curl: ?rendered_map_index=1 now returns the row whose _rendered_map_index is NULL.
Screen.Recording.2026-04-30.at.16.02.11.mov

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

],
)
@conf_vars({("api", "maximum_page_limit"): "110"})
def test_rendered_map_index_order(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore. WIth the hybrid expression part, now defaults to 'map_index' if null. Won't be null for mapped indexes, this test isn't relevant. (testing null ordering, but the field isn't null anymore) Can remain null for non mapped TI

@pierrejeambrun pierrejeambrun force-pushed the feature/search-rendered-map-index branch from fbc83c1 to 7c5350e Compare April 28, 2026 14:32
@pierrejeambrun pierrejeambrun added this to the Airflow 3.2.2 milestone Apr 29, 2026
@bbovenzi bbovenzi added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label Apr 29, 2026
@bbovenzi
Copy link
Copy Markdown
Contributor

Rendered Map Index seems to be searching by the index number but not the rendered string.

Screenshot 2026-04-29 at 12 29 23 PM Screenshot 2026-04-29 at 12 29 28 PM

@pierrejeambrun
Copy link
Copy Markdown
Member Author

pierrejeambrun commented Apr 30, 2026

Similarly to the 'map_index' this is an exact filter, not a search.

But since it's a string it probably makes more sense. Let me update that, it was my first draft but moved away from it for consistency.

@pierrejeambrun pierrejeambrun force-pushed the feature/search-rendered-map-index branch from 7c5350e to d00d73b Compare April 30, 2026 13:58
@bbovenzi
Copy link
Copy Markdown
Contributor

bbovenzi commented May 4, 2026

Merge conflicts and MySQL test failure

@vatsrahul1001
Copy link
Copy Markdown
Contributor

@pierrejeambrun can you resolve conflicts and look into failing test?

@bbovenzi bbovenzi force-pushed the feature/search-rendered-map-index branch from d00d73b to 232d27c Compare May 12, 2026 19:02
pierrejeambrun and others added 3 commits May 13, 2026 10:45
Adds 'rendered_map_index_pattern' (substring match) and 'rendered_map_index_prefix_pattern' (index-friendly prefix match) query parameters to the public listMapped and listTaskInstances endpoints, mirroring the existing 'operator_name', 'pool_name', etc. pattern/prefix-pattern pairs. The UI surfaces this as a search input in the TaskInstances filter bar — prefix search by default, with an 'advanced search' toggle to switch to substring match.

The TaskInstance.rendered_map_index hybrid_property now has a SQL-level .expression so queries see the same value as the API response: the explicit _rendered_map_index when set, otherwise str(map_index). Without this, filtering on rendered map index silently dropped rows whose _rendered_map_index column is NULL but whose displayed value is the numeric map index.

Closes apache#51820.
@bbovenzi bbovenzi force-pushed the feature/search-rendered-map-index branch from 63cd8d5 to da85d11 Compare May 13, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:translations area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search/filter mapped tasks by named mapping

3 participants