-
Notifications
You must be signed in to change notification settings - Fork 82
feat: add primary pipeline stages #1048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add primary pipeline stages #1048
Conversation
commit ad3e3df Author: Daniel Sanche <[email protected]> Date: Fri Jun 20 17:44:37 2025 -0700 added .pipeline() to aggregation query commit 4ce1b91 Author: Daniel Sanche <[email protected]> Date: Fri Jun 20 15:17:20 2025 -0700 added exprs and stages needed for aggregation pipelines commit e7d8e52 Merge: 0d15355 17e71b9 Author: Daniel Sanche <[email protected]> Date: Tue Jun 17 16:57:45 2025 -0700 Merge branch 'pipeline_queries_approved' into pipeline_queries_2_query_parity commit 17e71b9 Author: Daniel Sanche <[email protected]> Date: Tue Jun 17 15:54:31 2025 -0700 feat: add pipelines structure (#1046) commit 0d15355 Author: Daniel Sanche <[email protected]> Date: Tue Jun 17 15:52:38 2025 -0700 fixed tests commit bc25930 Merge: 6351ae7 13389b8 Author: Daniel Sanche <[email protected]> Date: Tue Jun 17 15:38:05 2025 -0700 Merge branch 'pipeline_queries_1_stubs' into pipeline_queries_2_query_parity commit 6351ae7 Author: Daniel Sanche <[email protected]> Date: Tue Jun 17 15:35:15 2025 -0700 merged PR #1 commit 13389b8 Author: Daniel Sanche <[email protected]> Date: Mon Jun 16 15:15:26 2025 -0700 fixed mypy commit 06a2084 Author: Daniel Sanche <[email protected]> Date: Mon Jun 16 14:57:54 2025 -0700 added generic_stage method to base_pipeline commit 8a9c3ec Author: Daniel Sanche <[email protected]> Date: Mon Jun 16 14:55:50 2025 -0700 made stages private commit a818f52 Author: Daniel Sanche <[email protected]> Date: Mon Jun 16 14:28:20 2025 -0700 removed converter reference commit e74e04d Author: Daniel Sanche <[email protected]> Date: Mon Jun 16 14:22:13 2025 -0700 added separate stream/execute methods commit 64cd4fb Author: Daniel Sanche <[email protected]> Date: Thu Jun 12 11:22:25 2025 -0700 fixed comment commit 3432322 Author: Daniel Sanche <[email protected]> Date: Tue Jun 10 17:03:09 2025 -0700 fixed lint
8df814c
to
f732f01
Compare
class Add(Function): | ||
"""Represents the addition function.""" | ||
|
||
def __init__(self, left: Expr, right: Expr): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Java and node have convenience functions which accept string as first arg. Are these needed in Python too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those convenience functions are implemented on the Expr
class, so they can be used infix. Example: Field.of("cost").add(5)
It seems like that's how Java is implemented too? Unless I missed another implementation somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, good catch. I added those!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace stage is missing. Something similar to https://github.com/googleapis/java-firestore/blob/6f640d021aeeb7f79c89d3d5e3dc6f6897e92456/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/Replace.java#L26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is replace working for you? I was getting errors, so I put it off for the follow up PR.
I get google.api_core.exceptions.InvalidArgument: 400 Unsupported stage: replace
This PR builds on the previous to add all currently supported additional stages and expressions
There are a lot of new files to review, but review should be fairly straightforward - just adding new
expression
andstage
subclasses as introduced previouslyThis PR also adds end to end testing through
test_pipeline_acceptance.py
, which runs test cases inpipelines_e2e.yaml