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

show_values() formats output (which isn't compatible with galah_filter()) #233

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

Comments

@daxkellie
Copy link
Contributor

The output of show_values() appears to be formatted after it is retrieved, which makes it look nice, but if you use the values shown by the output of show_values() for the field basisOfRecord, your query won't work.

search_all(fields, "basisOfRecord") |> show_values()
#> ! Search returned 2 matched fields.
#> • Showing values for 'basisOfRecord'.
#> # A tibble: 9 × 1
#>   basisOfRecord      
#>   <chr>              
#> 1 Human observation  
#> 2 Preserved specimen 
#> 3 Observation        
#> 4 Occurrence         
#> 5 Machine observation
#> 6 Material Sample    
#> 7 Living specimen    
#> 8 Material Citation  
#> 9 Fossil specimen

galah_call() |>
  identify("Daviesia ulicifolia") |>
  filter(basisOfRecord == "Human observation") |>
  atlas_counts()
#> # A tibble: 1 × 1
#>   count
#>   <int>
#> 1     0

The actual values for basisOfRecord are in all caps and separated by an underscore, which when used, return the correct result.

galah_call() |>
  identify("Daviesia ulicifolia") |>
  filter(basisOfRecord == "HUMAN_OBSERVATION") |>
  atlas_counts()
#> # A tibble: 1 × 1
#>   count
#>   <int>
#> 1 14446

Created on 2024-03-06 with reprex v2.0.2

I'm not sure whether this is true for all show_values() results, and whether it is the same for search_values() as well.

@daxkellie daxkellie added the bug Something isn't working label Mar 6, 2024
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

1 participant