Skip to content
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: nighlty numpy broke ci #47391

Closed
phofl opened this issue Jun 16, 2022 · 5 comments · Fixed by #47393
Closed

CI: nighlty numpy broke ci #47391

phofl opened this issue Jun 16, 2022 · 5 comments · Fixed by #47393
Labels
CI Continuous Integration Upstream issue Issue related to pandas dependency
Milestone

Comments

@phofl
Copy link
Member

phofl commented Jun 16, 2022

It looks like the new numpy nightly wheel broke our ci.

https://github.com/pandas-dev/pandas/runs/6919550144?check_suite_focus=true First failing build today

@phofl phofl added CI Continuous Integration Upstream issue Issue related to pandas dependency labels Jun 16, 2022
@phofl
Copy link
Member Author

phofl commented Jun 16, 2022

Probably due to numpy/numpy#21437

@mroeschke
Copy link
Member

I opened up numpy/numpy#21784 for an example in our CI where this is failing cc @seberg

@seberg
Copy link
Contributor

seberg commented Jun 16, 2022

Sorry, I guess I did not check pandas. There are two changes:

  1. arr.fill() is a bit different, this causes ValueError when assigning NaN into an integer array.
  2. There will be a lot of warnings about invalid casts, there are two categories (probably):
    • Casting nan or inf (or out of bounds values) to integer will cause a RuntimeWarning("invalid value...") (this may not always be the case for out of bounds values).
    • Casting for example 2**300 to a float32, will cause a RuntimeWarning("overflow ...")

My hope is that the second one is a bit of a chore, but requires only a few tests to be updated or np.errstate(invalid="ignore") calls to be added.
The first (arr.fill change)... While intentional, maybe we have to work around it for pandas?

@mroeschke
Copy link
Member

At least in the example I posted in numpy/numpy#21784, this was being hit in a code block that also has

if length and is_integer_dtype(dtype) and isna(value):
# coerce if we have nan for an integer dtype
dtype = np.dtype("float64")

So not sure why length is a necessary condition but I can try dropping it to see what happens to work around the arr.fill change

@seberg
Copy link
Contributor

seberg commented Jun 16, 2022

Yeah, that condition looks strange, why fill an empty array? But it does looks like logic to decide whether the result should be int, or needs to be float64 (to hold NaNs)?
For example if pandas is to fill an empty integer array with NaN/NA it can maybe reasonably decide to avoid upcasting to float64.

@jreback jreback added this to the 1.4.3 milestone Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Upstream issue Issue related to pandas dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants