Expose fiscal-year timing: what months each survey year covers, per government #77
Open
opened 2026-10-26 16:24:28 -04:00 by jared
·
3 comments
No Branch/Tag Specified
main
ci/mirror-canonical-tags
chore/release-47-badges-mirror-pr
docs/readme-perf-remeasure-56
feat/pagination-search-balances-57
feat/duckdb-threads-60
feat/cohort-predicates-58
fix/windows-backslash-paths
ci/mirror-to-github
ci/github-actions-matrix
feat/public-release-0.3.0
chore/fixture-sb203
ci/apt-https
fix/pushdown-pagination
feat/all-categories-37
fix/partial-coverage-signposting-9
fix/schema-v7
fix/cog-categories-balance-subtype
feat/cog-balances-25
feat/revenue-concepts-12
feat/expenditure-concepts-11
feat/coverage-disclosure-13
feat/complete-argument-18
fix/kodor-batch-14-15-16
fix/all-scoped-series-breaks-19
fix/regen-fixture-corpus-18
test/walkthrough-findings
feat/expenditure-concept
fix/3-url-trailing-slash
feat/phase-r3-signposting
fix/fixture-option-b-aggregates
feat/phase-r2-harmonization
feat/phase-r1-forward
feat/cog-gov-search-basket-mode
v0.4.0
Labels
Clear labels
kodor
kodor/feature-proposal
kodor/fix
kodor/needs-review
kodor/triaged
madison-walkthrough
severity/high
severity/low
severity/medium
south-guide
verdict/defect
verdict/definitional
kodor
kodor/feature-proposal
kodor/fix
kodor/needs-review
kodor/triaged
Kodor should process this issue
Kodor has written a feature proposal
Kodor should implement a fix (assigned to Kodor)
Kodor's work or failure needs Jared's review
Kodor has already triaged this issue (skip)
Surfaced while building the client-facing Southern API guide
needs
human
Cannot move without a person -- a decision, a check an agent cannot make, something outside the repo
origin
client
Came from a client ask
origin
obligation
Created by a change elsewhere
origin
review
Came from human review
origin
roborev
Promoted from a roborev finding
type
chore
Maintenance with no behaviour change
type
debt
Owed work -- docs, tests, cleanup a change obligated
type
decision
Needs a decision before work can proceed
type
defect
Something is wrong
type
feature
New capability
ws
api
Query verbs and results
ws
corpus
Corpus, mirror, provenance
ws
docs
Vignettes and guides
Assign a task to kodor
Kodor thinks this needs a feature.
Kodor should fix this
Kodor thinks the user is ready to review this.
Kodor is done with this issue.
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Civilytics/uscogdata#77
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Every result labels a row with a survey year (
srvy_year), but a survey year covers different months for different governments. The Census rule (FAQ, Q6) is that survey year Y includes each government's fiscal year that ended between July 1 of Y−1 and June 30 of Y. So "2017" means:The label runs up to about 18 months ahead of the calendar for some governments. That matters whenever someone lines a series up against a dated event (a recession, a hurricane, a law taking effect) or compares two governments with different fiscal years.
The corpus already carries
fiscal_year_end(MMDD as an integer, e.g.630,1231) in the long schema. The verbs don't return it and the docs don't explain it.Work
fiscal_year_endmissing, zero or implausible, by survey year and government type? The 1967–2012 Individual Unit files have anFYEndDatecolumn, but it may be blank in early years. The answer decides what the rest of this issue can promise.fiscal_year_endplus derivedperiod_start/period_enddates. Names are open.cog_survey_year(govid, date), and the reverse (survey year → covered months). The event timeline innss_timedepends on this to place events correctly./governments/{govid}(the fiscal-year end history) and in/profile,/spendingand/revenuerows. That's a separate issue on cog-api, filed once the R side settles.Open questions
Why now
This blocks correct event placement in the
nss_timeevent timeline (context overlays on Place Explorer charts). It's also useful on its own for anyone comparing governments across years.R side landed in
04d7cf9(GitHub pull request 4). Step 4, the cog-api work, is still open, which is why this issue stays open.The PR could only measure
fiscal_year_endfor FY2011, FY2012, FY2019 and FY2020. This is the same measure for all 56 years, run against the default public corpus on 2026-11-04. "No usable value" counts missing and zero together, because both produceNAperiods.cog_fiscal_periods()andcog_survey_year()returnNAfor these rows rather than borrowing another year's value. The survey-year rule itself is still checked only against survey year 2020.The new code also ran correctly on the public corpus: all three verbs with
fiscal_period = TRUE, and both helpers. The cost was 4.5s against 2.9s for one government over eight years, one run each.Follow-up to the table above: the FY1993 gap starts in the Census source, not the pipeline.
FYEndDateinIndFin93a.TxtisBBBBfor 12,892 of 12,943 rows. Being chased on the pipeline repo as census_of_governments_finance_pipeline#129.The state-government rule now has a second test: the 2009 stimulus, in GitHub pull request 5 (https://github.com/civilytics/uscogdata/pull/5), landed. The full tables and the list of confounders are in that PR. Short version:
One item that PR listed as unverified is partly checked:
fiscal_year_endfor all 50 state governments, D.C., Broward and Palm Beach is stable across FY2006 to FY2011 on the public corpus. The other 13 local governments were not checked for those years.