From 9240a18ea3cae28a4d84ae9cec9ea532d3f86e4d Mon Sep 17 00:00:00 2001 From: Jared Knowles Date: Mon, 27 Jul 2026 09:11:10 -0400 Subject: [PATCH] chore: regenerate fixture corpus with the intergovernmental category rows Picks up pipeline PR #59: summary_categories now carries 66 M/L rows under spend_subtype = intergovernmental (194 -> 260 rows). cog_categories() (R/categories.R) has no item-code prefix filter, so the new IG rows surface immediately as a third spend subtype; this broke test-categories.R:18's closed enumeration. Adjudicated (2026-07-27): this is correct behavior, not a regression -- cog_categories() is a discovery verb documented to surface valid category values, and after Task 3 lands users will see spend_subtype = intergovernmental in cog_spending(expenditure_concept = total) results. Widened the subtype assertion and added positive coverage asserting the intergovernmental subtype and that it reuses existing functional categories (plus Other Education, pipeline #58). R/categories.R itself is unchanged -- its behavior was already right. Suite: PASS 469, FAIL 0 (baseline 467 + widened assertion + 2 new expectations). --- .../data/summary_categories.parquet | Bin 6073 -> 6553 bytes inst/extdata/fixture_corpus/manifest.json | 6 +++--- tests/testthat/test-categories.R | 13 ++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/inst/extdata/fixture_corpus/data/summary_categories.parquet b/inst/extdata/fixture_corpus/data/summary_categories.parquet index 054efa252ce40ed503a2cfddc490b1226c6b9a1c..d87566b3321bd4379b238e5872eba15b05a0bcf5 100644 GIT binary patch delta 1413 zcmb7DdrVVT96tBw4frfSzW(XdJQ!Za`HjLkSiTbO`APHQUe|2vwxc8#VG3)NrpbNhB|} zfszL|Ok z-zU!G5!+c_=^B{Uuf5w@aoIiO^r9uU>zk{dQHJ%EyIsahH3y}o9AR9ysm?d4J}_gt zyOIu2cP2H(^;BIuq8-b9Jl%7-@#v{(lQ6#bN>h05Qh&xw@73ma3)U8!;`^#wqrZ5y z{&=RZ=6XyC&K1e}YdhjiE|Qb8{dHZ5wPJ-;Hc;P_YzfobW(VlLl=iqvk$kXW;Qjuz zfs=EC*Nj8y-=4l_l@FPRGbarjwz;9k(GRCext<9(EH`r&>m`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JCCH(`04LfB_@Jt1SZ#6b7+JAeD<0MO_%gHfV^o QFspHh-ILp#%xlI20Ml&vs{jB1 diff --git a/inst/extdata/fixture_corpus/manifest.json b/inst/extdata/fixture_corpus/manifest.json index a28403e..d86af01 100644 --- a/inst/extdata/fixture_corpus/manifest.json +++ b/inst/extdata/fixture_corpus/manifest.json @@ -1,7 +1,7 @@ { "schema_version": 6, - "built_at": "2026-07-23T16:14:30Z", - "pipeline_commit": "4f992a0", + "built_at": "2026-07-27T13:04:05Z", + "pipeline_commit": "6098baf", "fixture_note": "Four-year (2011, 2012, 2019, 2020) fixture for uscogdata tests. Full corpus available via USCOGDATA_URL. Regenerated for Phase R2 (schema_version 5, harmonization_map/harmonization_recipes/ series_breaks parquet tables added). 2011/2012 straddle the wide-aggregate -> modern-leaf format boundary exercised by basis= \"harmonized\" and recipe= queries; 2019/2020 retain the prior per-capita/CPI regression anchors. Full canonical_fips_xwalk master and canonical_alias lookup table included via data-raw/regenerate_fixture_corpus.R.", "data_vintage": { "source_vintages": { @@ -75,7 +75,7 @@ }, { "path": "data/summary_categories.parquet", - "sha256": "8e6fcd4dd9bb4723841a67233b19388c9762dfc23b4479501183cebf7ea3c1b5", + "sha256": "0985b607f3f35a8dff62c0561261ab6922423b81d11c07b03bcb3e3461f85e33", "description": "summary_categories.parquet" }, { diff --git a/tests/testthat/test-categories.R b/tests/testthat/test-categories.R index af802f8..74b6aa1 100644 --- a/tests/testthat/test-categories.R +++ b/tests/testthat/test-categories.R @@ -15,7 +15,18 @@ test_that("cog_categories(type = 'spending') returns only expenditure rows", { skip_if_no_corpus() r <- cog_categories(type = "spending") expect_true(all(r$category_type == "expenditure")) - expect_true(all(r$subtype %in% c("operations", "capital"))) + expect_true(all(r$subtype %in% c("operations", "capital", "intergovernmental"))) +}) + +test_that("cog_categories surfaces the intergovernmental spending subtype", { + skip_if_no_corpus() + r <- cog_categories(type = "spending") + expect_true("intergovernmental" %in% r$subtype) + # IG rows reuse the existing functional categories -- they add a subtype, + # not new category values. + ig_cats <- sort(unique(r$category[r$subtype == "intergovernmental"])) + direct_cats <- sort(unique(r$category[r$subtype != "intergovernmental"])) + expect_true(all(ig_cats %in% c(direct_cats, "Other Education"))) }) test_that("cog_categories(type = 'revenue') returns only revenue rows", {