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

Redesign non-siu select method #71

Open
machow opened this issue Jun 14, 2019 · 2 comments
Open

Redesign non-siu select method #71

machow opened this issue Jun 14, 2019 · 2 comments

Comments

@machow
Copy link
Owner

machow commented Jun 14, 2019

Currently select bends over backwards trying to make specifying with siu expressions, also work when just plain lambdas are used.

For example

select(_.a, _.b)
select(lambda _: _.a, lambda _: _.b)
select(lambda _: _.contains("a"))

The last statement works because the lambda will be passed a VarSelect instance. However, this has two limitations:

  • it is annoying when you just want to operate on an array of column names
  • it's necessary, since at the point you want to use lambdas, you should just replace _["a": "b"] with the object it creates downstream, a slice.

If we change select to...

  • create intermediate objects for Call args (e.g. a slice, string, or list of those things)
  • pass the array of column names to a callable

Then it opens room for people to use their own functions with select, and provides an easy to understand behavior in this case.

@machow machow added this to siuba Jan 6, 2022
@machow
Copy link
Owner Author

machow commented Jan 11, 2022

See #365

@machow machow added the .refine label Jan 11, 2022
@machow machow added this to the tidyselection refactor milestone Jan 20, 2022
@machow machow moved this to Backlog in siuba Jan 22, 2022
@machow
Copy link
Owner Author

machow commented Mar 23, 2022

Let's remove the use of a pandas Series while we're at it. This will let us remove pandas imports from the sql verb module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

1 participant