Skip to content

Commit 471aa1b

Browse files
committed
zarr3: Reject URL syntax when selected_field or open_as_void specified
The zarr3 URL syntax cannot represent field selection or void access mode. Following the pattern from zarr v2 driver (PR google#272), ToUrl() now returns an error when either of these options is specified instead of silently ignoring them.
1 parent 89098f8 commit 471aa1b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tensorstore/driver/zarr3/driver.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,14 @@ class ZarrDriverSpec
263263
}
264264

265265
Result<std::string> ToUrl() const override {
266+
if (!selected_field.empty()) {
267+
return absl::InvalidArgumentError(
268+
"zarr3 URL syntax not supported with selected_field specified");
269+
}
270+
if (open_as_void) {
271+
return absl::InvalidArgumentError(
272+
"zarr3 URL syntax not supported with open_as_void specified");
273+
}
266274
TENSORSTORE_ASSIGN_OR_RETURN(auto base_url, store.ToUrl());
267275
return tensorstore::StrCat(base_url, "|", id, ":");
268276
}

0 commit comments

Comments
 (0)