Skip to content

No results when delimiter is set when calling Client.list_blobs #672

@ali-suleiman-44b20b39

Description

@ali-suleiman-44b20b39

Environment details

  • OS type and version: MacOS BigSur Version 11.4
  • Python version: Python 3.9.7
  • pip version: pip 21.2.4
  • google-cloud-storage version: pip show google-cloud-storage

Name: google-cloud-storage Version: 1.43.0 Summary: Google Cloud Storage API client library Home-page: https://github.com/googleapis/python-storage Author: Google LLC Author-email: [email protected] License: Apache 2.0 Location: /Users/asuleiman/opt/miniconda3/envs/torqata/lib/python3.9/site-packages Requires: six, google-auth, google-resumable-media, google-api-core, requests, google-cloud-core, protobuf Required-by:

Steps to reproduce

  1. Run with delimiter set:
	from google.cloud import storage
	storage_client = storage.Client()
	r = storage_client.list_blobs(bucket_or_name=bucketname,prefix="match/", delimiter='/')
	c = 0
	for blob in r:
		print(blob.name)
		c+=1
		if c > 5:
			break

Result:

empty
  1. Run without delimiter set:
	from google.cloud import storage
	storage_client = storage.Client()
	r = storage_client.list_blobs(bucket_or_name=bucketname,prefix="match/",)
	c = 0
	for blob in r:
		print(blob.name)
		c+=1
		if c > 5:
			break

Result:

match/asd1/111/2020-04-26.json
match/asd1/111/2020-04-27.json
match/asd1/111/2020-04-28.json
match/asd1/111/2020-04-29.json
match/asd1/111/2020-04-30.json
match/asd1/111/2020-05-01.json

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/python-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions