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: update tests for numpy 1.20 change to floordiv #38172

Merged
merged 6 commits into from
Nov 30, 2020

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Looks like numpy/numpy#16161 changed numpy's floordiv behavior

@jbrockmendel
Copy link
Member Author

Yikes, I got this passing, but i have no earthly idea what is going on in the Sparse tests

if mask.any():
expected[mask] = np.nan
condition = _np_version_under1p20
if isinstance(a_dense, np.ndarray) and isinstance(b_dense, np.ndarray):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add some comments here on what is changed, it is non-obvious from inspection what is changing (e.g. what is true in prior version and what is true now)

Copy link
Member Author

Choose a reason for hiding this comment

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

yah as mentioned above, i have no frikkin idea what the underlying logic is here

condition = _np_version_under1p20
if isinstance(a_dense, np.ndarray) and isinstance(b_dense, np.ndarray):
condition = True
if a_dense.dtype == np.float64 and np.isnan(a.fill_value):
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems really fragile

@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label Nov 30, 2020
@jreback
Copy link
Contributor

jreback commented Nov 30, 2020

can we push an xfail for this case for now? (and debug / followup with this PR later).

@simonjayhawkins simonjayhawkins added this to the 1.1.5 milestone Nov 30, 2020
@simonjayhawkins
Copy link
Member

failing on 1.1.x as well, so will want to try to backport this.

@jreback
Copy link
Contributor

jreback commented Nov 30, 2020

agreed with the above
let's just xfail for now and backport

@jbrockmendel
Copy link
Member Author

updated to xfail

@jbrockmendel
Copy link
Member Author

narrowed down the xfails a little bit

@@ -29,7 +31,7 @@ class TestSparseArrayArithmetics:
def _assert(self, a, b):
tm.assert_numpy_array_equal(a, b)

def _check_numeric_ops(self, a, b, a_dense, b_dense, mix, op):
def _check_numeric_ops(self, a, b, a_dense, b_dense, mix, op, flag=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

what is flag for?

Copy link
Member Author

Choose a reason for hiding this comment

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

leftover from previous attempt at a fix, will remove

@jreback jreback merged commit 2a4d3fe into pandas-dev:master Nov 30, 2020
@jreback
Copy link
Contributor

jreback commented Nov 30, 2020

thanks @jbrockmendel (feel free to open an issue to address this, no hurry now).

@simonjayhawkins
Copy link
Member

@meeseeksdev backport 1.1.x

@jbrockmendel jbrockmendel deleted the ci-npdev-floordiv branch November 30, 2020 18:48
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Nov 30, 2020
simonjayhawkins pushed a commit that referenced this pull request Nov 30, 2020
#38191)

Co-authored-by: jbrockmendel <jbrockmendel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants