【问题标题】:pd.read_parquet produces: OSError: Passed non-file pathpd.read_parquet 产生:OSError: Passed non-file path
【发布时间】:2021-11-25 03:19:11
【问题描述】:

我正在尝试使用 pd.read_parquet 检索 DataFrame,但出现以下错误:

OSError: Passed non-file path: my/path

我使用前缀为 gs:// 的路径访问 GCS 中的 .parquet 文件 由于某些未知原因,OSError 显示不带前缀 gs:// 的路径 我确实怀疑它与凭据有关,但是在我的 Mac 上我可以毫无问题地使用 gsutil。我可以通过 Google Cloud Platform 访问和下载 parquet 文件。我只是无法直接在 gs:// 路径中读取 .parquet 文件。有什么想法为什么不呢?

【问题讨论】:

    标签: python-3.x pandas google-cloud-platform google-cloud-storage parquet


    【解决方案1】:

    Arrow 目前不支持从 GCS 加载数据。在执行此任务方面取得了一些进展,这些任务在JIRA 中进行了跟踪。

    作为一种解决方法,您应该能够使用fsspec GCS filesystem implementation 访问对象(我会尝试安装它并使用“gcs://”而不是“gs://”),或者直接使用 gcsfs 打开文件api 并通过它。

    【讨论】:

      猜你喜欢
      • 2021-02-10
      • 2015-05-06
      • 1970-01-01
      • 2016-08-07
      • 2020-02-04
      • 1970-01-01
      • 1970-01-01
      • 2022-01-03
      • 2020-02-09
      相关资源
      最近更新 更多