-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
CI/TST: fix failing tests in py37_np_dev #31091
Conversation
d3fb402
to
a8003e9
Compare
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.
lgtm if green
I think would need to back port as well |
I think we do, as this error message is an external error message. |
@jorisvandenbossche I am with you on not testing the error messages from external packages, here we got "lucky" (only 5 instances) but could easily be 40+ (and even more) if something else would have changed. Any idea on how to mark error messages from external packages? |
Posted in the wrong thread 🤦♂️ |
gentle ping @WillAyd ; |
@@ -218,7 +218,7 @@ def test_take_fill_value(): | |||
with pytest.raises(ValueError, match=msg): | |||
idx.take(np.array([1, 0, -5]), fill_value=True) | |||
|
|||
msg = "index -5 is out of bounds for size 4" | |||
msg = "index -5 is out of bounds for( axis 0 with|) size 4" |
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.
nitpick: small preference for "( axis 0 with)?" over "( axis 0 with|)"
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.
(ok for follow-up, since getting the CI working quickly will be nice)
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
Looks like need to manually backport @Momisbestfriend mind doing that? |
@WillAyd sure! |
I just checked it again, and this is not an external error message. pandas/pandas/core/indexes/range.py Line 698 in a72eef5
And it's located in: # class RangeIndex(Int64Index):
def __getitem__(self, key):
"""
Conserve RangeIndex type for scalar and slice keys.
"""
if isinstance(key, slice):
new_range = self._range[key]
return self._simple_new(new_range, name=self.name)
elif is_integer(key):
new_key = int(key)
try:
return self._range[new_key]
except IndexError:
raise IndexError(
f"index {key} is out of bounds for axis 0 with size {len(self)}"
)
elif is_scalar(key):
raise IndexError(
"only integers, slices (`:`), "
"ellipsis (`...`), numpy.newaxis (`None`) "
"and integer or boolean "
"arrays are valid indices"
)
# fall back to Int64Index
return super().__getitem__(key) I think that a future version of numpy will break cc (@WillAyd, @jreback, @jbrockmendel) |
That's only for RangeIndex (where we mimic numpy's behaviour and error messages), for all other cases it comes from numpy I think?
How do you mean? |
@jorisvandenbossche Now that you explained that
I don't think that a future version of numpy will break Thank you for your explanation :) |
No description provided.