feat(firestore): new generic pipeline expressions#16550
Draft
daniel-sanche wants to merge 8 commits intomainfrom
Draft
feat(firestore): new generic pipeline expressions#16550daniel-sanche wants to merge 8 commits intomainfrom
daniel-sanche wants to merge 8 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces several new pipeline expressions to the Firestore library, including offset, coalesce, switch_on, parent, and a logical Nor operator, supported by new system and unit tests. The reviewer suggested refactoring the coalesce and switch_on methods for better conciseness and identified typos in the switch_on docstring and a unit test variable name.
Comment on lines
+1052
to
+1056
| args = [self] | ||
| args.extend( | ||
| [Expression._cast_to_expr_or_convert_to_constant(x) for x in others] | ||
| ) | ||
| return FunctionExpression("coalesce", args) |
Contributor
| *others: Additional alternating conditions and results, optionally followed by a default value. | ||
|
|
||
| Returns: | ||
| An Expression representing the switchOn operation. |
Contributor
There was a problem hiding this comment.
There's a small inconsistency in the docstring. The operation name is switch_on, but it's written as switchOn here. For consistency with the function name and implementation, it should be switch_on.
Suggested change
| An Expression representing the switchOn operation. | |
| An Expression representing the switch_on operation. |
Comment on lines
+1082
to
+1086
| args = [self, Expression._cast_to_expr_or_convert_to_constant(result)] | ||
| args.extend( | ||
| [Expression._cast_to_expr_or_convert_to_constant(x) for x in others] | ||
| ) | ||
| return FunctionExpression("switch_on", args) |
Contributor
There was a problem hiding this comment.
Comment on lines
+763
to
+764
| infix_istance = arg1.offset(arg2) | ||
| assert infix_istance == instance |
Contributor
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.
WIP
New Expressions: