Skip to content

Commit

Permalink
disable erase function
Browse files Browse the repository at this point in the history
  • Loading branch information
zoj613 committed Nov 30, 2024
1 parent 4c5e8ee commit 7ed55ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions zarr-eio/src/storage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,15 @@ module HttpStore = struct
in
set t key (List.fold_left f ov rsv)

let erase t key =
(*let erase t key =
Eio.Switch.run @@ fun sw ->
let url = Uri.with_path t.base_url key in
let resp, _ = Client.delete ~sw t.client url in
match Http.Response.status resp with
| #Http.Status.success -> Deferred.return_unit
| e -> raise_status_error e
| e -> raise_status_error e *)

let erase _ = raise Not_implemented

Check warning on line 224 in zarr-eio/src/storage.ml

View check run for this annotation

Codecov / codecov/patch

zarr-eio/src/storage.ml#L224

Added line #L224 was not covered by tests
let erase_prefix _ = raise Not_implemented
let list _ = raise Not_implemented
let list_dir _ = raise Not_implemented
Expand Down
1 change: 1 addition & 0 deletions zarr-sync/test/test_sync.ml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ let _ =
assert_raises
(HttpStore.Request_failed (404, "fakegroup/zarr.json not found"))
(fun () -> HttpStore.Array.metadata store Node.Array.(gnode / "fakegroup"));
assert_raises HttpStore.Not_implemented (fun () -> HttpStore.Array.reshape store anode [|25;32;20|]);
assert_raises HttpStore.Not_implemented (fun () -> HttpStore.Array.rename store anode "newname");
assert_raises HttpStore.Not_implemented (fun () -> HttpStore.Group.children store gnode);
assert_raises HttpStore.Not_implemented (fun () -> HttpStore.hierarchy store);
Expand Down
7 changes: 4 additions & 3 deletions zarr/src/storage/http.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ module Make (Deferred : Types.Deferred) (C : C with type 'a io = 'a Deferred.t)
set t key (List.fold_left f ov rsv)

(* make reshaping arrays possible *)
let erase t key =
(*let erase t key =
let tries = t.tries and client = t.client and config = t.config in
let url = t.base_url ^ key in
let+ res = C.http ~tries ~client ~config ~url ~meth:DELETE () in
match fold_result res with
| {code; _} when code = 200 -> ()
| {code; body; _} -> raise (Request_failed (code, body))
| {code; _} when code = 200 || code = 404 -> ()
| {code; body; _} -> raise (Request_failed (code, body)) *)

let erase _ = raise Not_implemented
let erase_prefix _ = raise Not_implemented
let list _ = raise Not_implemented
let list_dir _ = raise Not_implemented
Expand Down

0 comments on commit 7ed55ed

Please sign in to comment.