Skip to content

Conversation

@ShaharNaveh
Copy link
Contributor

  • ref Error on C Warnings #32163
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

This are the errors that this PR is getting rid of:

pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_116group_last’:
pandas/_libs/groupby.c:37458:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
37458 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_118group_last’:
pandas/_libs/groupby.c:38233:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
38233 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_120group_last’:
pandas/_libs/groupby.c:39008:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
39008 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_122group_last’:
pandas/_libs/groupby.c:39781:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
39781 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_124group_last’:
pandas/_libs/groupby.c:40563:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
40563 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_128group_nth’:
pandas/_libs/groupby.c:41999:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
41999 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_130group_nth’:
pandas/_libs/groupby.c:42820:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
42820 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_132group_nth’:
pandas/_libs/groupby.c:43641:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
43641 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_134group_nth’:
pandas/_libs/groupby.c:44460:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
44460 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_136group_nth’:
pandas/_libs/groupby.c:45288:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
45288 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_152group_max’:
pandas/_libs/groupby.c:55168:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
55168 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_154group_max’:
pandas/_libs/groupby.c:55970:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
55970 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_156group_max’:
pandas/_libs/groupby.c:56772:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
56772 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_158group_max’:
pandas/_libs/groupby.c:57568:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
57568 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_162group_min’:
pandas/_libs/groupby.c:58985:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
58985 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_164group_min’:
pandas/_libs/groupby.c:59784:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
59784 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_166group_min’:
pandas/_libs/groupby.c:60583:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
60583 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
      |                              ^~
pandas/_libs/groupby.c: In function ‘__pyx_pf_6pandas_5_libs_7groupby_168group_min’:
pandas/_libs/groupby.c:61376:30: warning: comparison of integer expressions of different signedness: ‘Py_ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
61376 |   __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);

@ShaharNaveh ShaharNaveh added the Build Library building on various platforms label Mar 17, 2020
if not len(values) == len(labels):
# NOTE:
# Casting to avoid build warnings
if not len(values) == <Py_ssize_t>len(labels):
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to get the same result without casting? Maybe labels.shape[0] for memory views?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@WillAyd It works!


Just so I know for future times, are we trying to avoid casting?

or casting is not possible with memory views?

Copy link
Member

Choose a reason for hiding this comment

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

If there's an easily available approach that doesn't require casting then should almost always go that route

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm if green - @jbrockmendel

@jbrockmendel
Copy link
Member

LGTM. Might want to open an issue with cython; i think in theory these are supposed to be equivalent

@WillAyd
Copy link
Member

WillAyd commented Mar 18, 2020 via email

@ShaharNaveh
Copy link
Contributor Author

Looks like also part of 3.0 release cython/cython#2992

Sent from my iPhone
On Mar 17, 2020, at 6:16 PM, jbrockmendel @.***> wrote:  LGTM. Might want to open an issue with cython; i think in theory these are supposed to be equivalent — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

That's great!


In ea678f0 I have added "TODO" notes, to revert this code change.

@jreback jreback added this to the 1.1 milestone Mar 19, 2020
@jreback jreback merged commit e77f09c into pandas-dev:master Mar 19, 2020
@jreback
Copy link
Contributor

jreback commented Mar 19, 2020

thanks @MomIsBestFriend

@ShaharNaveh ShaharNaveh deleted the BLD-cast-silence-bld-warnings branch March 20, 2020 00:05
@ShaharNaveh ShaharNaveh mentioned this pull request Mar 21, 2020
5 tasks
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Mar 23, 2020
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Library building on various platforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants