From 7ed55ed9de5ab9d9ea2abaa9e1ddae8690ddcf0a Mon Sep 17 00:00:00 2001 From: Zolisa Bleki Date: Sun, 1 Dec 2024 00:32:44 +0200 Subject: [PATCH] disable erase function --- zarr-eio/src/storage.ml | 5 +++-- zarr-sync/test/test_sync.ml | 1 + zarr/src/storage/http.ml | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/zarr-eio/src/storage.ml b/zarr-eio/src/storage.ml index 954550e..1cec2fe 100644 --- a/zarr-eio/src/storage.ml +++ b/zarr-eio/src/storage.ml @@ -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 let erase_prefix _ = raise Not_implemented let list _ = raise Not_implemented let list_dir _ = raise Not_implemented diff --git a/zarr-sync/test/test_sync.ml b/zarr-sync/test/test_sync.ml index d6544c9..4842155 100644 --- a/zarr-sync/test/test_sync.ml +++ b/zarr-sync/test/test_sync.ml @@ -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); diff --git a/zarr/src/storage/http.ml b/zarr/src/storage/http.ml index 3d1582e..e517df8 100644 --- a/zarr/src/storage/http.ml +++ b/zarr/src/storage/http.ml @@ -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