Skip to content

Add pyright type-checking to examples, fix discoveries#159

Merged
berndverst merged 2 commits into
microsoft:mainfrom
andystaples:andystaples/lint-samples
Jun 25, 2026
Merged

Add pyright type-checking to examples, fix discoveries#159
berndverst merged 2 commits into
microsoft:mainfrom
andystaples:andystaples/lint-samples

Conversation

@andystaples

@andystaples andystaples commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

As stated. Also fixes a bug where random.choices returned an array when the result was expecting a boolean

Copilot AI review requested due to automatic review settings June 25, 2026 18:04

Copilot AI 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.

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/ to pyrightconfig.json include list 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(...) returned list[bool] instead of bool.

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.

Comment thread pyrightconfig.json
Comment thread examples/large_payload/app.py
@berndverst berndverst merged commit c115409 into microsoft:main Jun 25, 2026
17 checks passed
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.

3 participants