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

fix: allow piping symbolic attributes like _.a #325

Merged
merged 4 commits into from
Jun 20, 2021
Merged

Conversation

machow
Copy link
Owner

@machow machow commented Apr 30, 2021

Addresses #324, by stripping symbolics from calls like pipe(_.a). While I'm at it, I'll add a few more tests of Pipeable later today, then merge!

This PR also fixes support for slicing. See #324 for full details. The crux is that symbolic handling for multiple slices was broken.

from siuba import _

_[_ > 20, :]

output:

█─[
├─_
└─(█─>            # notice the ( means all this is in a tuple
  ├─_
  └─20, slice(None, None, None))

It fixes by adding two classes corresponding to how the python AST represents slicing, _SliceOpIndex and _SliceOpExt, and registers them on a factory class, SliceOp. This could probably be simplified in the future..!

@machow machow merged commit 6727545 into master Jun 20, 2021
@machow machow deleted the fix-pipe-attribute branch June 20, 2021 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant