-
-
Notifications
You must be signed in to change notification settings - Fork 19k
BUG: Remove special-casing for date objects in DatetimeIndex indexing (GH#62158) #62198
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
761ac0e
29662c0
2f98bd4
69ae807
7441046
149b9c4
6c8b76a
0a0f582
30a87b4
f8e4974
610868f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2132,17 +2132,17 @@ def test_dtype_on_categorical_dates(self): | |
|
||
expected_outer = DataFrame( | ||
[ | ||
[pd.Timestamp("2001-01-01").date(), 1.1, 1.3], | ||
[pd.Timestamp("2001-01-02").date(), 1.3, np.nan], | ||
[pd.Timestamp("2001-01-03").date(), np.nan, 1.4], | ||
[date(2001, 1, 1), 1.1, 1.3], | ||
[date(2001, 1, 2), 1.3, np.nan], | ||
[date(2001, 1, 3), np.nan, 1.4], | ||
], | ||
columns=["date", "num2", "num4"], | ||
) | ||
result_outer = merge(df, df2, how="outer", on=["date"]) | ||
tm.assert_frame_equal(result_outer, expected_outer) | ||
|
||
expected_inner = DataFrame( | ||
[[pd.Timestamp("2001-01-01").date(), 1.1, 1.3]], | ||
[[date(2001, 1, 1), 1.1, 1.3]], | ||
|
||
columns=["date", "num2", "num4"], | ||
) | ||
result_inner = merge(df, df2, how="inner", on=["date"]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -763,7 +763,8 @@ def test_align_date_objects_with_datetimeindex(self): | |
|
||
ts_slice = ts[5:] | ||
ts2 = ts_slice.copy() | ||
ts2.index = [x.date() for x in ts2.index] | ||
# Explicitly convert date objects to Timestamps for alignment | ||
ts2.index = [pd.Timestamp(x.date()) for x in ts2.index] | ||
|
||
|
||
result = ts + ts2 | ||
result2 = ts2 + ts | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment here pointing back to the issue saying the behavior changed