LocalStore file handling of empty paths is inconsistent with S3Store, GCSStore, etc.

オープン
#635 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
aws, google-cloud, python, rust
領域
backend, cloud

調査の方向性

まず、file:// URL に対するエントリーポイント store.from_url と get("") を追跡し、次に issue 内の S3Store と GCSStore の例と LocalStore の動作を比較します。ファイルベースの URL がオブジェクトを直接指している場合に、一貫して空のパスを受け入れ、既存のエラーが再現されるか、回帰検証でカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

upstream

When using an http-based store or s3store with a prefix that points directly to an object/file, calling get("")
will retrieve the object, i.e.

store = obstore.store.from_url("s3://my-bucket/bar.txt")
store.get("") # <-- returns bar.txt object

however for file-based paths the following does not work

store = obstore.store.from_url("file:///home/foo/bar.txt")
store.get("") # <-- throws error!

this throws the error

Generic LocalFileSystem error: Filenames containing trailing '/#\d+/' are not supported:                                                                                                                                                                           
Debug source:                                                                                                                                                      
Generic {                                                                                                                                                          
    store: "LocalFileSystem",                                                                                                                                      
    source: InvalidPath {                                                                                                                                          
        path: "",                                                                                                                                                  
    },                                                                                                                                                             
}

Ideally LocalStore would also support "". This makes tooling for downloading a file://, s3://, gs:// url easy.

Alternatively this issue could be worked around if there were a way of constructing a store from a url, but unprefixed and returning the prefix separately, i.e. something like

store, prefix = obstore.store.unprefixed_from_url("file://foo/bar.txt")
store.get(prefix) # <-- works for file:// now!
主要言語
Python
スター
842
フォーク
50
平均マージ
9時間
マージ済み PR(30日)
13

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

developmentseed/obstore のほかの issue

developmentseed/obstore の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。