Python: Use pass instead of ... for empty class bodies and methods in workflows#4264
Python: Use pass instead of ... for empty class bodies and methods in workflows#4264
pass instead of ... for empty class bodies and methods in workflows#4264Conversation
…package Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
pass instead of ... for empty class bodies and methods in workflows
There was a problem hiding this comment.
Pull request overview
This PR aims to standardize placeholder implementations in the Python workflow/orchestration code by replacing ... with pass in empty method bodies, primarily within workflow-related interfaces and abstract classes.
Changes:
- Replaced
...withpassin workflow executor no-op hook (Executor.on_checkpoint_restore). - Replaced
...withpassin workflowProtocolinterface method stubs (CheckpointStorage,RunnerContext). - Replaced
...withpassin abstract method stubs for the Magentic orchestration manager base.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| python/packages/orchestrations/agent_framework_orchestrations/_magentic.py | Updates abstract method placeholders in MagenticManagerBase to use pass. |
| python/packages/core/agent_framework/_workflows/_runner_context.py | Updates RunnerContext Protocol method stubs to use pass. |
| python/packages/core/agent_framework/_workflows/_executor.py | Updates default Executor.on_checkpoint_restore hook to use pass. |
| python/packages/core/agent_framework/_workflows/_checkpoint.py | Updates CheckpointStorage Protocol method stubs to use pass. |
python/packages/orchestrations/agent_framework_orchestrations/_magentic.py
Outdated
Show resolved
Hide resolved
…r abstract methods in magentic Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com>
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
|
@copilot I still see
|
…rotocol stubs Co-authored-by: moonbox3 <35585003+moonbox3@users.noreply.github.com>
Done in commit 75114e3 — For |
Motivation and Context
Style consistency: replace
...withpassfor empty method bodies across the workflow and orchestrations packages, usingraise NotImplementedErrorfor abstract methods and preserving...only where idiomatically required (e.g.,@overloadstubs and default argument sentinels).Description
packages/core/agent_framework/_workflows_executor.py:on_checkpoint_restoreconcrete no-op default hook usespass_checkpoint.py: All 6CheckpointStorageProtocol method stubs usepass_runner_context.py: All 19RunnerContextProtocol method stubs usepass_agent.py: No changes — only@overloadstubs and= ...default argument sentinels, which are idiomatic and left unchangedpackages/orchestrations_magentic.py: 4@abstractmethodstubs inMagenticManagerBaseuseraise NotImplementedError(explicit and type-checker safe)@overloadstubs and...used as default argument sentinels are left unchanged — those are idiomatic/intentional.Concrete no-op hook (
pass):Protocol method stub (
pass):Abstract method (
raise NotImplementedError):Contribution Checklist
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.