This is an automated email from the ASF dual-hosted git repository.

Abacn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ce13c65a4fb Set Apache Beam user agent for Python BigtableIO write 
client (#39792)
ce13c65a4fb is described below

commit ce13c65a4fbecf0db6f2b00621da32789d82916b
Author: Mattie Fu <[email protected]>
AuthorDate: Mon Aug 17 13:45:34 2026 -0400

    Set Apache Beam user agent for Python BigtableIO write client (#39792)
    
    Configure the native Python Bigtable write client with a Beam user
    agent (apache-beam/<version> (GPN:Beam)), matching the Java BigtableIO
    behavior and the convention used by gcsio.py and the Datastore
    connector.
---
 sdks/python/apache_beam/io/gcp/bigtableio.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/io/gcp/bigtableio.py 
b/sdks/python/apache_beam/io/gcp/bigtableio.py
index 38b507aaed2..442ba5d68c8 100644
--- a/sdks/python/apache_beam/io/gcp/bigtableio.py
+++ b/sdks/python/apache_beam/io/gcp/bigtableio.py
@@ -41,6 +41,7 @@ import logging
 import struct
 
 import apache_beam as beam
+from apache_beam import version as beam_version
 from apache_beam.internal.metrics.metric import ServiceCallMetric
 from apache_beam.io.gcp import resource_identifiers
 from apache_beam.metrics import Metrics
@@ -57,6 +58,7 @@ FLUSH_COUNT = 1000
 MAX_ROW_BYTES = 5242880  # 5MB
 
 try:
+  from google.api_core.gapic_v1 import client_info as client_info_lib
   from google.cloud.bigtable import Client
   from google.cloud.bigtable.batcher import MutationsBatcher
   from google.cloud.bigtable.row import Cell
@@ -139,7 +141,11 @@ class _BigTableWriteFn(beam.DoFn):
 
   def start_bundle(self):
     if self.table is None:
-      client = Client(project=self.beam_options['project_id'])
+      client = Client(
+          project=self.beam_options['project_id'],
+          client_info=client_info_lib.ClientInfo(
+              user_agent="apache-beam/%s (GPN:Beam)" %
+              beam_version.__version__))
       instance = client.instance(self.beam_options['instance_id'])
       self.table = instance.table(self.beam_options['table_id'])
     self.service_call_metric = self.start_service_call_metrics(

Reply via email to