feat: Add Collection.pipe method analogous to polars Lazy-/DataFrames#359
Merged
Conversation
Copilot started reviewing on behalf of
Moritz Potthoff (MoritzPotthoffQC)
July 5, 2026 12:39
View session
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #359 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 3471 3475 +4
=========================================
+ Hits 3471 3475 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Collection.pipe helper to enable fluent, Polars-style operation chaining on dy.Collection instances, mirroring the ergonomics of pl.LazyFrame.pipe while preserving type information via ParamSpec/Concatenate.
Changes:
- Introduces
Collection.pipe(function, *args, **kwargs)that callsfunction(self, *args, **kwargs)and returns the function’s result. - Adds unit tests covering
selfforwarding, args/kwargs forwarding, and arbitrary return types. - Exposes the new API in the collection operations docs autosummary.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
dataframely/collection/collection.py |
Adds the new Collection.pipe method with typed signature and docstring. |
tests/collection/test_pipe.py |
Adds tests validating behavior and return-type flexibility of Collection.pipe. |
docs/api/collection/operations.rst |
Includes Collection.pipe in the documented collection operations list. |
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
I recently wanted to use this and realized I can't. I think it would be nice to support this so that we can use the same operation chaining pattern we use for data frames also for collections.
Changes
Collection.pipemethod with the same interface aspl.LazyFrame.pipe(see here)