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

feat(common): add Node.find_below() methods to exclude the root node from filtering #8861

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Apr 2, 2024

Currently we are unable to locate certain values under a relation while applying a value filter because the root node gets filtered out, like:

relation.find(pattern, filter=ops.Value)

Used in practice at #8825

for child in _.__children__ + _.parent.__children__:
    if child.find((Window, ops.ExistsSubquery, ops.InSubquery, ops.Unnest), filter=ops.Value):
        ...

Which can be simplified to _.find_below() or _.parent.find_below() after this feature.

I am not that satisfied with the name, but marked as experimental so we can change it anytime.
This feature will also help with pretty printing the dereference mapping without traversing the dictionary keys in _flatten_collections().

Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, just wondering what the plans are for find_below.

@cpcloud cpcloud added this to the 9.0 milestone Apr 2, 2024
@cpcloud cpcloud added the internals Issues or PRs related to ibis's internal APIs label Apr 2, 2024
@cpcloud cpcloud merged commit 80d12a2 into ibis-project:main Apr 2, 2024
90 checks passed
@cpcloud cpcloud deleted the find-below branch April 2, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Issues or PRs related to ibis's internal APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants