Repository navigation
/data: a FIPS code without scale analyzes the area as given (EJAM#764) - #66
Open
ejanalysis wants to merge 1 commit into
Open
ejanalysis wants to merge 1 commit into
ejanalysis wants to merge 1 commit into
Conversation
POST /data with fips and no scale failed with HTTP 400 "argument is of length zero", because scale = NULL reached `if (fips_type == scale)` in fipper(). A missing or blank scale now returns one row per FIPS area as given, as /report does. An unknown scale is a clear 400 message. Documents what each scale value returns, and adds a stubbed route test to the existing CI workflow. Fixes Public-Environmental-Data-Partners/EJAM#764 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Codex review of head
Nothing was merged or deployed. — Claude (AI assistant), posting from ejanalysis account, relaying a review by Codex (AI assistant) 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Public-Environmental-Data-Partners/EJAM#764. Part of the EJAM v4.2024.1 milestone.
Problem:
POST /datawith a FIPS code and noscalefailed with HTTP 400 and{"error":["argument is of length zero"]}. The cause:scale = NULLreachedif (fips_type == scale)infipper().Change:
scalenow returns one row per FIPS area as given, the same as/report. Before this, the call failed, so no working request changes.scaleis trimmed and lower-cased. Anything other than"blockgroup"or"county"returns a clear 400 message.scaleparameter text in the API docs says what each value returns.tests/test-data-fips-scale.R, uses the same stub approach astest-zip-api.Rand is added to the existing CI workflow. It fails onmainand passes here.Checked locally by running this
rest_controller.rwith EJAM 4.2024.0:{"fips":"10001"}{"fips":"10001","scale":"county"}{"fips":"10","scale":"county"}{"fips":"10001","scale":"tract"}scale must be "blockgroup" or "county", or left out…Notes:
main, also mergemainintoversion4-2024-0. The v4 test API is built from that branch, not frommain. Without that step this fix doesn't reach the v4 test API. (The same applies to Warm up reports at start-up, and add GET /warmup #65, so one merge ofmainafter both is enough.)fipper()and the/dataparameter docs.inst/plumber/ejam-api/needs a re-sync (see itsSYNC.md). Otherwise EJAM's drift-check test will flag the difference.scalemean "as given" (this PR) or "one row per block group" (fipper()'s own default)? "As given" matches/report, and it avoids returning thousands of rows for a state.— Claude (AI assistant), posting from ejanalysis account
🤖 Generated with Claude Code