Skip to content

Schedules hotfix for DTS dashboard#169

Open
andystaples wants to merge 1 commit into
microsoft:mainfrom
andystaples:andystaples/fix-schedules-dts-dashboard
Open

Schedules hotfix for DTS dashboard#169
andystaples wants to merge 1 commit into
microsoft:mainfrom
andystaples:andystaples/fix-schedules-dts-dashboard

Conversation

@andystaples

@andystaples andystaples commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Fixes the over-the-wire shape for schedules objects to comply with the expected shape from the DTS backend/dotnet
Fixes:

  • Status enum sent as int value, not string
  • Schedule sent in dotnet TimeSpan format, not int seconds
  • Use PascalCase instead of snake_case across the board

Copilot AI review requested due to automatic review settings July 6, 2026 20:16

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 updates the durabletask.scheduled persisted schedule entity JSON shape to match what the Durable Task Scheduler (DTS) dashboard expects when deserializing state as .NET types.

Changes:

  • Serialize ScheduleConfiguration using PascalCase property names and format interval as a .NET TimeSpan string.
  • Serialize ScheduleState.status as the .NET enum ordinal (int) and accept legacy string/snake_case formats when reading.
  • Add regression tests for the .NET-compatible JSON shape and update the changelog with the user-visible fix.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tests/durabletask/scheduled/test_models.py Adds tests validating .NET-compatible JSON serialization and legacy deserialization support.
durabletask/scheduled/schedule_status.py Adds helpers to convert schedule status to/from .NET ordinal/string representations.
durabletask/scheduled/models.py Implements PascalCase JSON shape, TimeSpan interval formatting/parsing, and more tolerant deserialization.
CHANGELOG.md Documents the dashboard compatibility fix under ## Unreleased.

# .NET serializes ``DateTimeOffset`` with a numeric offset, but tolerate a
# trailing ``Z`` so states written by other producers still parse on the
# Python versions that predate ``fromisoformat`` accepting ``Z``.
return datetime.fromisoformat(value.replace("Z", "+00:00"))
return _STATUS_TO_ORDINAL[self]

@classmethod
def from_dotnet(cls, value: Union[int, str, None]) -> "ScheduleStatus":
Comment on lines 4 to 6
from enum import Enum
from typing import Union

state.schedule_last_modified_at = _from_iso(data.get("schedule_last_modified_at"))
config_data = data.get("schedule_configuration")
state.status = ScheduleStatus.from_dotnet(_get(data, "Status", "status"))
state.execution_token = _get(data, "ExecutionToken", "execution_token")
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.

2 participants