An error is thrown when supplying a state fips code as the state argument for pygris.counties() and other functions that call validate_state().
>>> pygris.counties(33, year = 2020)
File "PATH\Lib\site-packages\pygris\enumeration_units.py", line 92, in counties
valid_state = [validate_state(x) for x in state]
^^^^^^^^^^^^^^^^^
File "PATH\Lib\site-packages\pygris\helpers.py", line 81, in validate_state
state = state.lower()
^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'lower'
validate_state() calls state.lower() before checking if state is numeric, causing this error. This could be solved be moving the numeric check to the top of validate_state.
An error is thrown when supplying a state fips code as the state argument for
pygris.counties()
and other functions that callvalidate_state()
.validate_state()
calls state.lower() before checking if state is numeric, causing this error. This could be solved be moving the numeric check to the top ofvalidate_state
.