Skip to content

Fix nightly test failures#11204

Merged
jsignell merged 3 commits intopydata:mainfrom
jsignell:fix-upstream
Mar 10, 2026
Merged

Fix nightly test failures#11204
jsignell merged 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

Copy link
Contributor

Choose a reason for hiding this comment

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

If we actually do want to cast the pandas string dtype to a numpy string dtype,

I think at the moment we do; and then relax it intentionally. However, we seem to have done pretty badly at that haha. Things seem to keep breaking.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok so something to keep working towards, but for the purposes of getting CI green again, maybe no worse than it was before is fine for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes absolutely

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just figured numpy might have got a better system for passing parameter information around

yeah i think ufuncs have better python-accessible signatures now

@jsignell
Copy link
Member Author

@keewis it looks like these are affecting CI on main now. Is there anything you want me to change?

@keewis
Copy link
Collaborator

keewis commented Mar 10, 2026

sorry, I've been a bit absent. Yes, let's merge and continue working on the pandas dtypes afterwards.

@jsignell jsignell merged commit a8c2620 into pydata:main Mar 10, 2026
52 of 53 checks passed
@jsignell jsignell deleted the fix-upstream branch March 10, 2026 18:21
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

3 participants