Skip to content

Webclient activites: defensively cast start_time to string - #670

Merged
knabar merged 1 commit into
ome:masterfrom
sbesson:start_time_sort
May 20, 2026
Merged

Webclient activites: defensively cast start_time to string#670
knabar merged 1 commit into
ome:masterfrom
sbesson:start_time_sort

Conversation

@sbesson

@sbesson sbesson commented Mar 27, 2026

Copy link
Copy Markdown
Member

Fixes #652

As part of the Django 5.2 upgrade work, start times of callbacks are serialized as strings. Various error messages suggest there are still conditions under which datetime and string objects are directly compared when sorting jobs which is illicit. This commit fixes the sorting by ensuring strings are always compared.

As we have not identified how to reproduce the original issue, functional testing should probably validate that the activities endpoint still works as expected with various jobs submitted and in-between restarts of the application

As part of the Django 5.2 upgrade work, start times of callbacks are
serialized as strings. Various error messages suggest there are still
conditions under which datetime and string objects are directly compared
when sorting jobs which is illicit. This commit fixes the sorting by
ensuring strings are always compared.
@sbesson
sbesson requested review from knabar and will-moore March 27, 2026 09:13

@will-moore will-moore 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. Sorting strings will be fine 👍

@knabar knabar modified the milestones: 5.32.0, 5.31.1 May 12, 2026
@knabar
knabar merged commit ab75ca3 into ome:master May 20, 2026
8 checks passed
@sbesson
sbesson deleted the start_time_sort branch May 22, 2026 05:05
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.

Activities TypeError: '<' not supported between instances of 'datetime.datetime' and 'str'

3 participants