feat: Allow to skip validating members in collection filter & validate#366
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #366 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 3481 3489 +8
=========================================
+ Hits 3481 3489 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-out path for member-level schema validation when working with dy.Collection, enabling performance-sensitive workflows (e.g., very large frames) to apply only collection-level filters while assuming members were validated elsewhere.
Changes:
- Add
skip_member_validationparameter toCollection.validate()andCollection.filter()to bypass per-member schema validation/filtering. - Add
FailureInfo._create_empty()to support returning empty failure info when member validation is skipped. - Add collection-level tests covering eager/lazy validate/filter behavior with and without member validation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tests/collection/test_skip_member_validation.py | Adds tests for eager/lazy Collection.validate and Collection.filter when skipping member validation. |
| dataframely/filter_result.py | Adds an internal helper to construct an empty FailureInfo with the expected rule columns. |
| dataframely/collection/collection.py | Plumbs skip_member_validation through collection validation/filtering to bypass member schema checks. |
Comments suppressed due to low confidence (1)
dataframely/collection/collection.py:611
- The
filterdocstring says the result members are filtered for rows “passing validation”. Withskip_member_validation=True, member schemas are intentionally not applied, so theReturnssection should describe that only collection-level filters are applied (and failures will be empty).
skip_member_validation: Whether to skip filtering individual members and only
apply the collection filters. **Use this option with caution** as it
requires the caller to ensure that the individual members have been
validated. This option is particularly useful in performance-critical
scenarios where the members are known to already be valid.
kwargs: Keyword arguments passed directly to :meth:`polars.collect_all` and
:meth:`polars.LazyFrame.collect` when `eager=True`.
Returns:
A named tuple with fields `result` and `failure`. The `result` field
provides a collection with all members filtered for the rows passing
validation. Just like for validation, all members are guaranteed to maintain
their input order. The `failure` field provides a dictionary mapping member
names to their respective failure information.
Andreas Albert (AndreasAlbertQC)
approved these changes
Jul 7, 2026
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.
Motivation
When validating collections with massive data frames, validation is potentially expensive. It would be nice to be able to skip it.