Skip to content

Commit f9e89e8

Browse files
langbartclaude
andauthored
Remove the dead fetch_assets() (#3)
Zero call sites: the live path reads the assets snapshot written by coasts::ingest_assets(), not this per-call Airtable fetch. The same function was just deleted from coasts (#20) for the same reason. It also matched form ids with an unanchored stringr::fixed(), which is only safe because Airtable record ids are fixed-length -- a fragile property to rely on in code nothing calls. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent d82a95d commit f9e89e8

3 files changed

Lines changed: 0 additions & 90 deletions

File tree

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export(export_landings)
1717
export(export_lurio_landings)
1818
export(export_validation_flags)
1919
export(fetch_asset)
20-
export(fetch_assets)
2120
export(flatten_field)
2221
export(flatten_row)
2322
export(form_id_pattern)

R/preprocessing-surveys.R

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,62 +1157,6 @@ fetch_asset <- function(
11571157
dplyr::select(dplyr::all_of(select_cols))
11581158
}
11591159

1160-
#' Fetch Multiple Asset Tables from Airtable
1161-
#'
1162-
#' @description
1163-
#' Fetches taxa, gear, vessels, and landing sites data from Airtable filtered
1164-
#' by the specified form ID. Returns distinct records for each table.
1165-
#'
1166-
#' @param form_id Character. Form ID to filter assets by. This is passed to each
1167-
#' individual fetch_asset call.
1168-
#' @param conf Configuration object from read_config().
1169-
#'
1170-
#' @return A named list containing four data frames:
1171-
#' \itemize{
1172-
#' \item \code{taxa}: Contains survey_label, alpha3_code, and scientific_name columns
1173-
#' \item \code{gear}: Contains survey_label and standard_name columns
1174-
#' \item \code{vessels}: Contains survey_label and standard_name columns
1175-
#' \item \code{sites}: Contains site and site_code columns
1176-
#' }
1177-
#'
1178-
#' @details
1179-
#' Each table is fetched separately using `fetch_asset()` and filtered to return
1180-
#' only distinct rows to avoid duplicates in the mapping tables.
1181-
#'
1182-
#' @keywords preprocessing helper
1183-
#' @export
1184-
fetch_assets <- function(form_id = NULL, conf = NULL) {
1185-
assets_list <-
1186-
list(
1187-
taxa = fetch_asset(
1188-
table_name = "taxa",
1189-
select_cols = c("survey_label", "alpha3_code", "scientific_name"),
1190-
form = form_id,
1191-
conf = conf
1192-
),
1193-
gear = fetch_asset(
1194-
table_name = "gears",
1195-
select_cols = c("survey_label", "standard_name"),
1196-
form = form_id,
1197-
conf = conf
1198-
),
1199-
vessels = fetch_asset(
1200-
table_name = "vessels",
1201-
select_cols = c("survey_label", "standard_name"),
1202-
form = form_id,
1203-
conf = conf
1204-
),
1205-
sites = fetch_asset(
1206-
table_name = "landing_sites",
1207-
select_cols = c("site", "site_code"),
1208-
form = form_id,
1209-
conf = conf
1210-
)
1211-
)
1212-
1213-
purrr::map(assets_list, ~ dplyr::distinct(.x))
1214-
}
1215-
12161160
#' Preprocess General Survey Information for ADNAP
12171161
#'
12181162
#' Processes general survey information from ADNAP KoBoToolbox forms including

man/fetch_assets.Rd

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)