Skip to content

Commit 9c16bad

Browse files
committed
Airtable asset text is trimmed on ingest
1 parent a4bf9c3 commit 9c16bad

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎DESCRIPTION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: coasts
22
Type: Package
33
Title: Coastal Fisheries Data Pipeline for Western Indian Ocean
4-
Version: 4.13.0
4+
Version: 4.14.0
55
Authors@R: person("Lorenzo", "Longobardi", email = "l.longobardi@cgiar.org",
66
role = c("aut", "cre"))
77
Description: Provides a comprehensive data pipeline for processing and analyzing

‎NEWS.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# coasts 4.14.0
2+
3+
## Airtable asset text is trimmed on ingest
4+
5+
* **FIXED**
6+
7+
`fetch_asset()` now strips leading and trailing whitespace from every character
8+
column, so the assets snapshot the country pipelines read can no longer carry a
9+
padded join key.
10+
111
# coasts 4.13.0
212

313
## Restating length-weight coefficients on a total-length basis

‎R/airtable.R‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,8 @@ fetch_asset <- function(
666666
token = conf$airtable$token
667667
) |>
668668
janitor::clean_names() |>
669-
dplyr::select(dplyr::all_of(select_cols))
669+
dplyr::select(dplyr::all_of(select_cols)) |>
670+
dplyr::mutate(dplyr::across(dplyr::where(is.character), trimws))
670671
}
671672

672673
#' Build a Form-ID Match Pattern for Airtable Asset Tables
@@ -822,7 +823,9 @@ get_assets <- function(
822823
purrr::imap(function(tbl, nm) {
823824
if (nrow(tbl) == 0) {
824825
warning(
825-
"Asset table '", nm, "' matched no rows for the given form id(s). ",
826+
"Asset table '",
827+
nm,
828+
"' matched no rows for the given form id(s). ",
826829
"Downstream joins on it will yield NA.",
827830
call. = FALSE
828831
)

0 commit comments

Comments
 (0)