Skip to content

Commit ef6316f

Browse files
style: deleted unused imports and whitespaces
1 parent 5530736 commit ef6316f

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

pandas/_libs/tslibs/timestamps.pyx

-9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ from pandas._libs.tslibs.conversion cimport (
5959
maybe_localize_tso,
6060
)
6161
from pandas._libs.tslibs.dtypes cimport (
62-
abbrev_to_npy_unit,
6362
npy_unit_to_abbrev,
6463
npy_unit_to_attrname,
6564
periods_per_day,
@@ -2468,38 +2467,30 @@ default 'raise'
24682467
return v
24692468

24702469
if year is not None:
2471-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_Y
24722470
dts.year = validate("year", year)
24732471
rep_reso = NPY_DATETIMEUNIT.NPY_FR_Y
24742472
if month is not None:
2475-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_M
24762473
dts.month = validate("month", month)
24772474
rep_reso = NPY_DATETIMEUNIT.NPY_FR_M
24782475
if day is not None:
2479-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_D
24802476
dts.day = validate("day", day)
24812477
rep_reso = NPY_DATETIMEUNIT.NPY_FR_D
24822478
if hour is not None:
2483-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_h
24842479
dts.hour = validate("hour", hour)
24852480
rep_reso = NPY_DATETIMEUNIT.NPY_FR_h
24862481
if minute is not None:
2487-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_m
24882482
dts.min = validate("minute", minute)
24892483
rep_reso = NPY_DATETIMEUNIT.NPY_FR_m
24902484
if second is not None:
2491-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_s
24922485
dts.sec = validate("second", second)
24932486
rep_reso = NPY_DATETIMEUNIT.NPY_FR_s
24942487
if microsecond is not None:
2495-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_ms
24962488
dts.us = validate("microsecond", microsecond)
24972489
if microsecond > 999:
24982490
rep_reso = NPY_DATETIMEUNIT.NPY_FR_us
24992491
else:
25002492
rep_reso = NPY_DATETIMEUNIT.NPY_FR_ms
25012493
if nanosecond is not None:
2502-
rep_reso = NPY_DATETIMEUNIT.NPY_FR_ns
25032494
dts.ps = validate("nanosecond", nanosecond) * 1000
25042495
rep_reso = NPY_DATETIMEUNIT.NPY_FR_ns
25052496
if tzinfo is not object:

pandas/tests/scalar/timestamp/methods/test_replace.py

-4
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,7 @@ def test_replace_unit(self):
195195
ts = Timestamp("2023-07-15 23:08:12")
196196
ts1 = Timestamp("2023-07-15 23:08:12.134567")
197197
ts2 = Timestamp("2023-07-15 23:08:12.134567123")
198-
199198
ts = ts.replace(microsecond=ts1.microsecond)
200-
201199
assert ts == ts1
202-
203200
ts = ts.replace(nanosecond=ts2.nanosecond)
204-
205201
assert ts == ts2

0 commit comments

Comments
 (0)