Merge dplyr-style chainable API into DSL v2 builder#998
Merged
Conversation
- Integrated filter(), filter_expr(), head(), tail(), sample(), slice(), first(), last(), take(), pluck(), collect() methods - Updated executor to support new post-filter types (expression, tail, sample, slice, last) - Added safe expression evaluator for filter_expr() - Updated AGENTS.md documentation with merged API section - Updated example_dsl_dplyr_operations.py to demonstrate new methods - All methods tested and working correctly Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
- Created test_dplyr_integration.py with 12 tests covering all new methods - All tests pass successfully - Tests verify filter(), filter_expr(), head(), tail(), take(), sample(), slice(), first(), last(), pluck(), collect() and method chaining Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Merge dplyr style chainable API into dslV2
Merge dplyr-style chainable API into DSL v2 builder
Jan 6, 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.
The library had two separate APIs for chainable operations:
graph_ops.py(dplyr-style) anddsl/builder.py(query builder), forcing users to learn and switch between both. This consolidates them into a unified interface.Changes
DSL Builder (
py3plex/dsl/builder.py)QueryBuilder:filter(),filter_expr(),head(),tail(),take(),sample(),slice(),first(),last(),pluck(),collect()filter()aliases existingwhere()for traditional dplyr namingfilter_expr()enables string-based filtering with safe AST evaluationExecutor (
py3plex/dsl/executor.py)_apply_post_filters()to handle new filter types (expression, tail, sample, slice, last)_safe_eval_expr()for secure expression evaluation using AST validationDocumentation
AGENTS.mdto document unified APIexample_dsl_dplyr_operations.pywith demonstration of new methodstests/test_dplyr_integration.py)Example
Backward Compatibility: Standalone
graph_opsmodule remains available. No breaking changes to existing DSL v2 functionality.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.