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

Update catalogue #343

Merged
merged 18 commits into from
Dec 11, 2024
Merged

Update catalogue #343

merged 18 commits into from
Dec 11, 2024

Conversation

boshek
Copy link
Collaborator

@boshek boshek commented Jul 9, 2024

Testing #342

R/utils.R Outdated Show resolved Hide resolved
@ateucher
Copy link
Collaborator

ateucher commented Aug 16, 2024

So... this is passing now with a couple of (rather big) caveats:

  1. I've skipped tests for which there is no available data in tests/test-get-data.R.
  2. The new catalogue requires a new API key, which I can't get since I don't have an IDIR. Right now I've disabled the BCDC_KEY environment variable in the R CMD check action so the tests that access private records are skipped. We could continue this way or @stephhazlitt could get a key from the new catalogue and we can add that to the repo secrets. Or we could ask the catalogue team for a different key for CI purposes.

@stephhazlitt
Copy link
Member

@ateucher I'll chat with the catalogue team next week re: best path for the API key.

@ateucher
Copy link
Collaborator

ateucher commented Dec 5, 2024

Currently failing with search facets. A simplified example:

Current catalogue (returns populated License ID facets):

httr::GET("https://catalogue.data.gov.bc.ca/api/3/action/package_search?facet.field=%5B%22license_id%22%5D&rows=0") |> 
  httr::content(as = "text")
#> [1] "{\"help\": \"https://catalogue.data.gov.bc.ca/api/3/action/help_show?name=package_search\", \"success\": true, \"result\": {\"count\": 3252, \"sort\": \"score desc, metadata_modified desc\", \"facets\": {\"license_id\": {\"24\": 61, \"25\": 1, \"21\": 70, \"22\": 1420, \"49\": 5, \"47\": 2, \"44\": 13, \"45\": 2, \"42\": 18, \"50\": 5, \"53\": 2, \"43\": 3, \"2\": 1637, \"48\": 12, \"52\": 1}}, \"results\": [], \"search_facets\": {\"license_id\": {\"items\": [{\"count\": 70, \"display_name\": \"Statistics Canada Open Licence\", \"name\": \"21\"}, {\"count\": 2, \"display_name\": \"Open Licence - University of Northern British Columbia\", \"name\": \"53\"}, {\"count\": 12, \"display_name\": \"Open Government Licence \\u2013 TransLink\", \"name\": \"48\"}, {\"count\": 13, \"display_name\": \"Open Government Licence \\u2013 Municipality of North Cowichan\", \"name\": \"44\"}, {\"count\": 5, \"display_name\": \"Open Government Licence - SkilledTradesBC\", \"name\": \"50\"}, {\"count\": 3, \"display_name\": \"Open Government Licence - Destination BC\", \"name\": \"43\"}, {\"count\": 61, \"display_name\": \"Open Government Licence - Canada\", \"name\": \"24\"}, {\"count\": 1637, \"display_name\": \"Open Government Licence - British Columbia\", \"name\": \"2\"}, {\"count\": 2, \"display_name\": \"Open Government Licence - BC Assessment\", \"name\": \"47\"}, {\"count\": 5, \"display_name\": \"Open Data Licence for ICBC Information\", \"name\": \"49\"}, {\"count\": 1, \"display_name\": \"Open Data Licence - Office of the Registrar of Lobbyists for British Columbia\", \"name\": \"52\"}, {\"count\": 2, \"display_name\": \"Open Data Commons - Public Domain Dedication and Licence\", \"name\": \"45\"}, {\"count\": 1, \"display_name\": \"King's Printer Licence - British Columbia\", \"name\": \"25\"}, {\"count\": 18, \"display_name\": \"Elections BC Open Data Licence\", \"name\": \"42\"}, {\"count\": 1420, \"display_name\": \"Access Only\", \"name\": \"22\"}], \"title\": \"license_id\"}}}}"

"toyger" test catalogue: (returns empty)

httr::GET("https://toyger.data.gov.bc.ca/api/3/action/package_search?facet.field=%5B%22license_id%22%5D&rows=0") |> 
  httr::content(as = "text")
#> [1] "{\"help\": \"https://toyger.data.gov.bc.ca/api/3/action/help_show?name=package_search\", \"success\": true, \"result\": {\"count\": 0, \"facets\": {\"license_id\": {}}, \"results\": [], \"sort\": \"score desc, metadata_modified desc\", \"search_facets\": {\"license_id\": {\"title\": \"license_id\", \"items\": []}}}}"

Created on 2024-12-04 with reprex v2.1.1

@ateucher ateucher marked this pull request as ready for review December 11, 2024 21:56
@ateucher ateucher merged commit 2e06211 into main Dec 11, 2024
7 checks passed
@ateucher ateucher deleted the update-catalogue branch December 11, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants