Repository navigation
Preserve behavior while narrowing Ruff exceptions - #347
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the targeted Ruff-exception changes.
No open issues 🎉
What changed in this PR
This PR addresses #324 by narrowing behavior-sensitive Ruff exceptions without changing SDK behavior. It preserves generator protocol handling and public schedule-status formatting.
Changes:
- Replaces file-wide UP028 and UP042 exclusions with documented inline exceptions.
- Adds regression tests for entity availability ordering and non-forwarding of
send,throw, andclose. - Adds regression tests for schedule-status formatting, conversions, and transition-error messages.
| File | Description |
|---|---|
tests/durabletask/test_orchestration_entity_context.py |
Tests entity ordering and generator protocol behavior. |
tests/durabletask/scheduled/test_schedule_status.py |
Tests status formatting, conversions, and error messages. |
pyproject.toml |
Removes the two file-wide Ruff exclusions. |
durabletask/scheduled/schedule_status.py |
Adds a targeted UP042 exception with compatibility rationale. |
durabletask/internal/orchestration_entity_context.py |
Adds a targeted UP028 exception with protocol rationale. |
Review effort: Balanced
Bernd Verst (berndverst)
approved these changes
Nov 10, 2026
Bernd Verst (berndverst)
left a comment
Member
There was a problem hiding this comment.
Looks good. The inline exceptions preserve the existing generator and ScheduleStatus contracts while letting Ruff check the rest of both files. The regression tests catch the send/throw/close and public-formatting changes that mechanical modernization would introduce. I found no correctness, compatibility, or performance regressions.
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.
Narrow the Ruff UP028 and UP042 exceptions to the affected loop and enum instead of suppressing those rules for entire files.
The generator does not forward
send,throw, orcloseto its lock iterator.ScheduleStatusformatting is part of the public interface and appears in transition errors. Regression coverage protects both contracts and schedule status conversions.Fixes #324