AtlasOfLivingAustralia / galah-R

Query living atlases from R
https://galah.ala.org.au
39 stars 3 forks source link

`galah_filter` handles bad/illogical `&` and `|` statements #111

Closed daxkellie closed 2 years ago

daxkellie commented 2 years ago

galah_filter throws errors when there are bad/illogical queries. For example:

galah_filter(year == 2010 | 2021)
galah_filter(year > 2012 & 2016)

dplyr handles these queries without returning errors. Illogical | queries return the same unfiltered data.frame (as it cannot discern what change to make). Illogical & queries return a data.frame filtered by only the first logical statement (as this is the only TRUE statement).

It would be nice if galah mirrored these behaviours

/cc @mjwestgate