This is because the id contains level and reportingunitid, but if you request fipscode-level data there is no reportingunitid value.
This could be solved in two ways:
Forbid users from using --results-level fipscode in the API and the CLI, with a helpful error message suggesting they use the ru level, since it rolls up to the county level
Allow ids to be composed using self.reportingunitid or self.fipscode in the models
Not a blocker for our project, but being able to request less data (for those not using New England townships) would help make pipelines faster, and either way having a valid option that results in duplicate/invalid ids can introduce annoying bugs.
You can see the issue in even the first few rows of data from 2016 (see
1683-polid-1702-None
and1683-polid-64583-None
):This is because the
id
containslevel
andreportingunitid
, but if you requestfipscode
-level data there is noreportingunitid
value.This could be solved in two ways:
--results-level fipscode
in the API and the CLI, with a helpful error message suggesting they use theru
level, since it rolls up to the county levelid
s to be composed usingself.reportingunitid or self.fipscode
in the modelsNot a blocker for our project, but being able to request less data (for those not using New England townships) would help make pipelines faster, and either way having a valid option that results in duplicate/invalid
id
s can introduce annoying bugs.