Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Type-hinting improvements#104

Merged
andystaples merged 4 commits intomainmicrosoft/durabletask-python:mainfrom
andystaples/improve-typingmicrosoft/durabletask-python:andystaples/improve-typingCopy head branch name to clipboard
Jan 12, 2026
Merged

Type-hinting improvements#104
andystaples merged 4 commits intomainmicrosoft/durabletask-python:mainfrom
andystaples/improve-typingmicrosoft/durabletask-python:andystaples/improve-typingCopy head branch name to clipboard

Conversation

@andystaples
Copy link
Contributor

@andystaples andystaples commented Jan 12, 2026

Adds/improves type-hinting for various worker methods

Covers changes from #91
Short-term fix for #90
Resolves #94

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves type-hinting for orchestrator and activity registration methods by adding generic type parameters to better specify input and output types.

Changes:

  • Enhanced type hints for Orchestrator and Activity type aliases with proper generic parameters
  • Updated method signatures in _Registry and TaskHubGrpcWorker classes to use parameterized types
  • Updated CHANGELOG to document the improvements

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
durabletask/task.py Updated Orchestrator type alias to properly parameterize Generator return type and yield type
durabletask/worker.py Added generic type parameters to orchestrator and activity registration methods in both _Registry and TaskHubGrpcWorker classes
CHANGELOG.md Added entry for type-hinting improvements in Unreleased section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Orchestrators are generators that yield tasks and receive/return any type
Orchestrator = Callable[[OrchestrationContext, TInput], Union[Generator[Task, Any, Any], TOutput]]
# Orchestrators are generators that yield tasks, recieve any type, and return TOutput
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

Spelling error: "recieve" should be "receive"

Suggested change
# Orchestrators are generators that yield tasks, recieve any type, and return TOutput
# Orchestrators are generators that yield tasks, receive any type, and return TOutput

Copilot uses AI. Check for mistakes.
@andystaples andystaples merged commit a491469 into main Jan 12, 2026
20 checks passed
@andystaples andystaples deleted the andystaples/improve-typing branch January 12, 2026 21:34
This was referenced Jan 12, 2026
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.

when_any should specify type for input tasks

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.