Skip to content

Commit 5d83734

Browse files
committed
geomapper: when converting 'state', default to state_id, but let caller override
1 parent c8f4dab commit 5d83734

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_delphi_utils_python/delphi_utils/geomap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,14 @@ def fips_to_megacounty(
528528
data = data.reset_index().groupby([date_col, mega_col]).sum()
529529
return data.reset_index()
530530

531-
def as_mapper_name(self, geo_type):
531+
def as_mapper_name(self, geo_type, state="state_id"):
532532
"""
533533
Return the mapper equivalent of a region type.
534534
535535
Human-readable names like 'county' will return their mapper equivalents ('fips').
536536
"""
537537
if geo_type == "state":
538-
return "state_code"
538+
return state
539539
if geo_type == "county":
540540
return "fips"
541541
return geo_type

0 commit comments

Comments
 (0)