我正在使用s3的api网关代理来读取feather文件。下面是我正在使用的代码的最简单形式
import pandas as pd
s3_data=pd.read_feather('https://<api_gateway>/<bucket_name/data.feather>')
这会产生一个错误-
reader = _feather.FeatherReader(source, use_memory_map=memory_map)
File "pyarrow\_feather.pyx", line 75, in pyarrow._feather.FeatherReader.__cinit__
File "pyarrow\error.pxi", line 143, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow\error.pxi", line 114, in pyarrow.lib.check_status
OSError: Verification of flatbuffer-encoded Footer failed.
如果我把feather文件保存在我的本地文件中,并像下面那样阅读,那么一切都很好
s3_data=pd.read_feather("file://localhost//C://Users//<Username>//Desktop//data.feather")
我该怎么做
可能网关代理需要执行一些重定向,这会导致它失败。我会这样做:
s3fs是Dask的一部分。还可以使用其他类似的层
PS:如果您使用feather进行长期数据存储,Apache Arrow项目建议不要使用它(feather的维护者)。你可能应该用拼花地板
相关问题 更多 >
编程相关推荐