-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ValueError: buffer source array is read-only #31710
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
Comments
I think I've found a related issue with
... and this then raises an exception as above:
Interesting, huh? FWIW I originally ran into this when using Google's BigQuery python client to retrieve data from a table with an array-type field. When retrieved via |
@jbrockmendel you think this is essentially unfixable until we use cython>=0.30? If so, let's remove it from the 1.0.2 milestone. |
It's viable, just invasive and a hassle, whereas with cython 0.30 it should be a 1-liner. Depends on when we expect that to be available cc @scoder? |
This year. :) |
(Remember that the good thing about Cython is that you can control when and how the C code is generated, so you're rather free to use whatever released or unreleased Cython package you want, as long as you test it sufficiently on your side. That said, it's obviously easier to use a proper PyPI release, that's why I'd like to get at least something out soon.) |
(Also, the "miniscule change" for this feature is only small in Cython's master/3.0 branch. It's not quite that small in a backport.) |
@scoder thanks for the rundown. Big releases aren't easy, and we appreciate all the time and effort you put in. @TomAugspurger I'm inclined to push this off to 1.0.3 as long as we have lower-hanging-fruit regressions to handle |
Agreed. |
Do we know what caused this regression? Because if this was supported before with cython < 0.30, why is it hard to support it now with that cython version? |
Code Sample, a copy-pastable example if possible
Problem description
Groupby fails on some read-only buffers (I couldn't quickly reproduce it with
.groupby()
itself, sorry).The prime solution would be to add
const
specifier to the inputvalues
here (and related entries):pandas/pandas/_libs/groupby.pyx
Line 853 in 0b6debf
if it were not for Cython's non-support of const fused types (cython/cython#1772), resolved in (cython/cython#3118), but despite miniscule change only scheduled for release in Cython 3.0. I guess wait until then.
Expected Output
Resampling/groupby works with read-only arrays.
Output of
pd.show_versions()
pandas 1.1.0.dev0+361.gf0b00f887
cython 0.29.14
The text was updated successfully, but these errors were encountered: