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

ENH: Implement array ops for pandas #1100

Merged
merged 1 commit into from Aug 10, 2017

Conversation

Projects
None yet
2 participants
@cpcloud
Member

cpcloud commented Aug 9, 2017

Closes #1099

@cpcloud cpcloud added this to the 0.11.3 milestone Aug 9, 2017

@cpcloud cpcloud self-assigned this Aug 9, 2017

@cpcloud

This comment has been minimized.

Member

cpcloud commented Aug 9, 2017

@jreback can you review this when you get a chance?

@cpcloud

This comment has been minimized.

Member

cpcloud commented Aug 9, 2017

Going to pull out the conftest addition and timezone parameterized fixture refactor into a separate PR.

@cpcloud

This comment has been minimized.

Member

cpcloud commented Aug 9, 2017

@jreback I'm going to merge #1102 first, so that this PR doesn't contain any changes unrelated to pandas array ops.

@cpcloud cpcloud force-pushed the cpcloud:pandas-array-ops branch 2 times, most recently from 05ab434 to fc12974 Aug 9, 2017

@@ -740,6 +741,9 @@ class MultiQuantile(Quantile):
name='interpolation',
default='linear')]
def output_type(self):

This comment has been minimized.

@jreback

jreback Aug 9, 2017

Contributor

maybe should consolidate all of the helper routines somewhere

This comment has been minimized.

@cpcloud

cpcloud Aug 9, 2017

Member

I think most of these are operation specific so I don't know if there's any consolidation possible here.

@@ -2403,9 +2407,9 @@ class ArraySlice(ValueOp):
input_type = [
rules.array(dt.any),
rules.integer(name='start'),
rules.integer(name='stop')
rules.integer(name='stop', optional=True)

This comment has been minimized.

@jreback

jreback Aug 9, 2017

Contributor

step?

This comment has been minimized.

@cpcloud

cpcloud Aug 9, 2017

Member

step isn't supported yet. We could make the translation specific to the backend and have the translation rules raise for SQL backends and have pandas work. I'll make an issue.

This comment has been minimized.

@cpcloud

This comment has been minimized.

@cpcloud

cpcloud Aug 9, 2017

Member

The downside to this approach is that you don't get a failure at expression creation time, instead you get a failure at compile time.

raise ValueError(
'Array value type must be a primitive type '
'(e.g., number, string, or timestamp)'
)

This comment has been minimized.

@jreback

jreback Aug 9, 2017

Contributor

isn't this just .astype()? or is this basically np.array(ibis_expr)?

This comment has been minimized.

@cpcloud

cpcloud Aug 9, 2017

Member

No, because we're casting the elements of each list in the Series to a different value type.

@cpcloud cpcloud force-pushed the cpcloud:pandas-array-ops branch from fc12974 to 3bb4e80 Aug 9, 2017

@cpcloud cpcloud force-pushed the cpcloud:pandas-array-ops branch from 3bb4e80 to 256ad7a Aug 9, 2017

@cpcloud

This comment has been minimized.

Member

cpcloud commented Aug 9, 2017

@jreback Ok to merge on green?

@jreback

This comment has been minimized.

Contributor

jreback commented Aug 10, 2017

yep lgtm.

@jreback jreback merged commit 5961b51 into ibis-project:master Aug 10, 2017

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@cpcloud cpcloud deleted the cpcloud:pandas-array-ops branch Aug 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment