roger-mike commented on a change in pull request #14770:
URL: https://github.com/apache/beam/pull/14770#discussion_r629543511



##########
File path: sdks/python/apache_beam/io/gcp/gcsio_test.py
##########
@@ -751,6 +755,28 @@ def test_mime_binary_encoding(self):
     generator._handle_text(message)
     self.assertEqual(test_msg.encode('ascii'), output_buffer.getvalue())
 
+  def test_monitoring_info(self):
+    file_name = 'gs://gcsio-metrics-test/dummy_mode_file'
+    bucket, _ = gcsio.parse_gcs_path(file_name)
+    resource = resource_identifiers.GoogleCloudStorage(bucket)
+    labels = {
+        monitoring_infos.SERVICE_LABEL: 'Storage',
+        monitoring_infos.METHOD_LABEL: 'Objects.insert',
+        monitoring_infos.RESOURCE_LABEL: resource,
+        monitoring_infos.GCS_BUCKET_LABEL: bucket,
+        monitoring_infos.STATUS_LABEL: 'ok'
+    }
+
+    with self.gcs.open(file_name, 'w') as f:

Review comment:
       It throws a `FileNotFoundError: [Errno 2] Not found: 
gs://gcsio-metrics-test/dummy_mode_file` if the file it's not opened in writing 
mode before opening it in reading mode




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

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


Reply via email to