ropensci / ckanr

R client for the CKAN API
https://docs.ropensci.org/ckanr
Other
99 stars 38 forks source link

Order of names in tag_search result is not relevant #202

Closed fjuniorr closed 1 year ago

fjuniorr commented 1 year ago

The expect_named expectation is failing in CKAN 2.9

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-tag_search.R:12:3'): tag_search gives back expected class types ──
Names of a[[1]] ('id', 'name', 'vocabulary_id') don't match 'vocabulary_id', 'id', 'name'
── Failure ('test-tag_search.R:20:3'): tag_search works with many queries ──────
Names of a[[1]] ('id', 'name', 'vocabulary_id') don't match 'vocabulary_id', 'id', 'name'

But since the tag_search endpoint returns

A dictionary with the following keys:

'count' The number of tags in the result.

'results' The list of tags whose names contain the given string, a list of dictionaries.

should[^1] not care about the order in which they are returned.

[^1]: Although apparently we could per Are dictionaries ordered in Python 3.6+? - Stack Overflow