Skip to content

Commit 640fe26

Browse files
authored
CLN: remove unused unit argument (#55986)
1 parent 2ab836d commit 640fe26

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

pandas/_libs/tslib.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ cpdef array_to_datetime(
550550
continue
551551

552552
_ts = convert_str_to_tsobject(
553-
val, None, unit="ns", dayfirst=dayfirst, yearfirst=yearfirst
553+
val, None, dayfirst=dayfirst, yearfirst=yearfirst
554554
)
555555
item_reso = _ts.creso
556556
state.update_creso(item_reso)
@@ -715,7 +715,7 @@ cdef _array_to_datetime_object(
715715

716716
try:
717717
tsobj = convert_str_to_tsobject(
718-
val, None, unit="ns", dayfirst=dayfirst, yearfirst=yearfirst
718+
val, None, dayfirst=dayfirst, yearfirst=yearfirst
719719
)
720720
tsobj.ensure_reso(NPY_FR_ns, val)
721721

pandas/_libs/tslibs/conversion.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ cdef _TSObject convert_datetime_to_tsobject(datetime ts, tzinfo tz,
3737
int32_t nanos=*,
3838
NPY_DATETIMEUNIT reso=*)
3939

40-
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz, str unit,
40+
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz,
4141
bint dayfirst=*,
4242
bint yearfirst=*)
4343

pandas/_libs/tslibs/conversion.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ cdef _TSObject convert_to_tsobject(object ts, tzinfo tz, str unit,
280280
obj = _TSObject()
281281

282282
if isinstance(ts, str):
283-
return convert_str_to_tsobject(ts, tz, unit, dayfirst, yearfirst)
283+
return convert_str_to_tsobject(ts, tz, dayfirst, yearfirst)
284284

285285
if checknull_with_nat_and_na(ts):
286286
obj.value = NPY_NAT
@@ -472,7 +472,7 @@ cdef _adjust_tsobject_tz_using_offset(_TSObject obj, tzinfo tz):
472472
check_overflows(obj, obj.creso)
473473

474474

475-
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz, str unit,
475+
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz,
476476
bint dayfirst=False,
477477
bint yearfirst=False):
478478
"""
@@ -488,7 +488,6 @@ cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz, str unit,
488488
Value to be converted to _TSObject
489489
tz : tzinfo or None
490490
timezone for the timezone-aware output
491-
unit : str or None
492491
dayfirst : bool, default False
493492
When parsing an ambiguous date string, interpret e.g. "3/4/1975" as
494493
April 3, as opposed to the standard US interpretation March 4.

0 commit comments

Comments
 (0)