feat: parallel and map branch name#387
Merged
Merged
Conversation
zhongkechen
reviewed
May 8, 2026
zhongkechen
approved these changes
May 15, 2026
| ] | ||
| }, | ||
| "DurableConfig": { | ||
| "RetentionPeriodInDays": 7, |
Contributor
There was a problem hiding this comment.
nit: this could be in Globals
| operation_id: str = executor_context._create_step_id_for_logical_step( # noqa: SLF001 | ||
| executable.index | ||
| ) | ||
| name: str = f"{self.name_prefix}{executable.index}" |
Contributor
There was a problem hiding this comment.
Not sure why we did this for both parallel and map. For parallel branches that use Python functions, they already have their unique names in __name__. We should leverage that to construct the branch names.
| nesting_type=nesting_type, | ||
| ) | ||
| self.items = items | ||
| self._item_namer = item_namer |
Contributor
There was a problem hiding this comment.
Why is _item_namer internal while the other fields are public? Do we have a guideline? I feel it's quite arbitrary when deciding whether or not I field should be internal.
| name: str | None = None, | ||
| ) -> Callable[ | ||
| [Callable[Concatenate[DurableContext, Params], T]], | ||
| Callable[Params, ParallelBranch[T]], |
Contributor
There was a problem hiding this comment.
Nice! But is the return type readable?
| def parallel( | ||
| self, | ||
| functions: Sequence[Callable[[DurableContext], T]], | ||
| functions: Sequence[Callable[[DurableContext], T] | ParallelBranch[T]], |
Contributor
There was a problem hiding this comment.
Isn't ParallelBranch also a Callable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
close #303
Description of changes:
Add support for custom naming of map iterations and parallel branches.
Map:
Parallel:
Shared mechanism:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing: