transitland/transitland-datastore

sort_by vs. sort_key

ethanpooley opened this issue · 2 comments

We caught ourselves using a URL that didn't sort properly:

/api/v1/feed_versions?feed_onestop_id=f-9q9-bart&sort_by=latest_calendar_date&sort_order=desc

And changed it to one that does:

/api/v1/feed_versions?feed_onestop_id=f-9q9-bart&sort_key=latest_calendar_date&sort_order=desc

It's all good now, but we wanted to ask: did this variable name change at some point, or did we just get it wrong somehow in the first place? Thanks.

irees commented

hi @ethanpooley - I believe it has always been sort_key, but I just noticed the Feeds documentation page https://transit.land/documentation/datastore/feeds.html uses sort_by. I will fix this, thanks for the heads up.

I will jump on that as the reason I got it wrong, then. :) Glad I mentioned it. Thanks.