feat!: require corpus schema_version 4 (Phase P canonical ids)

BREAKING CHANGE: canonical_govid is now uniformly 12 characters across
every vintage; corpora built against schema_version 3 are rejected.
Bumps MinCorpusSchema/MaxCorpusSchema to 4 and expected_version in
cog_open(). canonical_fips_xwalk grows to the 14-column Phase P master
schema (adds legacy_govs_id, census_geoid, id_source; confidence is
renamed to pop_confidence); .empty_xwalk_tibble() is rewritten to match.
This commit is contained in:
2026-07-11 09:31:33 -04:00
parent 874347242b
commit e635a1fc9e
4 changed files with 27 additions and 6 deletions
+4 -3
View File
@@ -126,9 +126,10 @@ cog_gov_search <- function(name = NULL, state = NULL, type = NULL) {
canonical_govid = character(0), gov_name = character(0),
govs_type = integer(0), type_label = character(0),
fips_state = character(0), fips_county = character(0),
fips_place = character(0), first_year = integer(0),
last_year = integer(0), population_acs = integer(0),
confidence = character(0)
fips_place = character(0), legacy_govs_id = character(0),
first_year = integer(0), last_year = integer(0),
census_geoid = character(0), population_acs = integer(0),
pop_confidence = character(0), id_source = character(0)
)
}
+1 -1
View File
@@ -12,7 +12,7 @@ cog_open <- function(url = .resolve_url(),
DBI::dbExecute(con, "INSTALL httpfs; LOAD httpfs;")
manifest <- .fetch_or_cache_manifest(url, cache_dir)
.validate_schema(manifest, expected_version = 3L)
.validate_schema(manifest, expected_version = 4L)
.validate_scope(manifest)
.register_views(con, url, manifest)