Skip to content

Commit 7ec1b83

Browse files
kweinmeisterparthea
authored andcommitted
docs: update async_detect_document() sample (#260)
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 5669a49 commit 7ec1b83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vision/snippets/detect/detect.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,9 @@ def async_detect_document(gcs_source_uri, gcs_destination_uri):
849849

850850
bucket = storage_client.get_bucket(bucket_name)
851851

852-
# List objects with the given prefix.
853-
blob_list = list(bucket.list_blobs(prefix=prefix))
852+
# List objects with the given prefix, filtering out folders.
853+
blob_list = [blob for blob in list(bucket.list_blobs(
854+
prefix=prefix)) if not blob.name.endswith('/')]
854855
print('Output files:')
855856
for blob in blob_list:
856857
print(blob.name)

0 commit comments

Comments
 (0)