Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alonme committed Dec 3, 2022
1 parent 597b516 commit 997f50d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2974,10 +2974,11 @@ def test_loc_periodindex_3_levels():
@pytest.mark.parametrize("utc", [False, True])
def test_loc_datetime_assignment_dtype_does_not_change(utc):
# GH#49837
df = pd.DataFrame(
df = DataFrame(
{
# Checking with and without UTC as the original bug didn't occur with utc=True
"date": pd.to_datetime(
# Checking with and without UTC as the original bug didn't occur
# for utc=True
"date": to_datetime(
[datetime(2022, 1, 20), datetime(2022, 1, 22)], utc=utc
),
"update": [True, False],
Expand All @@ -2987,7 +2988,7 @@ def test_loc_datetime_assignment_dtype_does_not_change(utc):
expected = df.copy(deep=True)

update_df = df[df["update"]]
df.loc[df["update"], ["date"]] = update_df["date"])
df.loc[df["update"], ["date"]] = update_df["date"]

tm.assert_frame_equal(df, expected)

Expand Down

0 comments on commit 997f50d

Please sign in to comment.