-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: Fix construction of PeriodIndex from strings #33304
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
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.
Thanks @dsaxton for the PR
|
||
@pytest.mark.parametrize("klass", [list, tuple, np.array, pd.Series]) | ||
def test_period_index_construction_from_strings(klass): | ||
result = PeriodIndex(klass(["2020Q1", "2020Q2", "2020Q3", "2020Q4"]), freq="Q") |
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.
can you do data = ...
so that result = statement is the bit being tested. (i.e. we are not testing the klass constructor)
can you also use the data from the OP, since that was not monotonic
|
||
|
||
@pytest.mark.parametrize("klass", [list, tuple, np.array, pd.Series]) | ||
def test_period_index_construction_from_strings(klass): |
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.
can you add the issue number.
@@ -868,3 +868,10 @@ def test_searchsorted_datetimelike_with_listlike_invalid_dtype(values, arg): | |||
msg = "[Unexpected type|Cannot compare]" | |||
with pytest.raises(TypeError, match=msg): | |||
values.searchsorted(arg) | |||
|
|||
|
|||
@pytest.mark.parametrize("klass", [list, tuple, np.array, pd.Series]) |
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 maybe add these cases to test_period_array_ok instead/as well.
Thanks for the feedback @simonjayhawkins . Do you know by chance what's happening in the CI? The error is cryptic and seems unrelated: https://dev.azure.com/pandas-dev/e01c9671-576d-40f3-a1a1-7bef78604087/_apis/build/builds/32518/logs/72 |
The failurs actually seem related to me. Eg on one of the builds (https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=32640&view=logs&jobId=a67b4c4c-cd2e-5e3c-a361-de73ac9c05f9&j=a67b4c4c-cd2e-5e3c-a361-de73ac9c05f9&t=33d2fdd0-c376-5f94-e6d3-957bdd23a3b8) I see
which is at least period related. |
thanks @dsaxton |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff