You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
I'm writing integration tests against a local GCS instance using fake-gcs-server, however, the call when reading the file does not seem to work:
➜ python git:(fd-gcs) ✗ ipython
Python 3.9.17 (main, Jun 20 2023, 18:00:22)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from pyarrow.fs import GcsFileSystem
...: from datetime import datetime
...:
...: fs = GcsFileSystem(
...: access_token='anon',
...: credential_token_expiration=datetime(2023, 8, 2, 16, 30, 4),
...: scheme='http',
...: endpoint_override='0.0.0.0:4443'
...: )
In [2]: location = 'warehouse/vo.txt'
...:
...: with fs.open_output_stream(location) as f:
...: print(f.write(b"foo"))
3
In [3]: print(fs.get_file_info(location))
<FileInfo for 'warehouse/vo.txt': type=FileType.File, size=3>
In [4]: with fs.open_input_file(location) as f:
...: print(f.read())
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[4], line 1
----> 1 with fs.open_input_file(location) as f:
2 print(f.read())
File ~/Library/Python/3.9/lib/python/site-packages/pyarrow/_fs.pyx:763, in pyarrow._fs.FileSystem.open_input_file()
File ~/Library/Python/3.9/lib/python/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status()
File ~/Library/Python/3.9/lib/python/site-packages/pyarrow/error.pxi:113, in pyarrow.lib.check_status()
FileNotFoundError: [Errno 2] google::cloud::Status(NOT_FOUND: Permanent error in Read(): ). Detail: [errno 2] No such file or directory
I am not sure what version of google-cloud-cpp is this using under the hood. Until v2.7.0 google-cloud-cpp used the XML API for (most) downloads. The XML API does not use the /storage/v1/b/ prefix. AFAIK fake-gcs-server does not support the XML API. At least it used to not support it, and #331 is still open.
Setting the GOOGLE_CLOUD_CPP_STORAGE_REST_CONFIG environment variable to disable-xml should disable XML and allow you to use fake-gcs-server.
If you are using a newer version of google-cloud-cpp then disregard these comments.
Describe the bug, including details regarding any error messages, version, and platform.
I'm writing integration tests against a local GCS instance using fake-gcs-server, however, the call when reading the file does not seem to work:
Can be reproduced using:
Failing calls with PyArrow
The last call is causing the 404, and it seems to be missing
/storage/v1/b/
.The equivalent code using GCSSpec:
This only seems to happen when the
endpoint_override
is setComponent(s)
Python
The text was updated successfully, but these errors were encountered: