@@ -1165,22 +1165,38 @@ def converter(*date_cols, col: Hashable):
1165
1165
return result ._values
1166
1166
else :
1167
1167
try :
1168
- result = tools .to_datetime (
1169
- date_parser (* (unpack_if_single_element (arg ) for arg in date_cols )),
1170
- errors = "ignore" ,
1171
- cache = cache_dates ,
1172
- )
1168
+ with warnings .catch_warnings ():
1169
+ warnings .filterwarnings (
1170
+ "ignore" ,
1171
+ ".*parsing datetimes with mixed time zones "
1172
+ "will raise a warning" ,
1173
+ category = FutureWarning ,
1174
+ )
1175
+ result = tools .to_datetime (
1176
+ date_parser (
1177
+ * (unpack_if_single_element (arg ) for arg in date_cols )
1178
+ ),
1179
+ errors = "ignore" ,
1180
+ cache = cache_dates ,
1181
+ )
1173
1182
if isinstance (result , datetime .datetime ):
1174
1183
raise Exception ("scalar parser" )
1175
1184
return result
1176
1185
except Exception :
1177
- return tools .to_datetime (
1178
- parsing .try_parse_dates (
1179
- parsing .concat_date_cols (date_cols ),
1180
- parser = date_parser ,
1181
- ),
1182
- errors = "ignore" ,
1183
- )
1186
+ with warnings .catch_warnings ():
1187
+ warnings .filterwarnings (
1188
+ "ignore" ,
1189
+ ".*parsing datetimes with mixed time zones "
1190
+ "will raise a warning" ,
1191
+ category = FutureWarning ,
1192
+ )
1193
+ return tools .to_datetime (
1194
+ parsing .try_parse_dates (
1195
+ parsing .concat_date_cols (date_cols ),
1196
+ parser = date_parser ,
1197
+ ),
1198
+ errors = "ignore" ,
1199
+ )
1184
1200
1185
1201
return converter
1186
1202
0 commit comments