shunping commented on code in PR #34062:
URL: https://github.com/apache/beam/pull/34062#discussion_r1970278807


##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -125,14 +126,32 @@ def create_storage_client(pipeline_options, 
use_credentials=True):
     from google.api_core import client_info
     beam_client_info = client_info.ClientInfo(
         user_agent="apache-beam/%s (GPN:Beam)" % beam_version.__version__)
+
+    # Note: Custom audit entries with "job" key will overwrite this default.
+    extra_headers = {
+        "x-goog-custom-audit-job": google_cloud_options.job_name
+        if google_cloud_options.job_name else "UNKNOWN"
+    }
+
+    if google_cloud_options.custom_audit_entries is not None:
+      for entry in google_cloud_options.custom_audit_entries:
+        if entry.startswith('{'):
+          # in the format of {'key': value'}
+          sub_entries = ast.literal_eval(entry)

Review Comment:
   Right, but here I follow a similar code path as in 
https://github.com/apache/beam/blob/7034e5053287c887d9e6c3b4de9c2dccbbe794f2/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py#L450



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to