From c525a053e86d44f40a56f3036ac8a69cd349a07f Mon Sep 17 00:00:00 2001 From: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Date: Tue, 26 Oct 2021 09:57:38 -0500 Subject: [PATCH] docs: update async_detect_document() sample (#260) Co-authored-by: Anthonios Partheniou --- vision/snippets/detect/detect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vision/snippets/detect/detect.py b/vision/snippets/detect/detect.py index 898c0546de73..9e5d79e9e36d 100644 --- a/vision/snippets/detect/detect.py +++ b/vision/snippets/detect/detect.py @@ -849,8 +849,9 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri): bucket = storage_client.get_bucket(bucket_name) - # List objects with the given prefix. - blob_list = list(bucket.list_blobs(prefix=prefix)) + # List objects with the given prefix, filtering out folders. + blob_list = [blob for blob in list(bucket.list_blobs( + prefix=prefix)) if not blob.name.endswith('/')] print('Output files:') for blob in blob_list: print(blob.name)