Skip to content

Commit 3065d06

Browse files
authored
Merge pull request #12 from inSilecoInc/fix-arrow
Avoid fetching all partitions
2 parents 7f831f3 + ad0522b commit 3065d06

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

.github/workflows/build-docker-container.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
on:
22
push:
33
branches: main
4-
pull_request:
5-
branches: main
64

75
name: Build and Push Docker Image
86

R/fct_map.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ base_map <- function() {
2222

2323
fetch_spatial_ind <- function(data = NULL, ind = NULL) {
2424
cli::cli_alert_info("Map - Fetching spatial informations for {ind}.")
25-
data |>
26-
dplyr::filter(tag_id == ind) |>
27-
dplyr::select(-species, -vernacular, -band_id)
25+
data |>
26+
dplyr::filter(tag_id == as.numeric(ind)) |>
27+
dplyr::collect() |>
28+
dplyr::select(-species, -vernacular, -band_id)
2829
}
2930

3031

R/fct_selectors.R

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,9 @@
1111
#' @noRd
1212

1313
fetch_input_choices <- function(data){
14-
15-
loc_years <- data |>
16-
dplyr::mutate(year = lubridate::year(datetime)) |>
17-
dplyr::select(tag_id, year) |>
18-
dplyr::distinct()
19-
20-
loc_summary <- data |>
14+
data |>
15+
dplyr::collect() |>
2116
dplyr::group_by(tag_id, vernacular, species) |>
2217
dplyr::mutate(year = lubridate::year(datetime)) |>
2318
dplyr::summarize(min = min(datetime), max = max(datetime))
24-
25-
loc_summary |>
26-
dplyr::mutate(years = purrr::map(tag_id, \(t) {
27-
loc_years |>
28-
dplyr::filter(tag_id == t) |>
29-
dplyr::pull(year) |>
30-
unique()
31-
}))
3219
}

R/fct_start.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ fct_start <- function() {
2727

2828
# Load birds locations
2929
bird_locations <<- arrow::gs_bucket("bird-locations") |>
30-
arrow::open_dataset() |>
31-
dplyr::collect()
30+
arrow::open_dataset()
3231

3332
onStop(clean_up_app)
3433
}

0 commit comments

Comments
 (0)