@@ -2211,10 +2211,8 @@ def _sequence_to_dt64(
2211
2211
data_dtype = getattr (data , "dtype" , None )
2212
2212
2213
2213
out_dtype = DT64NS_DTYPE
2214
- out_reso = abbrev_to_npy_unit (None ) # NPY_FR_GENERIC
2215
2214
if out_unit is not None :
2216
2215
out_dtype = np .dtype (f"M8[{ out_unit } ]" )
2217
- out_reso = abbrev_to_npy_unit (out_unit )
2218
2216
2219
2217
if data_dtype == object or is_string_dtype (data_dtype ):
2220
2218
# TODO: We do not have tests specific to string-dtypes,
@@ -2240,7 +2238,7 @@ def _sequence_to_dt64(
2240
2238
dayfirst = dayfirst ,
2241
2239
yearfirst = yearfirst ,
2242
2240
allow_object = False ,
2243
- out_reso = out_reso ,
2241
+ out_unit = out_unit ,
2244
2242
)
2245
2243
copy = False
2246
2244
if tz and inferred_tz :
@@ -2351,7 +2349,7 @@ def objects_to_datetime64(
2351
2349
utc : bool = False ,
2352
2350
errors : DateTimeErrorChoices = "raise" ,
2353
2351
allow_object : bool = False ,
2354
- out_reso : int = 14 ,
2352
+ out_unit : str | None = None ,
2355
2353
):
2356
2354
"""
2357
2355
Convert data to array of timestamps.
@@ -2367,9 +2365,8 @@ def objects_to_datetime64(
2367
2365
allow_object : bool
2368
2366
Whether to return an object-dtype ndarray instead of raising if the
2369
2367
data contains more than one timezone.
2370
- out_reso : int, default 14
2371
- 14 corresponds to NPY_FR_GENERIC, which indicates to infer
2372
- a resolution.
2368
+ out_unit : str or None, default None
2369
+ None indicates we should do resolution inference.
2373
2370
2374
2371
Returns
2375
2372
-------
@@ -2395,7 +2392,7 @@ def objects_to_datetime64(
2395
2392
utc = utc ,
2396
2393
dayfirst = dayfirst ,
2397
2394
yearfirst = yearfirst ,
2398
- creso = out_reso ,
2395
+ creso = abbrev_to_npy_unit ( out_unit ) ,
2399
2396
)
2400
2397
2401
2398
if tz_parsed is not None :
0 commit comments