Skip to content

Allow accessing a TaskGroup's members via [] - #64430

Merged
Lee-W merged 1 commit into
apache:mainfrom
Dev-iL:2603/taskgroup_getitem
Apr 21, 2026
Merged

Allow accessing a TaskGroup's members via []#64430
Lee-W merged 1 commit into
apache:mainfrom
Dev-iL:2603/taskgroup_getitem

Conversation

@Dev-iL

Copy link
Copy Markdown
Collaborator

Minor feature (syntactic sugar): we can now do e.g. some_group["some_task"] to access the children of a task group regardless of the prefix_group_id setting.

Motivation: Discussion in AIR201's PR that made me aware that the shortest way to access child references is not that short - so I made it shorter and more natural (at least to me).


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@potiukpotiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but likely @uranusjr would be good to take a look

@Dev-iL
Dev-iL requested a review from uranusjrMarch 29, 2026 21:59
@eladkaleladkal added this to the Airflow 3.2.1 milestone Mar 29, 2026
@kaxil
kaxil requested a review from CopilotApril 2, 2026 00:42
CopilotAI reviewed Apr 2, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@eladkaleladkal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
cc @uranusjr as you are most familiar with this area

@Dev-iL

Copy link
Copy Markdown
CollaboratorAuthor

@uranusjr any objections?

@uranusjr

Copy link
Copy Markdown
Member

This makes me wonder if we should also define __getitem__ on DAG, but that’s a different topic I guess. Feel free to open a new conversation on this.

Comment threadtask-sdk/tests/task_sdk/definitions/test_taskgroup.py Outdated
@Dev-iL
Dev-iLforce-pushed the 2603/taskgroup_getitem branch from 789b3f7 to 172d8fdCompareApril 20, 2026 09:30
@Dev-iL
Dev-iLforce-pushed the 2603/taskgroup_getitem branch from 172d8fd to dae7e2bCompareApril 20, 2026 12:35
@Lee-W
Lee-W merged commit aa54031 into apache:mainApr 21, 2026
111 checks passed
@Dev-iL
Dev-iL deleted the 2603/taskgroup_getitem branch April 21, 2026 06:05
@Dev-iLDev-iL mentioned this pull request Apr 21, 2026
1 task
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

StatusBranchResult
v3-2-testPR Link

eladkal pushed a commit that referenced this pull request Apr 23, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 27, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
@Lee-WLee-W removed this from the Airflow 3.2.2 milestone Apr 28, 2026
@Lee-WLee-W added this to the Airflow 3.3.0 milestone Apr 28, 2026
Cloud-Architect-Emma pushed a commit to Cloud-Architect-Emma/airflow that referenced this pull request Apr 30, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 21, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 21, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 21, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 21, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request May 21, 2026
…65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
potiuk added a commit that referenced this pull request Jun 2, 2026
…ister non-default extras with a one-line change (#67130) (#67139)
* Fix OTel timer metrics using Gauge instead of Histogram (#64207) (#66865)
* Fix OTel timer metrics using Gauge instead of Histogram
* Use ExponentialBucketHistogramAggregation for timing metrics
* Use public API import path for ExponentialBucketHistogramAggregation and fix histogram map isolation
(cherry picked from commit b2dadd2)
Co-authored-by: namratachaudhary <namratachaudhary@users.noreply.github.com>
* Add name fields to SDK deadline alerts (#64926) (#65601)
* Add deadlines support with name and description fields in alerts and UI
* Add 'viewAll' label to deadlineStatus in dag.json
* Refactor deadlineAlerts referenceType structure
* Refine deadline alert translations in dag.json
Updated deadline alert messages for clarity and consistency.
* Add completion rule text for deadline alerts in UI
* Remove duplicate completionRule entry in deadlineAlerts
* Remove alert description from DeadlineAlert and related models
* Enhance deadline handling: return name updates alongside UUID mapping in SerializedDagModel
* Add alert_id field to DeadlineResponse and update tests for alert handling
* Remove DEADLINES option from MenuItem enum
* Update airflow-core/src/airflow/serialization/encoders.py
---------
(cherry picked from commit e9d1066)
Co-authored-by: Richard Wu <richard9@ualberta.ca>
Co-authored-by: D. Ferruzzi <ferruzzi@amazon.com>
* [v3-2-test] Allow accessing a TaskGroup's members via `[]` (#64430) (#65707)
(cherry picked from commit aa54031)
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
* [v3-2-test] Skip test_schedule_tis_start_trigger pending #55068 backport decision (#66315)
The `start_from_trigger` deferred-at-schedule path is commented out
on v3-2-test (disabled in 91e1029 as a TODO) and was only
re-enabled on main by #55068, which landed one day after the v3-2
branch was cut. The test asserts the feature works and fails on
v3-2-test CI.
Skip the test on the 3.2 line and link the tracking issue from both
the test skip-reason and the disabled production-code site so the
follow-up isn't lost. Decision (backport #55068 or formally drop
the feature on 3.2) is tracked in #66307.
* [v3-2-test] Aggregate CI-image dependency groups so providers can register non-default extras with a one-line change (#67130)
(cherry picked from commit e61640e)
Co-authored-by: Bugra Ozturk <bugraoz93@users.noreply.github.com>
---------
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Co-authored-by: namratachaudhary <namratachaudhary@users.noreply.github.com>
Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Richard Wu <richard9@ualberta.ca>
Co-authored-by: D. Ferruzzi <ferruzzi@amazon.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Bugra Ozturk <bugraoz93@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@Dev-iL@uranusjr@potiuk@Lee-W@eladkal@vatsrahul1001