Skip to content

Preserve behavior while narrowing Ruff exceptions - #347

Merged
andystaples merged 1 commit into
mainfrom
andystaples-review-ruff-up028-up042
Nov 11, 2026
Merged

andystaples merged 1 commit into
mainfrom
andystaples-review-ruff-up028-up042

Conversation

@andystaples

Copy link
Copy Markdown
Contributor

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, or close to its lock iterator. ScheduleStatus formatting is part of the public interface and appears in transition errors. Regression coverage protects both contracts and schedule status conversions.

Fixes #324

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 17:30

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.

🟢 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, and close.
  • 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

@berndverst Bernd Verst (berndverst) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@andystaples
andystaples merged commit 2e1b7af into main Nov 11, 2026
26 checks passed
@andystaples
andystaples deleted the andystaples-review-ruff-up028-up042 branch November 11, 2026 18:50
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.

Review behavior-sensitive Ruff UP028 and UP042 findings

3 participants