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

atlas_species() function fails against LA instance with la-pipelines generated index #234

Closed
shahmanash opened this issue Mar 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@shahmanash
Copy link

Describe the bug
galah atlas_species() function fails against LA instance with la-pipelines generated index (Sweden, France, Spain)

galah version
2.0.1

To Reproduce
Steps to reproduce the behaviour:

library(galah)
galah_config(email = "manash.shah@nrm.se", atlas = "Sweden")
galah_call() |>
  galah_identify("Corvus", "Taraxacum")|>
  atlas_species()|> 
  gt::gt()

See error

Error in `check_fields()`:
! Can't use fields that don't exist.
ℹ Use `search_all(fields)` to find a valid field ID.
✖ Can't find field(s) in
  • `galah_group_by()`: species_guid

Fix
The species_facets function defined in R/utilities_internal.R needs to be updated as below

species_facets <- function(){
  atlas <- pour("atlas", "region")
  switch(atlas,
         "Australia" = "speciesID",
         # "Austria" = "species_guid",
         # "Brazil" = "species_guid",
         # "Canada" = "species_guid"
         "Sweden" = "speciesID",
         "France" = "speciesID",
         "Spain" = "speciesID",
         "species_guid"
  )
}

Better Fix
In a number of function, fields or a list of fields are being specified on a per LA instance basis. Instead of adding the field for individual atlas instances, maybe a column could be added to the data-raw/node_config.csv file to indicate if the instance is using la-pipelines generated index or the legacy biocache-cli tool . This field could also be used in a similar situation in default_columns function in R/galah_select.R

@shahmanash shahmanash added the bug Something isn't working label Mar 19, 2024
mjwestgate added a commit that referenced this issue Mar 22, 2024
- ensure working APIs for atlases using pipelines infrastructure
- use less intrusive column renaming
- remove APIs for atlases where we have been unable to test downloads (Portugal and Estonia)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants