Skip to content

TST: Added regression test #41436

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
May 13, 2021
Merged
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
15 changes: 15 additions & 0 deletions pandas/tests/indexing/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@


class TestDatetimeIndex:
def test_datetimeindex_transpose_empty_df(self):
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you post the link on purpose instead of only the reference like GH#xxx ? If yes, ok for me

Copy link
Member Author

@ShaharNaveh ShaharNaveh May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, on (some) terminal emulators, clicking on the link will auto open them.
Also when seeing the code via a browser, it's easier to copy it, and paste it in the URL bar, or highlighting the URL and right-clicking and select "open in a new tab". instead of: copying the number and then searching it in the issues tab.


TL;DR

This is for convenience, but not a deal breaker. I can have it as GH#XXXX if it's a deal breaker:)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion, would prefer consistency, but if you have a strong optinion this is fine with me

Regression test for:
https://github.com/pandas-dev/pandas/issues/41382
"""
df = DataFrame(index=pd.DatetimeIndex([]))

expected = pd.DatetimeIndex([], dtype="datetime64[ns]", freq=None)

result1 = df.T.sum().index
result2 = df.sum(axis=1).index

tm.assert_index_equal(result1, expected)
tm.assert_index_equal(result2, expected)

def test_indexing_with_datetime_tz(self):

# GH#8260
Expand Down