Tolerate mdio-python 1.x stores on open; report missing store clearly - #179
Open
thiago-carneiro wants to merge 4 commits into
Open
thiago-carneiro wants to merge 4 commits into
thiago-carneiro wants to merge 4 commits into
Conversation
DetectVersion defaulted to V2 when a path had no store markers at all (no zarr.json and no .zgroup), so opening a non-existent path fell through to the V2 reader and surfaced as a confusing .zmetadata parse error. Return a clear "not an MDIO store or path does not exist" error from DetectVersion (its only caller is from_zmetadata) and propagate detection failures there instead of silently defaulting to V2.
mdio-python 1.x to_mdio writes no name/apiVersion/createdOn in the root metadata. The path-based Dataset::Open already opens such stores (the schema's required fields only gate the create path via Construct), but it did so silently; it now emits an ABSL_LOG(WARNING) naming the missing fields. Stores carrying the v0 marker (api_version) are skipped so the dedicated v0 rejection stays the first message. The create path keeps rejecting creation specs without the fields, and the writer is unchanged.
mdio-python 1.x writes name/apiVersion/createdOn via its DatasetMetadata model, so 'writes none of them' was wrong. The tolerance is unchanged: the fields are informational and do not affect reads, so a store missing them warns instead of failing to open.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #177
Summary
Two robustness fixes in the open path, driven by real interop failures with
stores written by mdio-python 1.x (see #177):
Missing-store detection —
zarr::DetectVersionpreviously defaulted toZarrVersion::kV2when a path had no version markers at all (neitherzarr.jsonnor.zgroup). The wrong default surfaced downstream as aconfusing
.zmetadataparse error. It now fails withnot an MDIO store or path does not exist: <path>.Tolerate missing informational dataset metadata — mdio-python 1.x
to_mdiowrites none ofname/apiVersion/createdOn, so openingsuch a store was rejected outright. These fields are purely informational:
the read path now warns (
ABSL_LOG(WARNING)) and continues, while thecreate path (
from_json->Construct->validate_dataset) keepsrequiring them. Stores carrying the v0 marker (
api_version) are skippedfrom the warning — they are rejected downstream with their dedicated v0
error, and a metadata warning there would only mislead.
Changes
mdio/zarr/zarr_driver.h: no silent V2 fallback; the error carries the store path.mdio/dataset.h:kInformationalDatasetFields+WarnOnMissingDatasetMetadata()wired into the open path.
fields; it does not.
Testing
openNonExistentPathReportsMissingStore,openV3WithoutDatasetMetadata,openV3WithDatasetMetadata,createSpecWithoutDatasetMetadataIsRejected.(fill-value parity, xarray and multidimio compatibility) against
mdio-python 1.2.3.