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

Support kwargs in select verb (dply and sql) #63

Open
machow opened this issue May 21, 2019 · 4 comments
Open

Support kwargs in select verb (dply and sql) #63

machow opened this issue May 21, 2019 · 4 comments
Labels
api:verb be:sql dplyr:parity Enables a dplyr behavior .help wanted Extra attention is needed type:feature New feature or request

Comments

@machow
Copy link
Owner

machow commented May 21, 2019

Currently raises a NotImplementedError. One key decision here is where in resulting data kw vars should go. To be consistent with all other uses of select, I would say kwargs should go last, so the result order matches the function call order.

tbl_users >> select(x = _.id)
@ghost
Copy link

ghost commented Jun 15, 2021

Would this allow column renaming in select to have the same API as column renaming in rename and column creation in mutate? i.e. Would this mean we can use select(column = _.old_column) instead of select(_.column == _.old_column)?

@machow
Copy link
Owner Author

machow commented Jun 21, 2021

Yeah, that's right. One big difference between python and R, though, is that keyword args have to go last. So you couldn't do this..

select(a=_.b, _.c)

But I guess not much to be done about that :/.

@ghost
Copy link

ghost commented Jun 22, 2021

I guess we just have to wait for Syntactic Macros (PEP 638)!

@machow
Copy link
Owner Author

machow commented Jun 22, 2021

Ah interesting--I wonder how the PEP will fare! I thought briefly about trying to implement piping macros using codecs, but quickly backed out! https://rahul.gopinath.org/post/2019/12/25/python-macros/.

@machow machow added this to siuba Jan 6, 2022
@machow machow added api:verb dplyr:parity Enables a dplyr behavior labels Jan 11, 2022
@machow machow moved this to Backlog in siuba Jan 11, 2022
@machow machow added the type:feature New feature or request label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:verb be:sql dplyr:parity Enables a dplyr behavior .help wanted Extra attention is needed type:feature New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant