feat(firestore): [PQ] add raw stage#13280
feat(firestore): [PQ] add raw stage#13280bhshkh merged 4 commits intogoogleapis:feature/fs-pipeline-queriesfrom
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a RawStage to the Firestore pipeline, which is a great addition for forward compatibility, allowing users to leverage new pipeline stages before they are formally added to the SDK. The implementation is clear, follows the existing design patterns of the library, and includes integration tests to validate the new functionality. The code looks good, I just have one minor suggestion to simplify the code in pipeline_stage.go.
shollyman
left a comment
There was a problem hiding this comment.
Approving, but would another consideration be to have a stage builder that simply accepts the service's proto message corresponding to a stage?
|
|
||
| // RawStage represents a pipeline stage that is not yet implemented in the SDK. | ||
| // This allows users to call stages that are supported by the Firestore backend | ||
| // but not yet available in the current SDK version. |
There was a problem hiding this comment.
nit: The first line of this description seems like it could be a bit confusing. It seems like it's saying RawStage itself is unimplemented, but it means to say RawStage lets you use unimplemented stages
I just used the description from the java client
There was a problem hiding this comment.
Good catch. Updated. Thanks for the review !!
…nto feature/fspq-raw-stage
ffdb927
into
googleapis:feature/fs-pipeline-queries
Add consistency selector similar to existing requests Existing code for reference: **client.go :** https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/client.go#L405-L412 https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/client.go#L308-L317 https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/client.go#L490-L504 **query.go :** https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/query.go#L1406-L1412 https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/query.go#L1551-L1561 **list_documents.go :** https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/list_documents.go#L48-L55 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281
Add raw stage similar to Java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java#L997-L1021 The raw stage is an escape hatch to allow customers to consume new stages supported by the backend without having to update their SDK to a version that adds the stage. Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279
Add consistency selector similar to existing requests Existing code for reference: **client.go :** https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/client.go#L405-L412 https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/client.go#L308-L317 https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/client.go#L490-L504 **query.go :** https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/query.go#L1406-L1412 https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/query.go#L1551-L1561 **list_documents.go :** https://github.com/googleapis/google-cloud-go/blob/66cc9bb6e158416897af1d1dc4b9001118db3373/firestore/list_documents.go#L48-L55 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281
#13283) Changes in this PR: 1. firestore_client.go : Updated generated client as per googleapis/gapic-generator-go#1661 . Removed retries from tests since the headers have now been fixed. 2. Remove Equivalent since it was removed from backend. 3. Add/update comments 4. Add timestamp truncate (pending from #13194) and string split (pending from #13245) functions. 5. add all the private preview general, key, logical (except iferror), type and object functions. See "Firestore Features (Pipeline)" sheet in [go/firestore-query-tracker](http://go/firestore-query-tracker) for the list of functions. Java reference: - https://github.com/googleapis/java-firestore/blob/ccaf9d4fac5bd87a4da3d37493ca66fdc7681bc3/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281 - #13282 - googleapis/gapic-generator-go#1661
add collection and collectiongroup stage options similar to Java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/CollectionGroupOptions.java#L34-L36 https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/CollectionOptions.java#L34-L36 https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/CollectionHints.java#L34-L40 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13282 - googleapis/gapic-generator-go#1661
Add ExecuteOptions similar to query run options which was introduced in #10164. GetRawData and GetText implementation similar to Java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/PipelineExecuteOptions.java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/ExplainOptions.java https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ExplainStats.java#L42-L71 https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITPipelineTest.java#L2474-L2498 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281 - #13282 - googleapis/gapic-generator-go#1661 - #13283
Add CreateFrom() and Pipeline() similar to Java. https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineSource.java#L140-L164 Previous pull requests - #12217 - #12425 - #12538 - #13147 - #13199 - #13218 - #13194 - #13245 - #13270 - #13271 - #13279 - #13280 - #13281 - #13282 - googleapis/gapic-generator-go#1661 - #13283 - #13274 - #13338
Add raw stage similar to Java
https://github.com/googleapis/java-firestore/blob/742fab6583c9a6f9c47cf0496124c3c9b05fe0ee/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Pipeline.java#L997-L1021
The raw stage is an escape hatch to allow customers to consume new stages supported by the backend without having to update their SDK to a version that adds the stage.
Previous pull requests