Skip to content

Commit

Permalink
Bug fixes for atlas_counts and associated functions
Browse files Browse the repository at this point in the history
Relate to problems created by removal of S3 classes (#133) and adding galah_data_profiles (#130)
  • Loading branch information
mjwestgate committed May 2, 2022
1 parent a0e0b2e commit 853b39c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
10 changes: 0 additions & 10 deletions R/atlas_counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,6 @@ atlas_counts_internal <- function(identify = NULL,

verbose <- getOption("galah_config")$verbose

# if `group_by` is as a vector
if(!is.null(group_by)){
if(!inherits(group_by, "galah_group_by")){
group_by <- galah_group_by(group_by)
}
if(nrow(group_by) < 1){
group_by <- NULL
}
}

# ensure profile works from galah_filter as well as galah_profile
if(inherits(data_profile, "galah_data_profile")){
profile <- data_profile
Expand Down
2 changes: 1 addition & 1 deletion R/galah_call.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ galah_call <- function(identify = NULL,
check_call_args(select, "select")
check_call_args(geolocate, "geolocate")
check_call_args(group_by, "group_by")
check_call_args(group_by, "data_profile")
check_call_args(data_profile, "data_profile")
check_call_args(down_to, "down_to")

request <- structure(c(list(identify = identify,
Expand Down
5 changes: 2 additions & 3 deletions R/galah_group_by.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ galah_group_by <- function(..., expand = TRUE){
provided_variables <- dequote(unlist(lapply(dots, as_label)))
if (getOption("galah_config")$run_checks){
validate_fields(provided_variables)
}else{
available_variables <- provided_variables[
provided_variables %in% show_all_fields()$id]
}
available_variables <- provided_variables[
provided_variables %in% show_all_fields()$id]
if(length(available_variables) > 0){
df <- tibble(name = available_variables)
df$type <- ifelse(str_detect(df$name, "[[:lower:]]"), "field", "assertions")
Expand Down

0 comments on commit 853b39c

Please sign in to comment.