-
Notifications
You must be signed in to change notification settings - Fork 69
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
All except simplification: Option 1 #1036
Draft
Jolanrensen
wants to merge
8
commits into
master
Choose a base branch
from
allExcept-simplification
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…only exclude columns present in the column set (or the column set created by calling all(Cols)() in the all(Cols)Except() cases). If we detect a user is trying to except a nested column, we throw a helpful exception.
…age pointing users to use String or remove {}
Jolanrensen
added
bug
Something isn't working
enhancement
New feature or request
labels
Jan 28, 2025
I believe that we should split our internallyUsedExcept and newOneExcept in our publicAPI |
As discussed on Slack, we might actually need the ability to select column groups with some column removed, especially in |
Jolanrensen
changed the title
All except simplification
All except simplification: : Option 1
Jan 29, 2025
Jolanrensen
changed the title
All except simplification: : Option 1
All except simplification: Option 1
Jan 29, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #761
This PR rewrites
except
to disallow pointing to nested columns. The columns selection DSL should only be allowed to "select" columns, not restructure it; we havemove
,remove
, etc. for that.When a user now calls, say
they will receive an
IllegalArgumentException
:Cannot exclude the nested columns '[userData/age]' from the column set '[userData/{age, name}, otherCol1, otherCol2]' with the except-functions. Use the `DataFrame<*>.remove { }` operation instead.
because
userData.age
is not directly selected byall()
, only its parent,userdata
, is.TODO:
Some internal struggle: It seems like
except
was used internally in a couple places and it relied on the old behavior.Rewriting this now pushes me to this horrible notation:
Before:
df.groupBy { allExcept(columnSetWithNestedCols) }...
After:
(something like
df.remove {}.groupBy {}
wouldn't not work, because you still want the columns inside the group)Having to write something like this makes me rethink what we should do about this. Clearly there's a need for selecting the top-level columns of a version of the current dataframe where a (set of) column(s) and their parents are removed. Though, it seems out of the scope for
except
(and the 0.15 version ofexcept
even breaks in some cases). We could:except
and keep it as isremove
on it. Probably also needs adf.toColumnSet()
function.@zaleslaw @koperagen @nikitinas @belovrv WDYT?