Skip to content

Treat 204 No Content as no rows; require morpc 0.7.5 (v0.6.5) - #9

Merged
jinskeep-morpc merged 2 commits into
mainfrom
fix/no-content-as-no-rows
Sep 24, 2026
Merged

jinskeep-morpc merged 2 commits into
mainfrom
fix/no-content-as-no-rows

Conversation

@jinskeep-morpc

Copy link
Copy Markdown
Collaborator

Problem

The Census API returns 204 No Content when a request is valid but it has no data for the requested geographies. ACS 5-year 2017 lists place/remainder parts (070) in its geography list, but returns 204 for every 070 request, in both ucgid and for/in forms; other years and levels are fine. Since morpc 0.7.3 that raised HTTPError, which stopped the whole CensusAPI fetch and the morpc-pop-collect notebook run.

Change

Testing

  • 3 new tests in tests/test_api.py: a 204 chunk is skipped while the others are kept; an all-204 fetch returns an empty frame with the expected columns; a 400 still raises. The two 204 tests failed before the change.
  • Full suite: 347 passed.
  • Live: CensusAPI(Endpoint('acs/acs5', 2017), 'region15', sumlevel=SumLevel('070'), ...) returns an empty long with warnings, instead of RuntimeError.

🤖 Generated with Claude Code

jinskeep-morpc and others added 2 commits September 24, 2026 08:20
The Census API answers 204 when a request is valid but it has no data for
the requested geographies. For example, ACS 5-year 2017 lists
place/remainder parts (070) but publishes none, which stopped a whole
workflow run. _fetch_variables now logs a warning and treats that
request as zero rows; other HTTP errors still raise. Requires morpc
0.7.4, whose HTTPError carries the response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jinskeep-morpc
jinskeep-morpc merged commit 28300b9 into main Sep 24, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant