You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/04/28 17:29:08 UTC

[GitHub] [beam] chamikaramj commented on a diff in pull request #17487: Adding user-agent to GCS client in Python

chamikaramj commented on code in PR #17487:
URL: https://github.com/apache/beam/pull/17487#discussion_r861144596


##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -155,7 +156,10 @@ def __init__(self, storage_client=None):
           credentials=auth.get_service_credentials(),
           get_credentials=False,
           http=get_new_http(),
-          response_encoding='utf8')
+          response_encoding='utf8',

Review Comment:
   Could we do this for BQ also (since we do use apiclient-based library there as well) ? 
   If it's hard let's just file a Jira.



##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -155,7 +156,10 @@ def __init__(self, storage_client=None):
           credentials=auth.get_service_credentials(),
           get_credentials=False,
           http=get_new_http(),
-          response_encoding='utf8')
+          response_encoding='utf8',
+          additional_http_headers={
+              "User-Agent": "apache-beam-%s" % apache_beam.__version__
+          })

Review Comment:
   Will it be possible to add a unit test to make sure this stays consistent and does not get broken ?



-- 
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