Skip to content

Commit 6c79a28

Browse files
committed
feat: use get_args to avoid duplication
1 parent d199f0f commit 6c79a28

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

delphi_epidata/_covidcast.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Tuple,
1515
Union,
1616
overload,
17+
get_args,
1718
)
1819
from functools import cached_property
1920
from pandas import DataFrame
@@ -65,10 +66,10 @@ def define_covidcast_fields() -> List[EpidataFieldInfo]:
6566
EpidataFieldInfo(
6667
"geo_type",
6768
EpidataFieldType.categorical,
68-
categories=["nation", "msa", "hrr", "hhs", "state", "county"],
69+
categories=list(get_args(GeoType)),
6970
),
7071
EpidataFieldInfo("geo_value", EpidataFieldType.text),
71-
EpidataFieldInfo("time_type", EpidataFieldType.categorical, categories=["day", "week"]),
72+
EpidataFieldInfo("time_type", EpidataFieldType.categorical, categories=list(get_args(TimeType))),
7273
EpidataFieldInfo("time_value", EpidataFieldType.date),
7374
EpidataFieldInfo("issue", EpidataFieldType.date),
7475
EpidataFieldInfo("lag", EpidataFieldType.int),

0 commit comments

Comments
 (0)