Skip to content

Add phase_collections.all_phases helper and clarify flatten docstring. - #1355

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1018519924
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_1018519924

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Add phase_collections.all_phases helper and clarify flatten docstring.

phase_collections.flatten unpacks nested Python iterables into top-level PhaseNode instances for executors while keeping container nodes such as PhaseGroup and PhaseSequence intact. Callers and unit tests that expect leaf PhaseDescriptor instances often call flatten by mistake when phase groups or sequences are present.

Document flatten behavior explicitly, add phase_collections.all_phases to recursively extract leaf PhaseDescriptor instances across nested iterables and phase containers, and delegate util.test.get_flattened_phases to all_phases.

`phase_collections.flatten` unpacks nested Python iterables into top-level `PhaseNode` instances for executors while keeping container nodes such as `PhaseGroup` and `PhaseSequence` intact. Callers and unit tests that expect leaf `PhaseDescriptor` instances often call `flatten` by mistake when phase groups or sequences are present.

Document `flatten` behavior explicitly, add `phase_collections.all_phases` to recursively extract leaf `PhaseDescriptor` instances across nested iterables and phase containers, and delegate `util.test.get_flattened_phases` to `all_phases`.

PiperOrigin-RevId: 1018519924
@google-cla

google-cla Bot commented Nov 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants