fix(search): soft-fail on per-row excluded type and malformed regex name
Cross-task review found two edge cases that violated the basket-mode soft-fail contract: - Per-row excluded type (e.g. type = c(NA, "special_district")) hit .coerce_type()'s abort inside the per-row resolver, killing the whole basket call. Now treated as no_match in the sidecar. - Malformed regex in the substring fallback (e.g. name = "San(Diego") propagated DuckDB engine errors. .escape_regex() now backslash- escapes meta characters before the regexp_matches call. Utility- mode regex behavior is unchanged. Plus a new public-surface test for the all-no-match case.
This commit is contained in:
+4
-1
@@ -39,9 +39,12 @@
|
||||
}
|
||||
|
||||
# Convert a type input (integer-like or label) into the canonical label
|
||||
# string used in the sidecar query_type column.
|
||||
# string used in the sidecar query_type column. Excluded types (4/5 /
|
||||
# special_district / school_district) are returned as-is so the sidecar
|
||||
# records what the user passed without calling .coerce_type() (which aborts).
|
||||
#' @noRd
|
||||
.type_to_label <- function(type) {
|
||||
if (.is_excluded_type(type)) return(as.character(type))
|
||||
int_type <- .coerce_type(type)
|
||||
unname(c("0" = "state", "1" = "county", "2" = "city", "3" = "township")[[as.character(int_type)]])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user