Skip to content

Fix nightly test failures#11204

Open
jsignell wants to merge 3 commits intopydata:mainfrom
jsignell:fix-upstream
Open

Fix nightly test failures#11204
jsignell wants to merge 3 commits intopydata:mainfrom
jsignell:fix-upstream

Conversation

@jsignell
Copy link
Member

@jsignell jsignell commented Feb 26, 2026

@jsignell jsignell linked an issue Feb 26, 2026 that may be closed by this pull request
2 tasks
@jsignell jsignell added the run-upstream Run upstream CI label Feb 26, 2026
@jsignell jsignell requested a review from keewis February 26, 2026 22:22
Copy link
Collaborator

@keewis keewis left a comment

Choose a reason for hiding this comment

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

thanks for taking this on.

This looks good to me in general, but there might be a few things that we could do differently (especially the numpy.fix support I believe we can deprecate or drop)

Comment on lines +2649 to 2652
@pytest.mark.filterwarnings("ignore:numpy.fix is deprecated.")
def test_fix() -> None:
val = 3.0
val_fixed = np.fix(val)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could also just remove (or deprecate?) support for fix, there's a clear alternative in np.trunc that does the same and is more efficient

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah sorry I meant to put notes on each of these. I looked at the PR where this was added and it was specifically resolving an infinite recursion that was possible within apply_ufunc for certain kwargs. I just checked and you don't get the same recursion issue with np.trunc. So I think the alternative is to delete the test.

Comment on lines 214 to 217
try:
result_type = dtypes.result_type(*original_coords)
except TypeError:
except (TypeError, ValueError):
pass
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this was only supposed to cast object dtype arrays to numpy string, in which case this is fine.

If we actually do want to cast the pandas string dtype to a numpy string dtype, however, we may need to change that (@dcherian, do you remember what our policy on pandas dtypes was?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Right yeah there might be something else that needs doing to support these more completely. For instance you can't write them to netcdf or zarr, but I tested with older versions of pandas/numpy and it looks like this test has always hit this except it's just the type changed from TypeError to ValueError

Comment on lines -4911 to -4912
with pytest.raises(ValueError):
_get_func_args(np.power, [])
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you know what about numpy.power changed? I can't find a PR / changelog entry other than one that changes its behavior on a old CPU architecture (AIX)

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't find any information specifically on np.power but from reading the comments on the original PR it seemed like sometimes function parameters weren't discoverable by inspect.signature my understanding is that this had to do with how ufuncs are constructed in numpy or possibly it has to do with C based functions. I just figured numpy might have got a better system for passing parameter information around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-upstream Run upstream CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚠️ Nightly upstream-dev CI failed ⚠️ 2 tests failures

2 participants