@@ -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,
@@ -2239,7 +2237,7 @@ def _sequence_to_dt64(
2239
2237
dayfirst = dayfirst ,
2240
2238
yearfirst = yearfirst ,
2241
2239
allow_object = False ,
2242
- out_reso = out_reso ,
2240
+ out_unit = out_unit ,
2243
2241
)
2244
2242
copy = False
2245
2243
if tz and inferred_tz :
@@ -2350,7 +2348,7 @@ def objects_to_datetime64(
2350
2348
utc : bool = False ,
2351
2349
errors : DateTimeErrorChoices = "raise" ,
2352
2350
allow_object : bool = False ,
2353
- out_reso : int = 14 ,
2351
+ out_unit : str | None = None ,
2354
2352
):
2355
2353
"""
2356
2354
Convert data to array of timestamps.
@@ -2366,9 +2364,8 @@ def objects_to_datetime64(
2366
2364
allow_object : bool
2367
2365
Whether to return an object-dtype ndarray instead of raising if the
2368
2366
data contains more than one timezone.
2369
- out_reso : int, default 14
2370
- 14 corresponds to NPY_FR_GENERIC, which indicates to infer
2371
- a resolution.
2367
+ out_unit : str or None, default None
2368
+ None indicates we should do resolution inference.
2372
2369
2373
2370
Returns
2374
2371
-------
@@ -2394,7 +2391,7 @@ def objects_to_datetime64(
2394
2391
utc = utc ,
2395
2392
dayfirst = dayfirst ,
2396
2393
yearfirst = yearfirst ,
2397
- creso = out_reso ,
2394
+ creso = abbrev_to_npy_unit ( out_unit ) ,
2398
2395
)
2399
2396
2400
2397
if tz_parsed is not None :
0 commit comments