Skip to content

BUG: Regression #18075 | Fixing Ufunc TD generation order#18751

Merged
charris merged 2 commits intonumpy:mainfrom
ganesh-k13:reg_18075
Apr 12, 2021
Merged

BUG: Regression #18075 | Fixing Ufunc TD generation order#18751
charris merged 2 commits intonumpy:mainfrom
ganesh-k13:reg_18075

Conversation

@ganesh-k13
Copy link
Copy Markdown
Member

@ganesh-k13 ganesh-k13 commented Apr 11, 2021

RCA:

Reason: TD order of floor divide ufunc got changed. Expected signed before unsigned.
Escape Reason: Testplan gap, Execution gap

Found By:

pandas-dev/pandas#40874

UT Added: Yes

Note: Please let me know if we need to move it somewhere else

cc: @seberg

@ganesh-k13
Copy link
Copy Markdown
Member Author

ganesh-k13 commented Apr 11, 2021

Ok so a couple of doubts :) :

  1. How did an upcast happen and only for unsigned and particualry to int16 if we put uints after sints?
  2. So dispatch is not needed for all the types mentioned for a given TD?

@seberg
Copy link
Copy Markdown
Member

seberg commented Apr 11, 2021

NumPy picks the first loop that "works" right now (that is defined by "safe casting", although I don't like that way of thinking about it much). So bool can cast to anything, so that means the first loop is taken. But (especially for scalars!) the correct order is important. (I am myself now a bit confused why 0-D arrays seem cased ;), but lets not worry about it)

@charris charris merged commit 7a81299 into numpy:main Apr 12, 2021
@charris
Copy link
Copy Markdown
Member

charris commented Apr 12, 2021

Thanks @ganesh-k13 .

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants