Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sdks/python/apache_beam/io/gcp/bigtableio.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from typing import List

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
Expand All @@ -59,6 +60,7 @@
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
Expand Down Expand Up @@ -141,7 +143,11 @@ def start_service_call_metrics(self, project_id, instance_id, table_id):

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(
Expand Down
Loading