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

BUG: resample.agg with read-only data #32758

Merged
merged 6 commits into from
Mar 17, 2020
Merged

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel added this to the 1.0.3 milestone Mar 16, 2020
# check for is_list_like/slice instead of is_scalar to allow non-standard
# scalars through, e.g. cftime.datetime needed by xarray
# https://github.com/pydata/xarray/issues/3751
key_is_scalar = not is_list_like(key) and not isinstance(key, slice)
Copy link
Member

Choose a reason for hiding this comment

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

This sneaked in from a different issue / pr?

Copy link
Member Author

Choose a reason for hiding this comment

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

looks like it, will revert, thanks

@cython.wraparound(False)
@cython.boundscheck(False)
def group_last(rank_t[:, :] out,
int64_t[:] counts,
rank_t[:, :] values,
ndarray[rank_t, ndim=2] values,
Copy link
Member

Choose a reason for hiding this comment

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

Does this limitation really apply to any place where we are using memoryviews? Or just isolated to this?

Copy link
Member Author

Choose a reason for hiding this comment

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

my understanding is that it applies to memoryviews with fused types

@jreback jreback added Bug Resample resample method labels Mar 17, 2020
@jreback jreback merged commit 5351732 into pandas-dev:master Mar 17, 2020
@jreback
Copy link
Contributor

jreback commented Mar 17, 2020

thanks @jbrockmendel

@WillAyd
Copy link
Member

WillAyd commented Mar 17, 2020

Just a heads up I think this introduced some new build warnings. I've had a separate PR to clean those up and error going forward so can fall back to that if required, but if you have time to look in the interim would be appreciated as well

Here is what I see

pandas/_libs/groupby.c:37458:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:38233:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:39008:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:39781:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:40563:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:41999:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:42820:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:43641:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:44460:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:45288:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/hashtable.c:63216:20: warning: unused function '__pyx_memview_get_object' [-Wunused-function]
  static PyObject *__pyx_memview_get_object(const char *itemp) {
                   ^
pandas/_libs/hashtable.c:63221:12: warning: unused function '__pyx_memview_set_object' [-Wunused-function]
static int __pyx_memview_set_object(const char *itemp, PyObject *obj) {
           ^
pandas/_libs/groupby.c:55168:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:55970:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:56772:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:57568:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:58985:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:59784:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:60583:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~
pandas/_libs/groupby.c:61376:30: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
  __pyx_t_3 = ((!((__pyx_t_2 == __pyx_t_1) != 0)) != 0);
                   ~~~~~~~~~ ^  ~~~~~~~~~

jorisvandenbossche pushed a commit that referenced this pull request Mar 17, 2020
Co-authored-by: jbrockmendel <jbrockmendel@gmail.com>
@jbrockmendel
Copy link
Member Author

@WillAyd where does this sit on the annoyance-problem scale? i.e. is waiting for cython 0.30 a viable option?

SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError: buffer source array is read-only
4 participants