Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/dandisets/ sorting by modified should probably sort by "overall modified" not by most recent sorted #1864

Open
yarikoptic opened this issue Feb 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working metadata Issues of dandiset/asset metadata handling

Comments

@yarikoptic
Copy link
Member

I wanted to get dandisets sorted by modified so I could update some oldest ones... but looking at the modified -- it is not sorted by "overall modified":

❯ ( curl -J -L -X 'GET' -H "Authorization: token $DANDI_API_KEY" 'https://api.dandiarchive.org/api/dandisets/?ordering=modified&draft=true&empty=true&embargoed=true' -H 'accept: application/json'; ) >| /tmp/1.json
❯ jq '.results[].modified' /tmp/1.json | head
"2021-04-19T17:30:57.431000Z"
"2021-02-04T21:30:12.812000Z"
"2020-12-05T18:34:22.305000Z"
"2021-03-17T17:57:31.239000Z"
"2021-01-25T20:24:17.701000Z"
"2021-08-12T18:14:16.760028Z"
"2021-04-27T14:33:20.572614Z"
"2021-01-15T18:35:01.693000Z"
"2022-01-17T16:22:43.888215Z"
"2023-03-10T20:03:31.536451Z"

or of the draft version subrecord:

❯ jq '.results[].draft_version.modified' /tmp/1.json | tail -n 20 | head
"2023-06-20T00:56:27.985543Z"
"2023-06-20T00:56:27.950903Z"
"2023-06-20T00:56:28.082652Z"
"2023-06-20T00:56:24.651140Z"
"2023-11-23T04:30:50.711283Z"
"2023-06-20T00:56:25.409545Z"
"2023-06-20T00:56:24.209856Z"
"2023-06-20T00:56:23.229732Z"
"2023-06-20T00:56:16.436802Z"
"2023-06-20T00:56:24.150509Z"

but by the most_recent_published_version

❯ jq '.results[].most_recent_published_version.modified' /tmp/1.json | head
"2021-08-12T14:57:32.680033Z"
"2021-08-12T15:15:40.225830Z"
"2021-08-12T15:16:07.029186Z"
"2021-08-12T15:16:41.081708Z"
"2021-08-12T15:17:05.738235Z"
"2021-08-13T03:27:03.101703Z"
"2021-08-19T03:45:24.378937Z"
"2021-08-19T15:47:29.060075Z"
"2021-08-31T20:34:01.283878Z"
"2021-09-13T16:39:43.037478Z"

with tailing records having only drafts so no most_recent_published_version at all...

@waxlamp waxlamp added bug Something isn't working metadata Issues of dandiset/asset metadata handling labels Feb 20, 2024
@waxlamp
Copy link
Member

waxlamp commented Feb 20, 2024

Seems to be a serious bug. Will look into it.

@yarikoptic
Copy link
Member Author

FWIW: if to prioritize, please prioritize above it

but this one might indeed be easier to fix

@waxlamp waxlamp self-assigned this Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metadata Issues of dandiset/asset metadata handling
Projects
None yet
Development

No branches or pull requests

2 participants