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: .cast() to array outputs list instead of np.array in Pandas backend #2821

Merged
merged 6 commits into from
Jun 15, 2021

Conversation

timothydijamco
Copy link
Contributor

Problem

In the Pandas backend, when casting a column to an array type, a list is created as the output instead of a np.array (which is the new standard in the Pandas backend).

>>> series = t['arr_col'].execute()
>>> type(series[0])
numpy.ndarray
>>> series = t['arr_col'].cast('array<float64>').execute()
>>> type(series[0])
list

Solution

Change the Pandas backend implementation of the cast operation to produce a np.array.

@timothydijamco timothydijamco changed the title BUG: Cast outputs list instead of np.array in Pandas backend BUG: .cast() to array outputs list instead of np.array in Pandas backend Jun 10, 2021
@icexelloss
Copy link
Contributor

LGTM. Minor comment.

@timothydijamco
Copy link
Contributor Author

@gerrymanoim This PR is breaking cast-to-array on the Dask backend. I've xfailed the test that was failing. #2743 will fix this. Does that sound reasonable to you? I'd also be happy to instead create a working Dask-specific execution function for Cast in the meantime (currently the Dask backend borrows the Pandas backend's Cast execution function).

@jreback jreback added this to the Next release milestone Jun 15, 2021
@jreback jreback added the pandas The pandas backend label Jun 15, 2021
@jreback
Copy link
Contributor

jreback commented Jun 15, 2021

lgtm @timothydijamco ping when ready

Copy link
Contributor

@icexelloss icexelloss left a comment

Choose a reason for hiding this comment

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

LGTM!

ibis/backends/pandas/execution/generic.py Show resolved Hide resolved
@timothydijamco
Copy link
Contributor Author

thanks, should be all set @jreback

@jreback jreback merged commit f283568 into ibis-project:master Jun 15, 2021
@jreback
Copy link
Contributor

jreback commented Jun 15, 2021

thanks @timothydijamco

@cpcloud cpcloud removed this from the Next release milestone Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pandas The pandas backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants