Add pyright type-checking to examples, fix discoveries#159
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands pyright strict type-checking coverage to the examples/ folder and updates multiple sample scripts to satisfy strict typing (plus fixes a small correctness issue in one sample).
Changes:
- Add
examples/topyrightconfig.jsonincludelist so samples are type-checked in strict mode. - Add/adjust type annotations across multiple example orchestrators/activities for pyright strict compatibility.
- Fix a sample bug where
random.choices(...)returnedlist[bool]instead ofbool.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pyrightconfig.json | Adds examples/ to pyright strict checking scope. |
| examples/work_item_filtering.py | Adds orchestrator generator return typing. |
| examples/version_aware_orchestrator.py | Adds orchestrator typing; removes incorrect int result annotation. |
| examples/sub-orchestrations-with-fan-out-fan-in/worker.py | Adds activity/orchestrator typing; fixes random.choices boolean bug; improves task typing. |
| examples/sandboxes/main_app.py | Adds typing imports and SandboxWorkerProfileOptions annotation. |
| examples/large_payload/app.py | Adds orchestrator generator typing (but main() still missing -> None). |
| examples/in_memory_backend_example/src/workflows.py | Adds typing for activities/orchestrators and collection types. |
| examples/human_interaction.py | Replaces namedtuple usage with a typed NamedTuple; adds orchestrator typing. |
| examples/history_export/app.py | Adds orchestrator generator typing. |
| examples/fanout_fanin.py | Adds activity/orchestrator typing and task list typing. |
| examples/entities/function_based_entity.py | Makes entity input optional/nullable; adds orchestrator generator typing. |
| examples/entities/function_based_entity_actions.py | Makes entity input optional/nullable; adds orchestrator typing. |
| examples/entities/entity_locking.py | Makes entity add input nullable; adds orchestrator generator typing. |
| examples/entities/class_based_entity.py | Makes entity add input nullable; adds orchestrator generator typing. |
| examples/entities/class_based_entity_actions.py | Makes entity add input nullable; adds orchestrator typing. |
| examples/distributed-tracing/app.py | Adds typing for lists/results and orchestrator generator typing. |
| examples/activity_sequence.py | Adds orchestrator generator typing. |
berndverst
approved these changes
Jun 25, 2026
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.
As stated. Also fixes a bug where
random.choicesreturned an array when the result was expecting a boolean