Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to call seek when a BlobReader instance initialized with raw_download parameter #1406

Open
shunping opened this issue Jan 3, 2025 · 1 comment · May be fixed by #1411
Open

Failed to call seek when a BlobReader instance initialized with raw_download parameter #1406

shunping opened this issue Jan 3, 2025 · 1 comment · May be fixed by #1411
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@shunping
Copy link

shunping commented Jan 3, 2025

Environment details

  • OS type and version: MacOS
  • Python version: 3.10.16
  • pip version: 23.0.1
  • google-cloud-storage version: 2.19

Steps to reproduce

  1. See the following code

Code example

from google.cloud.storage import Blob
from google.cloud.storage import Bucket
from google.cloud.storage import Client

from google.cloud.storage.fileio import BlobReader

test_file="textio/textio-test-data.default.1k.txt"
client = Client("apache-beam-testing")
bucket = Bucket(client=client, name="apache-beam-samples")
blob = Blob(test_file, bucket=bucket)
reader = BlobReader(blob, raw_download=True)
reader.seek(0)

Stack trace

Traceback (most recent call last):
  File "PATH/gcs-client-bug.py", line 13, in <module>
    reader.seek(0)
  File "python/venv/lib/python3.10/site-packages/google/cloud/storage/fileio.py", line 181, in seek
    self._blob.reload(**self._download_kwargs)
TypeError: _PropertyMixin.reload() got an unexpected keyword argument 'raw_download'
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Jan 3, 2025
@shunping shunping changed the title seek failed when a BlobReader instance initialized with raw_download parameter Fail to call seek when a BlobReader instance initialized with raw_download parameter Jan 3, 2025
@shunping shunping changed the title Fail to call seek when a BlobReader instance initialized with raw_download parameter Failed to call seek when a BlobReader instance initialized with raw_download parameter Jan 3, 2025
@bajajneha27 bajajneha27 added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jan 8, 2025
@cojenco
Copy link
Contributor

cojenco commented Jan 8, 2025

Thanks for catching this. I'm working on a fix to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants