File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -913,10 +913,17 @@ def try_datetime(v):
913
913
# we might have a sequence of the same-datetimes with tz's
914
914
# if so coerce to a DatetimeIndex; if they are not the same,
915
915
# then these stay as object dtype
916
+
917
+ # GH19671
918
+ # replaced to_datetime call with
919
+ # tslibs.conversion.datetime_to_datetime64
920
+ # in order to avoid changes to public to_datetime API
916
921
try :
917
- from pandas import to_datetime
918
- # GH19671
919
- return to_datetime (v , require_iso8601 = True )
922
+ from pandas ._libs .tslibs import conversion
923
+ from pandas .core .indexes .datetimes import DatetimeIndex
924
+
925
+ values , tz = conversion .datetime_to_datetime64 (v )
926
+ return DatetimeIndex ._simple_new (values , tz = tz )
920
927
except Exception :
921
928
pass
922
929
You can’t perform that action at this time.
0 commit comments