-
Notifications
You must be signed in to change notification settings - Fork 12
Various API end point use fixes for issue #353 #354
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
Conversation
|
I notice we don't have any tests for these helper functions and thinking it might be useful to add one/s, however with the number of groups/organizations and number of records per group/organization always changing it might be a bit fiddly. We could get the dataset/package count from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful work @stephhazlitt! Great sleuthing, and great fixes.
It's a pretty quick review (I only tested it locally quite quickly), but a few questions for you inline...
As for tests, your idea is pretty clever, that might work well. Even basic tests that the classes of the returned object are correct are helpful too. And maybe to address the bug specifically, use a facet/group/org that we know has > 50/10/10 records, and write a test for nrow > 50/10/10?
Will you add a NEWS item as well?
One other question, probably out of scope for this PR but thought I'd ask: Did you find a way to find the list of facets available to search? I wonder if this list: c("license_id", "download_audience", "res_format", "publish_state", "organization", "groups") is the full list now?
|
Thanks @ateucher. I'll explore further changes based on your feedback, add some tests as per the discussion and update the |
boshek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! My only comments are that we should expose all these as options rather than arguments or hard coded values. Thanks @stephhazlitt!
I spent some time trying to solve this but no luck. In the end, after trying and failing with many queries, ChatGPT advised that most often the GUI will include all enabled search facets in the right hand column—by this logic, we have them all. The list depends on how the CKAN instance is configured on the server, so I could ask the catalogue team to confirm. |
ateucher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome @stephhazlitt thank you! One suggested change about the nrows comparison, and a mild suggestion to add tests for the options... if you don't have time for that though I think that's okay and you can go ahead and merge.
boshek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. If you don't end up making option specific tests (which is totally fine) I think an issue would be good to create.
ateucher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect @stephhazlitt, let's get this merged!
Changes to address Issue #353:
facet.limit=1000tobcdc_search_facets()(which uses thepackages_searchendpoint) so that >50 organizations are pulled withbcdc_search_facets("organizations")andbcdc_list_organizations().bcdc_list_group_records()to usegroup_package_showendpoint instead ofgroup_showas the latter was returning a truncated list (10) of a group's datasets (even though the docs suggest it should return 1000). NOTE: This change results in a returned object of the same class and with almost the same set of columns (plusreplacement_recordandretention expiry_datecols and minussupport_urlcol).bcdc_list_organization_records()to usepackage_searchinstead oforganization_showendpoint, sinceorganization_showendpoint returns a truncated list (10) of a group's datasets (as per the docs) and unlike group there is noorganization_package_show