NASA-PDS / pds-api

PDS web APIs specifications and user's manual
http://nasa-pds.github.io/pds-api
Other
5 stars 3 forks source link

PDS API is not respecting the sort field #262

Closed msbentley closed 1 year ago

msbentley commented 1 year ago

Checked for duplicates

Yes - I've already checked

πŸ› Describe the bug

When including the sort field, the API doesn't seem to return data sorted as expected (there is no change).

πŸ•΅οΈ Expected behavior

I expect the API to respect the sort order, or to given error if this is not possible.

πŸ“œ To Reproduce

r = requests.get(pds_url + 'products',
    params={
        'limit': 10,
         'q': 'pds:Time_Coordinates.pds:start_date_time gt "2023-01-01T00:00:00Z"',
         'fields': 'lid, pds:Time_Coordinates/pds:start_date_time, pds:Time_Coordinates/pds:stop_date_time',
         'sort': 'pds:Time_Coordinates.pds:start_date_time desc'})

pd.DataFrame.from_dict(r.json()['data'])

The same data are returned in the same order above whether I include asc or desc in the sort parameter, or indeed if I choose another field to sort by.

I have also tried with different return types, e.g. CSV, with the same result, e.g.

image

πŸ–₯ Environment Info

No response

πŸ“š Version of Software Used

No response

🩺 Test Data / Additional context

No response

πŸ¦„ Related requirements

πŸ¦„ #xyz

βš™οΈ Engineering Details

No response

jordanpadams commented 1 year ago

@tloubrieu-jpl i think this is still an issue? Can we update the docs to either note this doesn’t work or remove?

alexdunnjpl commented 1 year ago

Corresponding issue in registry-api

tloubrieu-jpl commented 1 year ago

Hi @msbentley , the sort parameter is not implemented in the registry-api service. I will make that clear in the documentation.