@@ -95,12 +95,15 @@ def classic(
95
95
self ,
96
96
fields : Optional [Sequence [str ]] = None ,
97
97
disable_date_parsing : Optional [bool ] = False ,
98
+ disable_type_parsing : Optional [bool ] = False ,
98
99
) -> EpiDataResponse :
99
100
"""Request and parse epidata in CLASSIC message format."""
100
101
self ._verify_parameters ()
101
102
try :
102
103
response = self ._call (fields )
103
104
r = cast (EpiDataResponse , response .json ())
105
+ if disable_type_parsing :
106
+ return r
104
107
epidata = r .get ("epidata" )
105
108
if epidata and isinstance (epidata , list ) and len (epidata ) > 0 and isinstance (epidata [0 ], dict ):
106
109
r ["epidata" ] = [self ._parse_row (row , disable_date_parsing = disable_date_parsing ) for row in epidata ]
@@ -115,7 +118,7 @@ def __call__(
115
118
) -> Union [EpiDataResponse , DataFrame ]:
116
119
"""Request and parse epidata in df message format."""
117
120
if self .only_supports_classic :
118
- return self .classic (fields , disable_date_parsing = disable_date_parsing )
121
+ return self .classic (fields , disable_date_parsing = disable_date_parsing , disable_type_parsing = False )
119
122
return self .df (fields , disable_date_parsing = disable_date_parsing )
120
123
121
124
def df (
@@ -127,7 +130,7 @@ def df(
127
130
if self .only_supports_classic :
128
131
raise OnlySupportsClassicFormatException ()
129
132
self ._verify_parameters ()
130
- json = self .classic (fields , disable_date_parsing = disable_date_parsing )
133
+ json = self .classic (fields , disable_type_parsing = True )
131
134
rows = json .get ("epidata" , [])
132
135
pred = fields_to_predicate (fields )
133
136
columns : List [str ] = [info .name for info in self .meta if pred (info .name )]
0 commit comments