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

Deprecate All #27

Closed
pdeffebach opened this issue Oct 27, 2020 · 9 comments · Fixed by #28
Closed

Deprecate All #27

pdeffebach opened this issue Oct 27, 2020 · 9 comments · Fixed by #28

Comments

@pdeffebach
Copy link

Maybe I'm missing something but there seems to be support in

for deprecating All in favor of Cols.

  • Cols(): No columns
  • Cols(:) All columns

This is so easy with Cols that there is no need for All().

We should deprecate All.

@bkamins
Copy link
Member

bkamins commented Oct 27, 2020

Actually Cols(:) is not needed as it is just :.

@nalimilan - are you OK to deprecate All. I am OK with this.

@bkamins
Copy link
Member

bkamins commented Oct 27, 2020

The issue is that JuliaDB.jl would have to sync with this. CC @piever

@nalimilan
Copy link
Member

nalimilan commented Oct 27, 2020

Yes, this is the last chance to deprecate it (in DataFrames before 1.0).

@bkamins bkamins mentioned this issue Oct 27, 2020
@bkamins bkamins linked a pull request Oct 27, 2020 that will close this issue
@piever
Copy link
Collaborator

piever commented Oct 28, 2020

For me to understand, the key idea is that Cols(args...) can take a list of selectors and returns a selector corresponding to the union of the selections. So for JuliaDB to support this, Cols should be implemented the same as All, except for the empty case.

On top of that, select(t, :) should select all columns, that is, : is itself a "special selector". Supporting arbitrary ranges, like select(t, 1:3), would be a bit messy, as they currently have a different meaning, that is select(t, v::AbstractVector) == v). OTOH, just select(t, :) seems reasonable.

In terms of what's breaking though, I would argue that adding this depwarn to DataAPI is breaking, as it would cause a nonsensical warning on older versions of packages that implement All but not yet Cols. Maybe it'd be best to bump DataAPI version when introducing the depwarn, but not when removing All.

@bkamins
Copy link
Member

bkamins commented Oct 28, 2020

Maybe it'd be best to bump DataAPI version when introducing the depwarn

This is the plan.

So for JuliaDB to support this, Cols should be implemented the same as All, except for the empty case.

Yes

:

You do not have to support it, but it feels natural to allow :, as it is a common pattern in Julia Base and other languages. Colon() is is not AbstractVector.

@piever
Copy link
Collaborator

piever commented Oct 28, 2020

Well, if we do not support it, then Cols(:) (which is the recommended deprecation) would not work out of the box, so that would introduce other special casing / inconsistencies. I actually wondered why the depwarn does not just recommend :.

My only doubt is whether it is sufficiently universal that : means "take all the columns", or if instead we want to keep the empty argument variant All(). This removes the inconsistency:All is no longer the union, it is just all the columns, and select(t, All()) reads reasonably well. On the other hand, it may be redundant.

I don't have a clear view on this, but I can open an issue about it in IndexedTables to see what the current maintainers think (I haven't touched it while).

@bkamins
Copy link
Member

bkamins commented Oct 28, 2020

I am OK to leave All(), but deprecate All(args...). I will just update the PR in this way.

@nalimilan
Copy link
Member

I'd be inclined to wait a bit to see what happens in IndexedTables. It would be simpler to fully deprecate All() if : can replace it. Though if a decision isn't made soon we can still deprecate All(args...) and see later whether we extend the deprecation to All().

@bkamins
Copy link
Member

bkamins commented Oct 28, 2020

Fortunately this does not affect DataFrames.jl very much 😄.

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 a pull request may close this issue.

4 participants