You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "TanuSharma2511 (via GitHub)" <gi...@apache.org> on 2025/05/21 14:16:49 UTC

[PR] Adding project and database support in write transform for firestoreIO [beam]

TanuSharma2511 opened a new pull request, #35017:
URL: https://github.com/apache/beam/pull/35017

   Resolves a part of #31858 
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/actions/workflows/build_wheels.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/actions/workflows/python_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/actions/workflows/java_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/actions/workflows/go_tests.yml/badge.svg?event=schedule&&?branch=master)](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2958979074

   Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment `assign to next reviewer`:
   
   R: @Abacn for label java.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2900411046

   @Abacn Can you please check why org.apache.beam.sdk.io.gcp.GcpApiSurfaceTest is failing. I am not sure which class is creating issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2939812390

   Run Java_GCP_IO_Direct PreCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2121184560


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -502,9 +504,17 @@ public PartitionQuery.Builder partitionQuery() {
    */
   @Immutable
   public static final class Write {
-    private static final Write INSTANCE = new Write();
+    private @Nullable String projectId;
+    private @Nullable String databaseId;
 
-    private Write() {}
+    public static final Write INSTANCE = new Write(null, null);
+
+    public Write() {}
+
+    public Write(@Nullable String projectId, @Nullable String databaseId) {
+      this.projectId = projectId;
+      this.databaseId = databaseId;
+    }

Review Comment:
   Can we keep the original constructor private? and we probably don't need the second one -- I don't think it will be a practical option for users



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1414,9 +1446,33 @@ private Builder(
         super(clock, firestoreStatefulComponentFactory, rpcQosOptions);
       }
 
+      /** Set the GCP project ID to be used by the Firestore client. */
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      /** Set the Firestore database ID (e.g., "(default)"). */
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Can we make these package private?



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1528,10 +1594,33 @@ public static final class Builder
             BatchWriteWithDeadLetterQueue,
             BatchWriteWithDeadLetterQueue.Builder> {
 
+      private @Nullable String projectId;
+      private @Nullable String databaseId;
+
       private Builder() {
         super();
       }
 
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Package private here too please



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 merged PR #35017:
URL: https://github.com/apache/beam/pull/35017


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2129294606


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1414,9 +1446,33 @@ private Builder(
         super(clock, firestoreStatefulComponentFactory, rpcQosOptions);
       }
 
+      /** Set the GCP project ID to be used by the Firestore client. */
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      /** Set the Firestore database ID (e.g., "(default)"). */
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2903108504

   Run Java_GCP_IO_Direct PreCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2898593206

   Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2901757886

   > @Abacn Can you please check why org.apache.beam.sdk.io.gcp.GcpApiSurfaceTest is failing. I am not sure which class is creating issue.
   
   Fixed in #35028


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2922234498

   Reminder, please take a look at this pr: @ahmedabu98 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2125857979


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -502,9 +504,17 @@ public PartitionQuery.Builder partitionQuery() {
    */
   @Immutable
   public static final class Write {
-    private static final Write INSTANCE = new Write();
+    private @Nullable String projectId;
+    private @Nullable String databaseId;
 
-    private Write() {}
+    public static final Write INSTANCE = new Write(null, null);
+
+    public Write() {}
+
+    public Write(@Nullable String projectId, @Nullable String databaseId) {
+      this.projectId = projectId;
+      this.databaseId = databaseId;
+    }

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2964848560

   retest this please


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2904079024

   Assigning reviewers:
   
   R: @ahmedabu98 for label java.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2125859462


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1528,10 +1594,33 @@ public static final class Builder
             BatchWriteWithDeadLetterQueue,
             BatchWriteWithDeadLetterQueue.Builder> {
 
+      private @Nullable String projectId;
+      private @Nullable String databaseId;
+
       private Builder() {
         super();
       }
 
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Done. I think getDatabaseId and getDatabaseId can be public as these are used only for test.



##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1414,9 +1446,33 @@ private Builder(
         super(clock, firestoreStatefulComponentFactory, rpcQosOptions);
       }
 
+      /** Set the GCP project ID to be used by the Firestore client. */
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      /** Set the Firestore database ID (e.g., "(default)"). */
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Done. I think getDatabaseId and getDatabaseId can be public as these are used only for test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2942665815

   @ahmedabu98 Thanks for your review. I have addressed the comments.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2125859053


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1414,9 +1446,33 @@ private Builder(
         super(clock, firestoreStatefulComponentFactory, rpcQosOptions);
       }
 
+      /** Set the GCP project ID to be used by the Firestore client. */
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      /** Set the Firestore database ID (e.g., "(default)"). */
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Done. I think getDatabaseId and getDatabaseId can be private as these are used only for test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2125859462


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1528,10 +1594,33 @@ public static final class Builder
             BatchWriteWithDeadLetterQueue,
             BatchWriteWithDeadLetterQueue.Builder> {
 
+      private @Nullable String projectId;
+      private @Nullable String databaseId;
+
       private Builder() {
         super();
       }
 
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Done. I think getDatabaseId and getDatabaseId can be private as these are used only for test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #35017:
URL: https://github.com/apache/beam/pull/35017#discussion_r2129102478


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreV1.java:
##########
@@ -1414,9 +1446,33 @@ private Builder(
         super(clock, firestoreStatefulComponentFactory, rpcQosOptions);
       }
 
+      /** Set the GCP project ID to be used by the Firestore client. */
+      public Builder setProjectId(@Nullable String projectId) {
+        this.projectId = projectId;
+        return this;
+      }
+
+      /** Set the Firestore database ID (e.g., "(default)"). */
+      public Builder setDatabaseId(@Nullable String databaseId) {
+        this.databaseId = databaseId;
+        return this;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getProjectId() {
+        return this.projectId;
+      }
+
+      @VisibleForTesting
+      public @Nullable String getDatabaseId() {
+        return this.databaseId;
+      }

Review Comment:
   Package private should still make it accessible to the test module
   i.e. `   @Nullable String getProjectId` (without any explicit access modifiers like "public" or "private")



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Adding project and database support in write transform for firestoreIO [beam]

Posted by "TanuSharma2511 (via GitHub)" <gi...@apache.org>.
TanuSharma2511 commented on PR #35017:
URL: https://github.com/apache/beam/pull/35017#issuecomment-2964593159

   Run Java_GCP_IO_Direct PreCommit


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org