-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: add test for non UTC datetime split #14042 #32866
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
Conversation
|
||
def test_split_non_utc(self): | ||
indices = pd.date_range("2016-01-01 00:00:00+0200", freq="S", periods=10) | ||
split_indices = np.split(indices, indices_or_sections=[]) |
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.
Could you name these variables result
and expected
so the comparison below can be
tm.assert_index_equal(result, expected)
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.
are there enough functions like np.split to merit a file like tests.indexes.datetimes.test_numpy_compat?
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.
@mroeschke right, done.
@jbrockmendel np.split is the only function I know for which such an issue occurred. But this is my first PR for this project so maybe there are others that I haven't noticed.
"2016-01-01 00:00:08+02:00", | ||
"2016-01-01 00:00:09+02:00", | ||
] | ||
) |
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.
this is the same as indices
but without a a freq, right? if so, can you construct it as
expected = index.copy()
expected._set_freq(None)
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.
Yes, thanks
thanks @JDkuba |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff