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

Allow predicate in Cols #2881

Merged
merged 10 commits into from
Sep 20, 2021
Merged

Allow predicate in Cols #2881

merged 10 commits into from
Sep 20, 2021

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Sep 13, 2021

Fixes #2875

I was thinking that we might make it even more flexible and allow predicate to be mixed with other selectors in Cols, but for now I proposed a restrictive version. @nalimilan - do you think we should be more flexible?

@bkamins bkamins requested a review from nalimilan September 13, 2021 20:28
@nalimilan
Copy link
Member

Being restrictive sounds OK for now. Why does : need a special support? I would have thought it could be treated like any selector that can be included in Cols?

src/other/index.jl Outdated Show resolved Hide resolved
@bkamins
Copy link
Member Author

bkamins commented Sep 14, 2021

Why does : need a special support?

Ah - you are right. : is not a function but a constructor so it is not a subtype of Function so special treatment is not needed. I will fix this.

@bkamins
Copy link
Member Author

bkamins commented Sep 15, 2021

Ah - I was right originally Colon is a constructor but it is defined as:

struct Colon <: Function
end

so it is a Function. My original definition thus was required as otherwise Colon(:) treats : as a predicate. Things are tough.

docs/src/lib/indexing.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
docs/src/man/working_with_dataframes.md Outdated Show resolved Hide resolved
src/other/index.jl Outdated Show resolved Hide resolved
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
docs/src/lib/internals.md Outdated Show resolved Hide resolved
src/other/index.jl Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
@bkamins
Copy link
Member Author

bkamins commented Sep 20, 2021

@nalimilan - this should be good to have a look at again.

@bkamins bkamins merged commit df1b417 into main Sep 20, 2021
@bkamins bkamins deleted the bk/cols_predicate branch September 20, 2021 18:09
@bkamins
Copy link
Member Author

bkamins commented Sep 20, 2021

Thank you!

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.

Make Cols more flexible
2 participants