sdmxlib 0.85.0__tar.gz → 0.87.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/PKG-INFO +1 -1
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/pyproject.toml +1 -1
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/pyproject.toml.orig +1 -1
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/EGM.md +10 -2
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/__init__.py +4 -1
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_check.py +61 -15
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/EGM.md +19 -8
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/__init__.py +9 -1
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/_reader.py +84 -10
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/EGM.md +4 -2
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_manifest.py +16 -6
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/LICENSE +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/README.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/_duckdb.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/_facet_types.xsd +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/_facets.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/_read_errors.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/_singleflight.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/_time.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/_freshness.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/client.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/federated.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/policy.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/providers.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/registry.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/api/session.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/builders/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/builders/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/builders/contentconstraint.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/data_store.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_availability.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_build.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_canonical.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_copy.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_fetch.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_finding.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_fingerprint.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_overlay.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_remote.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/_write.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/manifest.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/edition/overlay.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_arrow.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_attachment.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_coerce.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_index.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_positions.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_refuse.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/_tags.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/data_format.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/gaps.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/render.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_csv/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_periods.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json_1_0/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml30/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml31/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/_format.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/_routing.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/_rules.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/conformance.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/catalog-2.0.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/catalog.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/current.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/history.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/leaf.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/root-1.2.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/root.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/segment-header.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/inventory/schemas/segment-line.schema.json +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/_scan.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/data_store.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/engine.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/object_store.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/registry.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/local/sql.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_binding.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_container.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_invariants.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_items.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_label_match.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_rebind.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_referenceable.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_refshape.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_resolvers.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_rules.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/_tree.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/annotations.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/base.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/binding.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/category.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/codelist.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/collections.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/concept.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/constraint.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/convert.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/dataflow.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/datastructure.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/errors.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/expr.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/header.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/hierarchy.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/in_memory_registry.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/istring.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/link.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/mapping.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/message.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/metadata_provision.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/metadataflow.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/metadataset.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/metadatastructure.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/organisation.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/provision.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/ref.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/registry.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/representation.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/rest_api.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/rollup.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/urn.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/validation.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/valuelist.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/version.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/model/version_rewrite.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/polars.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/py.typed +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/EGM.md +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_closure.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_common.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_compile.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_edges.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_execute.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_expr.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_joins.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_plan.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_pushdown.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_rebase.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/_rest.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/accessors.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/observations.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/query.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/raw.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/query/schema.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/rest.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/session.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/sql.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/__init__.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_checked.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_columns.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_files.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_kinds.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_layout.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_parsed.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_projections.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_references.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_synthetic.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_tags.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/_trim.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/lazy.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/readers.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/resolve.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/schema.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/storage/writers.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/testing.py +0 -0
- {sdmxlib-0.85.0 → sdmxlib-0.87.0}/src/sdmxlib/versions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sdmxlib
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.87.0
|
|
4
4
|
Summary: SDMX for Python: structures, reference metadata and observation data, from REST, files or a local DuckDB store.
|
|
5
5
|
Keywords: sdmx,statistics,metadata,datastructure
|
|
6
6
|
Author: gabrielgellner
|
|
@@ -45,12 +45,15 @@ seals through `seal(extensions=...)`.
|
|
|
45
45
|
`references` check also accepts a reference one of the `structures=`
|
|
46
46
|
editions holds as a full artefact or an item of one
|
|
47
47
|
(`storage._references.held_targets`; spec §6.5 item 9, GH-351). A data
|
|
48
|
-
product's references resolve in its own edition alone.
|
|
48
|
+
product's references resolve in its own edition alone. `references=False`
|
|
49
|
+
skips the `references` check at `receive` and leaves it out of
|
|
50
|
+
`Report.checked`, and raises `ValueError` at `publish` and `open` (GH-371).
|
|
51
|
+
`structures=` then still runs the `partials` check.
|
|
49
52
|
- `check_on_open` (`_check.py`): runs one profile per call. Without a stamp
|
|
50
53
|
for this `(product_id, edition id, manifest sha256)` it runs `receive` and writes
|
|
51
54
|
the stamp when the report is clean; with one it runs `open`. An unreadable
|
|
52
55
|
manifest, or a `product_id` that cannot name a stamp path, gets a `receive`
|
|
53
|
-
check and no stamp.
|
|
56
|
+
check and no stamp. `references=False` goes to its `receive` calls only.
|
|
54
57
|
- `copy_edition` and `edition_files` (`_copy.py`): copy the files of the chosen
|
|
55
58
|
tiers and verify each one, and list the paths such a copy needs.
|
|
56
59
|
- `verify_remote`, `RemoteFile`, `content_md5` and `content_crc32c`
|
|
@@ -90,6 +93,7 @@ seals through `seal(extensions=...)`.
|
|
|
90
93
|
its availability and for coded-column values outside their enumeration.
|
|
91
94
|
`seal` and `check_edition(at="publish")` both call it.
|
|
92
95
|
- Manifest types, re-exported from `storage._manifest`: `read_manifest`,
|
|
96
|
+
`decode_manifest` (the same read from bytes, naming `source` in its errors),
|
|
93
97
|
`Manifest`, `Producer`, `Provenance`, `EditionFile`, `ArtefactEntry`,
|
|
94
98
|
`BindingCount`, `Tier`, `ManifestError`, `StoreFormatError`, and the
|
|
95
99
|
constants `DATA_PATH`, `MANIFEST_NAME`, `SIGNATURE_NAME`, `FORMAT_VERSION`
|
|
@@ -130,6 +134,10 @@ seals through `seal(extensions=...)`.
|
|
|
130
134
|
exists.
|
|
131
135
|
- `check_on_open` writes a stamp only after a clean `receive` check, and only
|
|
132
136
|
to a path made of exactly two plain components under the stamps directory.
|
|
137
|
+
- A stamp satisfies a full `check_on_open` only when its `checked` lists
|
|
138
|
+
`references`. A `references=False` call accepts either stamp. A full call
|
|
139
|
+
that meets a deferred stamp runs `receive`, and replaces the stamp when that
|
|
140
|
+
finds nothing.
|
|
133
141
|
- `settle_lake` never deletes files from `data/`.
|
|
134
142
|
- `check_edition`'s `tags` check, at `publish` and `receive`, reports every
|
|
135
143
|
stored language tag `normalize_tag` would change or refuse: a store built
|
|
@@ -6,7 +6,8 @@ edition id, and the ``data/`` every edition shares.
|
|
|
6
6
|
minting its edition id; `seal` seals it: a file list with a sha256 per file,
|
|
7
7
|
observation counts per binding, and the ``edition_id``, the value a cache or
|
|
8
8
|
an ETag keys on. ``LocalRegistry.edition(edition_dir)`` opens it read-only.
|
|
9
|
-
`read_manifest` reads a manifest back, refusing a format it cannot read
|
|
9
|
+
`read_manifest` reads a manifest back, refusing a format it cannot read, and
|
|
10
|
+
`decode_manifest` does the same for bytes a caller already holds;
|
|
10
11
|
`check_edition` checks an edition against it and against itself;
|
|
11
12
|
`copy_edition` copies one elsewhere, manifest last, and `edition_files` lists
|
|
12
13
|
what such a copy needs for another tool; `verify_remote` checks the
|
|
@@ -88,6 +89,7 @@ from sdmxlib.storage._manifest import (
|
|
|
88
89
|
SIGNATURE_NAME,
|
|
89
90
|
StoreFormatError,
|
|
90
91
|
Tier,
|
|
92
|
+
decode_manifest,
|
|
91
93
|
read_manifest,
|
|
92
94
|
)
|
|
93
95
|
|
|
@@ -133,6 +135,7 @@ __all__ = [
|
|
|
133
135
|
"content_crc32c",
|
|
134
136
|
"content_md5",
|
|
135
137
|
"copy_edition",
|
|
138
|
+
"decode_manifest",
|
|
136
139
|
"discard",
|
|
137
140
|
"edition_files",
|
|
138
141
|
"effective_token",
|
|
@@ -94,6 +94,7 @@ def check_edition(
|
|
|
94
94
|
fingerprints: bool | None = None,
|
|
95
95
|
expect: Manifest | str | Path | None = None,
|
|
96
96
|
structures: str | Path | Sequence[str | Path] | None = None,
|
|
97
|
+
references: bool = True,
|
|
97
98
|
extensions: Mapping[str, Check] | None = None,
|
|
98
99
|
) -> Report:
|
|
99
100
|
"""Check a sealed edition against its manifest and against itself, as profile `at` asks.
|
|
@@ -107,7 +108,7 @@ def check_edition(
|
|
|
107
108
|
| remote: ``data/``'s entries in object storage, by size | no | with `remote` and no `lookup` | no |
|
|
108
109
|
| lake: current files at their recorded size, no delete file, every referenced file listed | yes | yes | no |
|
|
109
110
|
| bindings: the manifest's, each with the count it gives | yes | yes | no |
|
|
110
|
-
| references: every stored reference
|
|
111
|
+
| references: every stored reference is in the store (see `structures`) | yes | unless `references` is False | no |
|
|
111
112
|
| tags: every stored language tag is in the form `normalize_tag` gives | yes | yes | no |
|
|
112
113
|
| fingerprints: recomputed, equal to the manifest's | unless `fingerprints` is False | if it is True | no |
|
|
113
114
|
| availability: coded columns hold codes; stored availability is the data's | yes | no | no |
|
|
@@ -171,6 +172,13 @@ def check_edition(
|
|
|
171
172
|
of one (sharded catalog spec §6.5 item 9). A data product
|
|
172
173
|
vendors its closure, so its references resolve in the edition
|
|
173
174
|
alone.
|
|
175
|
+
references: Whether to run the ``references`` check. False is for
|
|
176
|
+
``receive`` only, for a caller that cannot name the other editions
|
|
177
|
+
a structure product's references resolve in, and leaves
|
|
178
|
+
``references`` out of `Report.checked`. A later check has to cover
|
|
179
|
+
them. `structures` then still runs the ``partials`` check. An
|
|
180
|
+
edition with bindings is allowed, and its references go unchecked
|
|
181
|
+
too.
|
|
174
182
|
extensions: More checks, by name, for parts of the edition other
|
|
175
183
|
packages own (statcatlib's search index, say).
|
|
176
184
|
|
|
@@ -180,9 +188,12 @@ def check_edition(
|
|
|
180
188
|
Raises:
|
|
181
189
|
ValueError: If `lookup`, `remote` or `structures` is given at a
|
|
182
190
|
profile that does not use it, `fingerprints` is True at ``open``,
|
|
183
|
-
|
|
191
|
+
`references` is False at ``publish`` or ``open``, or `structures`
|
|
192
|
+
is an empty sequence.
|
|
184
193
|
"""
|
|
185
|
-
_refuse_unused(
|
|
194
|
+
_refuse_unused(
|
|
195
|
+
at, lookup=lookup, fingerprints=fingerprints, remote=remote, structures=structures, references=references
|
|
196
|
+
)
|
|
186
197
|
root = Path(path)
|
|
187
198
|
checked: list[str] = ["manifest"]
|
|
188
199
|
try:
|
|
@@ -220,6 +231,7 @@ def check_edition(
|
|
|
220
231
|
sized_remotely=remote is not None and lookup is None,
|
|
221
232
|
fingerprints=fingerprints,
|
|
222
233
|
structures=_editions(structures),
|
|
234
|
+
references=references,
|
|
223
235
|
extensions=extensions or {},
|
|
224
236
|
)
|
|
225
237
|
for name, step in steps:
|
|
@@ -251,6 +263,7 @@ def _refuse_unused(
|
|
|
251
263
|
fingerprints: bool | None,
|
|
252
264
|
remote: str | None,
|
|
253
265
|
structures: str | Path | Sequence[str | Path] | None,
|
|
266
|
+
references: bool,
|
|
254
267
|
) -> None:
|
|
255
268
|
"""Raise for an argument the profile `at` does not use."""
|
|
256
269
|
if structures is not None and not isinstance(structures, (str, Path)) and not structures:
|
|
@@ -268,6 +281,12 @@ def _refuse_unused(
|
|
|
268
281
|
if fingerprints and at == "open":
|
|
269
282
|
msg = "fingerprints=True recomputes them from the store; at='open' reads no store"
|
|
270
283
|
raise ValueError(msg)
|
|
284
|
+
if not references and at != "receive":
|
|
285
|
+
msg = (
|
|
286
|
+
f"references=False defers the references check at receive; at={at!r} "
|
|
287
|
+
"does not use it, since a seal must check references and open never does"
|
|
288
|
+
)
|
|
289
|
+
raise ValueError(msg)
|
|
271
290
|
|
|
272
291
|
|
|
273
292
|
def _steps(
|
|
@@ -279,6 +298,7 @@ def _steps(
|
|
|
279
298
|
sized_remotely: bool,
|
|
280
299
|
fingerprints: bool | None,
|
|
281
300
|
structures: tuple[Path, ...] | None,
|
|
301
|
+
references: bool,
|
|
282
302
|
extensions: Mapping[str, Check],
|
|
283
303
|
) -> list[tuple[str, Callable[[], Iterable[Finding]]]]:
|
|
284
304
|
"""The checks that read the store, by name, in the order profile `at` runs them."""
|
|
@@ -288,11 +308,10 @@ def _steps(
|
|
|
288
308
|
if at != "open":
|
|
289
309
|
if (root / "tables.ducklake").exists():
|
|
290
310
|
steps.append(("lake", partial(_lake, root, manifest, reg)))
|
|
291
|
-
steps
|
|
292
|
-
|
|
293
|
-
("references", partial(_references, reg, None if manifest.bindings else structures))
|
|
294
|
-
|
|
295
|
-
]
|
|
311
|
+
steps.append(("bindings", partial(_bindings, manifest, reg)))
|
|
312
|
+
if references:
|
|
313
|
+
steps.append(("references", partial(_references, reg, None if manifest.bindings else structures)))
|
|
314
|
+
steps.append(("tags", partial(_tags, reg)))
|
|
296
315
|
if fingerprints or (fingerprints is None and at == "publish"):
|
|
297
316
|
steps.append(("fingerprints", partial(_fingerprints, root, manifest, reg)))
|
|
298
317
|
if at == "publish":
|
|
@@ -309,6 +328,7 @@ def check_on_open(
|
|
|
309
328
|
remote: str | None = None,
|
|
310
329
|
engine: EditionEngine | None = None,
|
|
311
330
|
lookup: Lookup | None = None,
|
|
331
|
+
references: bool = True,
|
|
312
332
|
extensions: Mapping[str, Check] | None = None,
|
|
313
333
|
) -> Report:
|
|
314
334
|
"""Check an edition as a server opens it: ``receive`` once per edition id and manifest, ``open`` after.
|
|
@@ -319,6 +339,12 @@ def check_on_open(
|
|
|
319
339
|
runs, which hashes nothing. With none, or a stamp for another manifest
|
|
320
340
|
under the same edition id, the ``receive`` profile runs first.
|
|
321
341
|
|
|
342
|
+
A stamp satisfies a full check only when its recorded checks list
|
|
343
|
+
``references``. A call with ``references=False`` accepts either stamp. A
|
|
344
|
+
full call that meets a stamp from a deferred check runs ``receive``, and
|
|
345
|
+
replaces the stamp when that finds nothing. A stamp that a deferring call
|
|
346
|
+
wrote stays in place when that ``receive`` finds something.
|
|
347
|
+
|
|
322
348
|
Args:
|
|
323
349
|
path: The edition directory.
|
|
324
350
|
stamps: The directory holding the stamps, outside every edition: local
|
|
@@ -326,25 +352,37 @@ def check_on_open(
|
|
|
326
352
|
remote: As `check_edition`'s, for either profile.
|
|
327
353
|
engine: As `check_edition`'s, for either profile.
|
|
328
354
|
lookup: As `check_edition`'s, for the receive check.
|
|
355
|
+
references: As `check_edition`'s, for the receive check. The ``open``
|
|
356
|
+
profile never runs that check.
|
|
329
357
|
extensions: As `check_edition`'s, for either profile.
|
|
330
358
|
|
|
331
359
|
Returns:
|
|
332
360
|
The report of the profile that ran; its ``at`` says which.
|
|
333
361
|
"""
|
|
334
362
|
root = Path(path)
|
|
363
|
+
receive = partial(
|
|
364
|
+
check_edition,
|
|
365
|
+
root,
|
|
366
|
+
at="receive",
|
|
367
|
+
remote=remote,
|
|
368
|
+
engine=engine,
|
|
369
|
+
lookup=lookup,
|
|
370
|
+
references=references,
|
|
371
|
+
extensions=extensions,
|
|
372
|
+
)
|
|
335
373
|
try:
|
|
336
374
|
digest = hashlib.sha256((root / MANIFEST_NAME).read_bytes()).hexdigest()
|
|
337
375
|
manifest = read_manifest(root)
|
|
338
376
|
except OSError, ManifestError:
|
|
339
|
-
return
|
|
377
|
+
return receive()
|
|
340
378
|
stamp = Path(stamps) / manifest.product_id / manifest.edition_id
|
|
341
379
|
if not _names_a_file_under(stamp, Path(stamps)):
|
|
342
|
-
report =
|
|
380
|
+
report = receive()
|
|
343
381
|
detail = f"product_id {manifest.product_id!r} cannot name a stamp directory, so the check is not stamped"
|
|
344
382
|
return attrs.evolve(report, findings=(*report.findings, Finding("manifest", MANIFEST_NAME, detail)))
|
|
345
|
-
if _stamped(stamp, digest):
|
|
383
|
+
if _stamped(stamp, digest, references=references):
|
|
346
384
|
return check_edition(root, at="open", remote=remote, engine=engine, extensions=extensions)
|
|
347
|
-
report =
|
|
385
|
+
report = receive()
|
|
348
386
|
if report.ok:
|
|
349
387
|
_write_stamp(stamp, digest, report)
|
|
350
388
|
return report
|
|
@@ -359,13 +397,21 @@ def _names_a_file_under(stamp: Path, stamps: Path) -> bool:
|
|
|
359
397
|
return len(parts) == 2 and all(part not in {".", ".."} for part in parts)
|
|
360
398
|
|
|
361
399
|
|
|
362
|
-
def _stamped(stamp: Path, digest: str) -> bool:
|
|
363
|
-
"""Whether `stamp` records a clean receive check of the manifest with sha256 `digest`.
|
|
400
|
+
def _stamped(stamp: Path, digest: str, *, references: bool) -> bool:
|
|
401
|
+
"""Whether `stamp` records a clean receive check of the manifest with sha256 `digest`.
|
|
402
|
+
|
|
403
|
+
When `references` is true, the recorded check must also list ``references``.
|
|
404
|
+
"""
|
|
364
405
|
try:
|
|
365
406
|
recorded = json.loads(stamp.read_text())
|
|
366
407
|
except OSError, ValueError:
|
|
367
408
|
return False
|
|
368
|
-
|
|
409
|
+
if not isinstance(recorded, dict) or recorded.get("manifest_sha256") != digest:
|
|
410
|
+
return False
|
|
411
|
+
if not references:
|
|
412
|
+
return True
|
|
413
|
+
checked = recorded.get("checked")
|
|
414
|
+
return isinstance(checked, list) and "references" in checked
|
|
369
415
|
|
|
370
416
|
|
|
371
417
|
def _write_stamp(stamp: Path, digest: str, report: Report) -> None:
|
|
@@ -59,13 +59,15 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
|
|
|
59
59
|
base's and refuses a base more than `MAX_BASE_AHEAD` ahead; `next_root`
|
|
60
60
|
takes `previous_bytes` and `changes` together and writes both history
|
|
61
61
|
fields; `entry_record` is a change item's copy of a `LeafEntry`.
|
|
62
|
-
- Reading (`_reader.py`): `LiveInventory(fetch, schema_version
|
|
63
|
-
`FullInventory(fetch
|
|
64
|
-
`
|
|
62
|
+
- Reading (`_reader.py`): `LiveInventory(fetch, schema_version=...,
|
|
63
|
+
leaf_threads=...)` and `FullInventory(fetch, leaf_threads=...)`
|
|
64
|
+
(`DEFAULT_LEAF_THREADS`, 64), each with `refresh()`, `seq`, `restore_epoch`
|
|
65
|
+
and `skipped`; `LiveInventory.editions()`, `products()` and `head(product)`
|
|
65
66
|
return `LiveEdition`s, which carry the entry's `dataflows`, `pull_bytes`
|
|
66
67
|
and `artefacts` (None when absent); `FullInventory.root`, `embargo`,
|
|
67
68
|
`retired`, `products()`, `leaf()`, `leaves()` and `entries()`. `local_fetch(dir)`
|
|
68
|
-
is a `Fetch` over a directory.
|
|
69
|
+
is a `Fetch` over a directory. A `Fetch` may be called from several threads
|
|
70
|
+
at once.
|
|
69
71
|
- `repairable(journal, leaves, retired)` (`_rules.py`): the seal-journal
|
|
70
72
|
entries the narrow repair (spec §6.7) may record: those the newest version
|
|
71
73
|
neither names nor tombstones.
|
|
@@ -93,6 +95,14 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
|
|
|
93
95
|
`restore_epoch` changed; it verifies the root `CURRENT` names, probes
|
|
94
96
|
`seq + 1` onward without listing, and skips an invalid root into
|
|
95
97
|
`skipped`. A leaf must hash to its name.
|
|
98
|
+
- `LiveInventory.editions()`, `LiveInventory.products()` and
|
|
99
|
+
`FullInventory.leaves()` make one GET per leaf the reader does not hold. With
|
|
100
|
+
two or more to fetch and `leaf_threads` above 1, the GETs run on a pool that
|
|
101
|
+
ends before the call returns or raises. Only `fetch` runs on a worker: the
|
|
102
|
+
calling thread checks, decodes and holds each leaf in sorted product order.
|
|
103
|
+
The first bad leaf in that order raises and the leaves before it stay held,
|
|
104
|
+
as in a sequential read. Fetches in flight then finish, and fetches not yet
|
|
105
|
+
started are cancelled. A read of one product fetches in the calling thread.
|
|
96
106
|
- With `CURRENT` present and verifying, a reader fetches only `CURRENT` and
|
|
97
107
|
roots. Otherwise it reads `catalog.json` and, on 2.x, `inventory/HISTORY`;
|
|
98
108
|
takes the epoch from `HISTORY` (2.x) or `catalog.json` (1.x); bounds its
|
|
@@ -115,13 +125,14 @@ statcatlib owns the writer. sdmxlib holds no blob client: the reader takes a
|
|
|
115
125
|
|
|
116
126
|
## Side Effects
|
|
117
127
|
|
|
118
|
-
- None: the rules are pure, the readers read only through
|
|
119
|
-
leaves by hash, and `route` reads only through the
|
|
120
|
-
is given.
|
|
128
|
+
- None on the catalog: the rules are pure, the readers read only through
|
|
129
|
+
`fetch`, caching leaves by hash, and `route` reads only through the
|
|
130
|
+
`manifest` callable it is given. A read of every product starts up to
|
|
131
|
+
`leaf_threads` threads for its own duration.
|
|
121
132
|
|
|
122
133
|
## Verification
|
|
123
134
|
|
|
124
|
-
- `uv run pytest -m unit tests/unit/test_inventory.py tests/unit/test_inventory_history.py tests/unit/test_inventory_reader_fallback.py tests/unit/test_inventory_history_schemas.py tests/unit/test_inventory_conformance.py tests/unit/test_inventory_routing.py`.
|
|
135
|
+
- `uv run pytest -m unit tests/unit/test_inventory.py tests/unit/test_inventory_history.py tests/unit/test_inventory_reader_fallback.py tests/unit/test_inventory_history_schemas.py tests/unit/test_inventory_conformance.py tests/unit/test_inventory_routing.py tests/unit/test_inventory_concurrent_leaves.py`.
|
|
125
136
|
The conformance suite runs against two backends in
|
|
126
137
|
`tests/support/inventory_backends.py`: the file protocol, written by the
|
|
127
138
|
reference writer in `tests/support/inventory.py` (it writes the history
|
|
@@ -76,7 +76,14 @@ from sdmxlib.inventory._format import (
|
|
|
76
76
|
validate_leaf,
|
|
77
77
|
validate_root,
|
|
78
78
|
)
|
|
79
|
-
from sdmxlib.inventory._reader import
|
|
79
|
+
from sdmxlib.inventory._reader import (
|
|
80
|
+
DEFAULT_LEAF_THREADS,
|
|
81
|
+
Fetch,
|
|
82
|
+
FullInventory,
|
|
83
|
+
LiveEdition,
|
|
84
|
+
LiveInventory,
|
|
85
|
+
local_fetch,
|
|
86
|
+
)
|
|
80
87
|
from sdmxlib.inventory._routing import Route, RoutingFields, manifest_records, route, routing_fields, verify_entry
|
|
81
88
|
from sdmxlib.inventory._rules import (
|
|
82
89
|
CREATED_AT_STEP,
|
|
@@ -106,6 +113,7 @@ __all__ = [
|
|
|
106
113
|
"CATALOG_NAME",
|
|
107
114
|
"CREATED_AT_STEP",
|
|
108
115
|
"CURRENT_NAME",
|
|
116
|
+
"DEFAULT_LEAF_THREADS",
|
|
109
117
|
"HISTORY_DIR",
|
|
110
118
|
"HISTORY_FORMAT",
|
|
111
119
|
"HISTORY_NAME",
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
sdmxlib holds no blob client (spec §11.5): a reader is given
|
|
4
4
|
``fetch(path) -> bytes | None``, a path relative to the catalog root to its
|
|
5
5
|
bytes, or None when nothing is there. `local_fetch` reads a directory; a
|
|
6
|
-
pod passes one over ``obstore`` or ``fsspec``.
|
|
6
|
+
pod passes one over ``obstore`` or ``fsspec``. A reader may call `fetch` from
|
|
7
|
+
several threads at once, so a `fetch` must be safe to call that way.
|
|
7
8
|
|
|
8
9
|
The read protocol (spec §6.6):
|
|
9
10
|
|
|
@@ -27,6 +28,13 @@ has no ``HISTORY``.
|
|
|
27
28
|
A root that does not validate is skipped and reported in `skipped`, and the
|
|
28
29
|
last valid version is kept.
|
|
29
30
|
|
|
31
|
+
A read of every product (`LiveInventory.editions`, `LiveInventory.products`,
|
|
32
|
+
`FullInventory.leaves`) fetches the leaves the reader does not hold on a pool
|
|
33
|
+
of ``leaf_threads`` threads, then checks and decodes them in the calling thread
|
|
34
|
+
in sorted product order. The first bad leaf in that order raises. The leaves
|
|
35
|
+
before it stay held, and fetches not yet started are cancelled. A read of one
|
|
36
|
+
product, and a read with one leaf to fetch, fetch in the calling thread.
|
|
37
|
+
|
|
30
38
|
Two views, constructed separately so a public reader holds nothing it must
|
|
31
39
|
filter:
|
|
32
40
|
|
|
@@ -36,7 +44,8 @@ filter:
|
|
|
36
44
|
and the operational objects.
|
|
37
45
|
"""
|
|
38
46
|
|
|
39
|
-
from collections.abc import Callable, Mapping
|
|
47
|
+
from collections.abc import Callable, Iterable, Mapping
|
|
48
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
40
49
|
from pathlib import Path
|
|
41
50
|
from typing import Self
|
|
42
51
|
|
|
@@ -68,8 +77,15 @@ from sdmxlib.inventory._format import (
|
|
|
68
77
|
from sdmxlib.storage.schema import SCHEMA_VERSION
|
|
69
78
|
|
|
70
79
|
#: A path under the catalog root to its bytes, or None when nothing is there.
|
|
80
|
+
#: A reader calls it from several threads at once, each on a worker thread that
|
|
81
|
+
#: does not inherit the caller's context variables, unless ``leaf_threads`` is 1.
|
|
71
82
|
type Fetch = Callable[[str], bytes | None]
|
|
72
83
|
|
|
84
|
+
#: The threads a reader fetches leaves on unless told otherwise. It comes from an
|
|
85
|
+
#: estimate at an assumed 10 ms a request (spec §6.5), and no real store has
|
|
86
|
+
#: measured it.
|
|
87
|
+
DEFAULT_LEAF_THREADS = 64
|
|
88
|
+
|
|
73
89
|
|
|
74
90
|
def local_fetch(root: str | Path) -> Fetch:
|
|
75
91
|
"""A `Fetch` over a local catalog directory."""
|
|
@@ -118,8 +134,22 @@ class LiveEdition(msgspec.Struct, frozen=True, kw_only=True):
|
|
|
118
134
|
class _Chain:
|
|
119
135
|
"""The read protocol over `fetch`: the newest valid root, never behind the floor."""
|
|
120
136
|
|
|
121
|
-
def __init__(self, fetch: Fetch) -> None:
|
|
137
|
+
def __init__(self, fetch: Fetch, *, leaf_threads: int = DEFAULT_LEAF_THREADS) -> None:
|
|
138
|
+
"""Read through `fetch`.
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
fetch: The reader's only route to the catalog.
|
|
142
|
+
leaf_threads: The threads a read of every product fetches leaves
|
|
143
|
+
on. 1 fetches each in the calling thread.
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
ValueError: If `leaf_threads` is below 1.
|
|
147
|
+
"""
|
|
148
|
+
if leaf_threads < 1:
|
|
149
|
+
msg = f"leaf_threads must be at least 1, got {leaf_threads}"
|
|
150
|
+
raise ValueError(msg)
|
|
122
151
|
self._fetch = fetch
|
|
152
|
+
self._leaf_threads = leaf_threads
|
|
123
153
|
self._root: Root | None = None
|
|
124
154
|
self._leaves: dict[str, Leaf] = {}
|
|
125
155
|
self.skipped: list[str] = []
|
|
@@ -257,7 +287,10 @@ class _Chain:
|
|
|
257
287
|
cached = self._leaves.get(ref.leaf_sha256)
|
|
258
288
|
if cached is not None:
|
|
259
289
|
return cached
|
|
260
|
-
|
|
290
|
+
return self._keep_leaf(ref, self._fetch(ref.leaf))
|
|
291
|
+
|
|
292
|
+
def _keep_leaf(self, ref: LeafRef, raw: bytes | None) -> Leaf:
|
|
293
|
+
"""Check `raw` against `ref`, decode it and hold the leaf by its hash."""
|
|
261
294
|
if raw is None:
|
|
262
295
|
msg = f"{ref.leaf} is missing"
|
|
263
296
|
raise InventoryError(msg)
|
|
@@ -268,9 +301,38 @@ class _Chain:
|
|
|
268
301
|
self._leaves[ref.leaf_sha256] = leaf
|
|
269
302
|
return leaf
|
|
270
303
|
|
|
304
|
+
def _read_leaves(self, refs: Iterable[LeafRef]) -> None:
|
|
305
|
+
"""Fetch the leaves of `refs` not held on a pool, and hold them, in the order of `refs`.
|
|
306
|
+
|
|
307
|
+
Only `fetch` runs on a worker, so ``_leaves`` is written from the
|
|
308
|
+
calling thread alone. Checking in order makes the error the one a
|
|
309
|
+
sequential read raises, and holds the same leaves before it. With fewer
|
|
310
|
+
than two leaves to fetch, or one thread, it does nothing, and `_leaf`
|
|
311
|
+
fetches each in the calling thread.
|
|
312
|
+
"""
|
|
313
|
+
missing = {ref.leaf_sha256: ref for ref in refs if ref.leaf_sha256 not in self._leaves}
|
|
314
|
+
if len(missing) < 2 or self._leaf_threads == 1:
|
|
315
|
+
return
|
|
316
|
+
pool = ThreadPoolExecutor(self._leaf_threads, thread_name_prefix="sdmxlib-inventory-leaf")
|
|
317
|
+
try:
|
|
318
|
+
reads = [(ref, pool.submit(self._fetch, ref.leaf)) for ref in missing.values()]
|
|
319
|
+
for ref, read in reads:
|
|
320
|
+
self._keep_leaf(ref, read.result())
|
|
321
|
+
finally:
|
|
322
|
+
pool.shutdown(cancel_futures=True)
|
|
323
|
+
|
|
324
|
+
def _products_read(self) -> list[tuple[str, LeafRef]]:
|
|
325
|
+
"""The held version's products in sorted order, with their leaves fetched."""
|
|
326
|
+
products = sorted(self._current.products.items())
|
|
327
|
+
self._read_leaves(ref for _, ref in products)
|
|
328
|
+
return products
|
|
329
|
+
|
|
271
330
|
|
|
272
331
|
class FullInventory(_Chain):
|
|
273
|
-
"""Every entry of every product, and the tombstones: for the release job and the operational objects.
|
|
332
|
+
"""Every entry of every product, and the tombstones: for the release job and the operational objects.
|
|
333
|
+
|
|
334
|
+
It takes the same arguments as `LiveInventory`, without ``schema_version``.
|
|
335
|
+
"""
|
|
274
336
|
|
|
275
337
|
@property
|
|
276
338
|
def root(self) -> Root:
|
|
@@ -301,7 +363,7 @@ class FullInventory(_Chain):
|
|
|
301
363
|
|
|
302
364
|
def leaves(self) -> Mapping[str, Leaf]:
|
|
303
365
|
"""Every product's leaf, by product."""
|
|
304
|
-
return {p: self._leaf(ref) for p, ref in
|
|
366
|
+
return {p: self._leaf(ref) for p, ref in self._products_read()}
|
|
305
367
|
|
|
306
368
|
def entries(self, product_id: str) -> tuple[LeafEntry, ...]:
|
|
307
369
|
"""The product's entries in every state."""
|
|
@@ -315,9 +377,21 @@ class LiveInventory(_Chain):
|
|
|
315
377
|
through it needs filtering.
|
|
316
378
|
"""
|
|
317
379
|
|
|
318
|
-
def __init__(
|
|
319
|
-
|
|
320
|
-
|
|
380
|
+
def __init__(
|
|
381
|
+
self, fetch: Fetch, *, schema_version: str = SCHEMA_VERSION, leaf_threads: int = DEFAULT_LEAF_THREADS
|
|
382
|
+
) -> None:
|
|
383
|
+
"""Read through `fetch`, routing to the live editions at `schema_version` (this sdmxlib's by default).
|
|
384
|
+
|
|
385
|
+
Args:
|
|
386
|
+
fetch: The reader's only route to the catalog.
|
|
387
|
+
schema_version: The store schema to route to.
|
|
388
|
+
leaf_threads: The threads a read of every product fetches leaves
|
|
389
|
+
on. 1 fetches each in the calling thread.
|
|
390
|
+
|
|
391
|
+
Raises:
|
|
392
|
+
ValueError: If `leaf_threads` is below 1.
|
|
393
|
+
"""
|
|
394
|
+
super().__init__(fetch, leaf_threads=leaf_threads)
|
|
321
395
|
self.schema_version = schema_version
|
|
322
396
|
|
|
323
397
|
def _live(self, product_id: str, ref: LeafRef) -> LiveEdition | None:
|
|
@@ -339,7 +413,7 @@ class LiveInventory(_Chain):
|
|
|
339
413
|
|
|
340
414
|
def editions(self) -> Mapping[str, LiveEdition]:
|
|
341
415
|
"""Each product's live edition, by product; a product with none is absent."""
|
|
342
|
-
found = {p: self._live(p, ref) for p, ref in
|
|
416
|
+
found = {p: self._live(p, ref) for p, ref in self._products_read()}
|
|
343
417
|
return {p: e for p, e in found.items() if e is not None}
|
|
344
418
|
|
|
345
419
|
def products(self) -> list[str]:
|
|
@@ -61,8 +61,10 @@ of the store that edition ships (`_trim.py`).
|
|
|
61
61
|
- `Manifest`, `read_manifest`, `encode_manifest`, `refuse_engine_mismatch` and
|
|
62
62
|
`storage_version_of` (`_manifest.py`): the msgspec edition manifest and the
|
|
63
63
|
DuckDB storage-version checks. `read_manifest` is `read_manifest_bytes`
|
|
64
|
-
then `decode_manifest`, split so `LocalRegistry.edition` hashes
|
|
65
|
-
it parses
|
|
64
|
+
then `decode_manifest(raw, source)`, split so `LocalRegistry.edition` hashes
|
|
65
|
+
the bytes it parses; `source` is a `str` or `Path` the errors name, and
|
|
66
|
+
`sdmxlib.edition` exports the function for bytes read from object storage.
|
|
67
|
+
The module also defines `ManifestError`,
|
|
66
68
|
`StoreFormatError`, `MANIFEST_NAME`, `FORMAT_VERSION`, `DATA_PATH`,
|
|
67
69
|
`DUCKLAKE_SPEC_VERSION`, `edition_storage_version`,
|
|
68
70
|
`engine_storage_version` and `generate_schema` (the manifest's JSON Schema).
|
|
@@ -468,8 +468,18 @@ def read_manifest_bytes(root: Path) -> bytes:
|
|
|
468
468
|
raise ManifestError(msg) from exc
|
|
469
469
|
|
|
470
470
|
|
|
471
|
-
def decode_manifest(raw: bytes,
|
|
472
|
-
"""The manifest `raw` holds, read from
|
|
471
|
+
def decode_manifest(raw: bytes, source: str | Path) -> Manifest:
|
|
472
|
+
"""The manifest `raw` holds, for bytes read from somewhere other than a local edition directory.
|
|
473
|
+
|
|
474
|
+
`read_manifest` reads a local edition directory. This takes bytes a caller
|
|
475
|
+
already holds, such as those read from object storage.
|
|
476
|
+
|
|
477
|
+
Args:
|
|
478
|
+
raw: The bytes of the manifest.
|
|
479
|
+
source: Where the bytes came from, which the errors name.
|
|
480
|
+
|
|
481
|
+
Returns:
|
|
482
|
+
The manifest.
|
|
473
483
|
|
|
474
484
|
Raises:
|
|
475
485
|
ManifestError: If it is malformed, or its major format version is not
|
|
@@ -478,18 +488,18 @@ def decode_manifest(raw: bytes, path: Path) -> Manifest:
|
|
|
478
488
|
try:
|
|
479
489
|
found = msgspec.json.decode(raw, type=_FormatProbe).format_version
|
|
480
490
|
except msgspec.MsgspecError as exc:
|
|
481
|
-
msg = f"{
|
|
491
|
+
msg = f"{source} is not an edition manifest: {exc}"
|
|
482
492
|
raise ManifestError(msg) from exc
|
|
483
493
|
if found is None:
|
|
484
494
|
# A builder's own manifest from before this format existed. sdmxlib
|
|
485
495
|
# owns the format, so it is refused rather than read around.
|
|
486
496
|
msg = (
|
|
487
|
-
f"{
|
|
497
|
+
f"{source} has no format_version, so it is not an sdmxlib edition manifest (a builder's own "
|
|
488
498
|
f"format?). Seal a new edition with sdmxlib.edition.seal."
|
|
489
499
|
)
|
|
490
500
|
raise ManifestError(msg)
|
|
491
501
|
if found.partition(".")[0] != FORMAT_VERSION.partition(".")[0]:
|
|
492
|
-
msg = f"{
|
|
502
|
+
msg = f"{source} is manifest format {found}; this sdmxlib reads {FORMAT_VERSION.partition('.')[0]}.x"
|
|
493
503
|
if found.partition(".")[0] == "2":
|
|
494
504
|
msg += (
|
|
495
505
|
". Manifest 3.0 renamed the format's identities to the product, the edition and the "
|
|
@@ -499,5 +509,5 @@ def decode_manifest(raw: bytes, path: Path) -> Manifest:
|
|
|
499
509
|
try:
|
|
500
510
|
return msgspec.json.decode(raw, type=Manifest)
|
|
501
511
|
except msgspec.MsgspecError as exc:
|
|
502
|
-
msg = f"{
|
|
512
|
+
msg = f"{source} is not a valid format {found} manifest: {exc}"
|
|
503
513
|
raise ManifestError(msg) from exc
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|