fix(python): Issue PerformanceWarning in LazyFrame.__contains__ - #26734
Merged
nameexhaustion merged 6 commits intoMar 10, 2026
Merged
fix(python): Issue PerformanceWarning in LazyFrame.__contains__#26734nameexhaustion merged 6 commits into
LazyFrame.__contains__#26734nameexhaustion merged 6 commits into
Conversation
Add PerformanceWarning to LazyFrame.__contains__ to match the behavior of other LazyFrame properties (schema, columns, dtypes, width) that require resolving the schema. Fixes #21917 Signed-off-by: edvatar <88481784+toroleapinc@users.noreply.github.com>
toroleapinc
requested review from
MarcoGorelli,
alexander-beedie,
c-peters and
ritchie46
as code owners
February 27, 2026 02:10
LazyFrame.__contains__
LazyFrame.__contains__LazyFrame.__contains__
Member
|
Did you follow the AI policy? |
Contributor
Author
|
Yes |
nameexhaustion
approved these changes
Mar 10, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26734 +/- ##
==========================================
+ Coverage 81.00% 81.67% +0.67%
==========================================
Files 1805 1805
Lines 248021 248022 +1
Branches 3132 3132
==========================================
+ Hits 200902 202569 +1667
+ Misses 46313 44647 -1666
Partials 806 806 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
LazyFrame.__contains__LazyFrame.__contains__
This file contains hidden or 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
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.
Summary
Add
PerformanceWarningtoLazyFrame.__contains__to match the behavior of other LazyFrame properties (schema,columns,dtypes,width) that require resolving the schema.Changes
issue_warning()call withPerformanceWarningcategory inLazyFrame.__contains__test_lazyframe.pyRationale
As noted in #21917, after #16964 all other methods on LazyFrame that might unexpectedly cause the schema to be resolved emit
PerformanceWarning, except for__contains__. This was an oversight since'col' in lfis functionally identical to'col' in lf.columnswhich does emit the warning.Fixes #21917