-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
A regression in numpy-to-series conversion #16522
Labels
A-input-parsing
Area: parsing input arguments
bug
Something isn't working
P-medium
Priority: medium
python
Related to Python Polars
regression
Issue introduced by a new release
Comments
KDruzhkin
added
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
python
Related to Python Polars
labels
May 27, 2024
stinodego
added
regression
Issue introduced by a new release
P-medium
Priority: medium
labels
May 27, 2024
With polars 1.2.0 (and python 3.12, numpy 2.0) the error message is more meaningful: Traceback (most recent call last):
File "src/example.py", line 6, in <module>
pl.Series(
File ".venv/lib/python3.12/site-packages/polars/series/series.py", line 288, in __init__
self._s = sequence_to_pyseries(
^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.12/site-packages/polars/_utils/construction/series.py", line 227, in sequence_to_pyseries
return numpy_to_pyseries(
^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.12/site-packages/polars/_utils/construction/series.py", line 478, in numpy_to_pyseries
return wrap_s(py_s).reshape(original_shape)._s
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.12/site-packages/polars/series/series.py", line 6779, in reshape
return self._from_pyseries(self._s.reshape(dimensions))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
polars.exceptions.InvalidOperationError:
cannot reshape array into shape containing a zero dimension after the first: (2, 0) |
FWIW v1.2.1 (+py39 +numpy1.26.4) - issue persists pl.DataFrame({'empty_arrays': [np.array([]), np.array([])]})
|
2 tasks
2 tasks
As of #18940 this is fixed:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-input-parsing
Area: parsing input arguments
bug
Something isn't working
P-medium
Priority: medium
python
Related to Python Polars
regression
Issue introduced by a new release
Checks
Reproducible example
Log output
Issue description
The releases 0.20.27 - 0.20.29 have been yanked due to a bug in numpy processing.
Here is a bug in numpy-related code in 0.20.30.
Expected behavior
As is 0.20.26: a Series of empty Lists.
Installed versions
The text was updated successfully, but these errors were encountered: