Skip to content

CLN: remove unused unit argument #55986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/_libs/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ cpdef array_to_datetime(
continue

_ts = convert_str_to_tsobject(
val, None, unit="ns", dayfirst=dayfirst, yearfirst=yearfirst
val, None, dayfirst=dayfirst, yearfirst=yearfirst
)
item_reso = _ts.creso
state.update_creso(item_reso)
Expand Down Expand Up @@ -716,7 +716,7 @@ cdef _array_to_datetime_object(

try:
tsobj = convert_str_to_tsobject(
val, None, unit="ns", dayfirst=dayfirst, yearfirst=yearfirst
val, None, dayfirst=dayfirst, yearfirst=yearfirst
)
tsobj.ensure_reso(NPY_FR_ns, val)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/conversion.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cdef _TSObject convert_datetime_to_tsobject(datetime ts, tzinfo tz,
int32_t nanos=*,
NPY_DATETIMEUNIT reso=*)

cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz, str unit,
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz,
bint dayfirst=*,
bint yearfirst=*)

Expand Down
5 changes: 2 additions & 3 deletions pandas/_libs/tslibs/conversion.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ cdef _TSObject convert_to_tsobject(object ts, tzinfo tz, str unit,
obj = _TSObject()

if isinstance(ts, str):
return convert_str_to_tsobject(ts, tz, unit, dayfirst, yearfirst)
return convert_str_to_tsobject(ts, tz, dayfirst, yearfirst)

if checknull_with_nat_and_na(ts):
obj.value = NPY_NAT
Expand Down Expand Up @@ -473,7 +473,7 @@ cdef _adjust_tsobject_tz_using_offset(_TSObject obj, tzinfo tz):
check_overflows(obj, obj.creso)


cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz, str unit,
cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz,
bint dayfirst=False,
bint yearfirst=False):
"""
Expand All @@ -489,7 +489,6 @@ cdef _TSObject convert_str_to_tsobject(str ts, tzinfo tz, str unit,
Value to be converted to _TSObject
tz : tzinfo or None
timezone for the timezone-aware output
unit : str or None
dayfirst : bool, default False
When parsing an ambiguous date string, interpret e.g. "3/4/1975" as
April 3, as opposed to the standard US interpretation March 4.
Expand Down