sdmxlib 0.88.0__tar.gz → 0.89.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.88.0 → sdmxlib-0.89.0}/PKG-INFO +1 -1
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/pyproject.toml +1 -1
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/pyproject.toml.orig +1 -1
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/__init__.py +4 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/builders/EGM.md +16 -8
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/builders/contentconstraint.py +71 -6
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/EGM.md +16 -4
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_check.py +89 -23
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_copy.py +2 -1
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_write.py +10 -9
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/EGM.md +6 -4
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +5 -76
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_periods.py +17 -7
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/writer.py +3 -2
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json_1_0/EGM.md +3 -2
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/EGM.md +4 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/data_store.py +109 -11
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/registry.py +17 -5
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/EGM.md +6 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/__init__.py +3 -0
- sdmxlib-0.89.0/src/sdmxlib/model/period.py +139 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/LICENSE +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/README.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/_duckdb.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/_facet_types.xsd +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/_facets.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/_read_errors.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/_singleflight.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/_time.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/_freshness.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/client.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/federated.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/policy.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/providers.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/registry.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/api/session.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/builders/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/data_store.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_availability.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_build.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_canonical.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_fetch.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_finding.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_fingerprint.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_overlay.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/_remote.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/manifest.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/edition/overlay.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_arrow.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_attachment.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_coerce.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_index.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_positions.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_refuse.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/_tags.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/data_format.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/gaps.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/render.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_csv/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml30/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml31/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/_format.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/_reader.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/_routing.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/_rules.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/conformance.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/catalog-2.0.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/catalog.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/current.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/history.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/leaf.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/root-1.2.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/root.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/segment-header.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/inventory/schemas/segment-line.schema.json +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/_scan.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/engine.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/object_store.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/local/sql.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_binding.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_container.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_invariants.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_items.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_label_match.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_rebind.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_referenceable.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_refshape.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_resolvers.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_rules.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/_tree.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/annotations.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/base.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/binding.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/category.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/codelist.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/collections.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/concept.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/constraint.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/convert.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/dataflow.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/datastructure.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/errors.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/expr.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/header.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/hierarchy.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/in_memory_registry.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/istring.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/link.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/mapping.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/message.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/metadata_provision.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/metadataflow.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/metadataset.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/metadatastructure.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/organisation.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/provision.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/ref.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/registry.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/representation.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/rest_api.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/rollup.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/urn.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/validation.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/valuelist.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/version.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/model/version_rewrite.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/polars.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/py.typed +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_closure.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_common.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_compile.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_edges.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_execute.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_expr.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_joins.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_plan.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_pushdown.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_rebase.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/_rest.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/accessors.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/observations.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/query.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/raw.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/query/schema.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/rest.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/session.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/sql.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/EGM.md +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/__init__.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_checked.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_columns.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_files.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_kinds.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_layout.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_manifest.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_parsed.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_projections.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_references.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_synthetic.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_tags.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/_trim.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/lazy.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/readers.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/resolve.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/schema.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/storage/writers.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.0}/src/sdmxlib/testing.py +0 -0
- {sdmxlib-0.88.0 → sdmxlib-0.89.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.89.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
|
|
@@ -176,6 +176,8 @@ from sdmxlib.model import (
|
|
|
176
176
|
SourceValue,
|
|
177
177
|
item,
|
|
178
178
|
normalize_tag,
|
|
179
|
+
period_bounds,
|
|
180
|
+
period_range,
|
|
179
181
|
tag_alias,
|
|
180
182
|
Maintainable,
|
|
181
183
|
MaintainableArtefact,
|
|
@@ -456,6 +458,8 @@ __all__ = [
|
|
|
456
458
|
"normalize_tag",
|
|
457
459
|
"parse",
|
|
458
460
|
"parse_components",
|
|
461
|
+
"period_bounds",
|
|
462
|
+
"period_range",
|
|
459
463
|
"q",
|
|
460
464
|
"read",
|
|
461
465
|
"schema",
|
|
@@ -11,15 +11,16 @@ output.
|
|
|
11
11
|
## Interface
|
|
12
12
|
|
|
13
13
|
- `build_dataflow_constraint(registry, dataflow_urn, *, name, conn=None,
|
|
14
|
-
constraint_id=None, version="1.0"
|
|
15
|
-
`SELECT DISTINCT` for each bound dimension
|
|
16
|
-
CubeRegion `DataConstraint` of type ACTUAL.
|
|
14
|
+
constraint_id=None, version="1.0", time_dimension="range" | "values")`
|
|
15
|
+
(`contentconstraint.py`): runs a `SELECT DISTINCT` for each bound dimension
|
|
16
|
+
and returns one inclusive CubeRegion `DataConstraint` of type ACTUAL.
|
|
17
17
|
- `build_component_availability(registry, dataflow_urn, *, name, key,
|
|
18
|
-
component_id, api, mode="exact" | "available", conn=None,
|
|
19
|
-
(`contentconstraint.py`): the
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
`ComponentValueSet` in the one
|
|
18
|
+
component_id, api, mode="exact" | "available", conn=None, ...,
|
|
19
|
+
time_dimension="range" | "values")` (`contentconstraint.py`): the
|
|
20
|
+
availability of one component for a key, in the given mode.
|
|
21
|
+
`component_id="all"` covers every bound dimension. A dimension comes back
|
|
22
|
+
as a `KeyValue` and an attribute as a `ComponentValueSet` in the one
|
|
23
|
+
CubeRegion.
|
|
23
24
|
- `build_dsd_metadata_map(registry, *, conn=None)` (`metadata_annotation.py`):
|
|
24
25
|
maps each DSD URN to a list of `DsdMetadataLink`. The links combine the
|
|
25
26
|
targets of populated MetadataSets with those declared by Metadataflows and
|
|
@@ -36,6 +37,13 @@ output.
|
|
|
36
37
|
|
|
37
38
|
## Invariants
|
|
38
39
|
|
|
40
|
+
- With `time_dimension="range"`, the default, both builders give the DSD's
|
|
41
|
+
time dimension as a `KeyValue` whose `TimeRange` runs from the earliest
|
|
42
|
+
period's start to the latest period's end, both inclusive and zoneless
|
|
43
|
+
(`sdmxlib.model.period.period_range`). The time dimension keeps its values
|
|
44
|
+
when `"values"` is asked for, when a period does not parse, when it holds
|
|
45
|
+
no periods, and when the registry holds no DSD for the dataflow.
|
|
46
|
+
|
|
39
47
|
- `annotate_structure_message` is idempotent and leaves its input unchanged.
|
|
40
48
|
It builds new DSDs with `attrs.evolve`, keeps existing annotations in order,
|
|
41
49
|
and returns the input message as is when the map is empty or no DSD gains
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
`build_dataflow_constraint` scans the observation table bound to a
|
|
4
4
|
dataflow and emits a `DataConstraint` (the SDMX-3 spelling of the 2.1
|
|
5
5
|
ContentConstraint) whose single inclusive `CubeRegion` lists each
|
|
6
|
-
dimension's distinct lake values
|
|
6
|
+
dimension's distinct lake values, and gives the time dimension as the
|
|
7
|
+
`TimeRange` those values cover. This is the framework-free core of the
|
|
7
8
|
SDMX REST ``/availability`` response for ``context=dataflow``,
|
|
8
9
|
``componentID=all`` — no HTTP layer, no async.
|
|
9
10
|
|
|
@@ -45,6 +46,7 @@ from sdmxlib.model.constraint import (
|
|
|
45
46
|
from sdmxlib.model.dataflow import Dataflow
|
|
46
47
|
from sdmxlib.model.datastructure import DataStructure
|
|
47
48
|
from sdmxlib.model.istring import InternationalString
|
|
49
|
+
from sdmxlib.model.period import period_range
|
|
48
50
|
from sdmxlib.model.ref import Ref
|
|
49
51
|
from sdmxlib.model.rest_api import ApiVersion
|
|
50
52
|
from sdmxlib.model.urn import SdmxUrn
|
|
@@ -59,6 +61,7 @@ def build_dataflow_constraint(
|
|
|
59
61
|
conn: duckdb.DuckDBPyConnection | None = None,
|
|
60
62
|
constraint_id: str | None = None,
|
|
61
63
|
version: str = "1.0",
|
|
64
|
+
time_dimension: Literal["range", "values"] = "range",
|
|
62
65
|
) -> DataConstraint:
|
|
63
66
|
"""Synthesise the dataflow's availability ContentConstraint from the lake.
|
|
64
67
|
|
|
@@ -68,6 +71,15 @@ def build_dataflow_constraint(
|
|
|
68
71
|
`CubeRegion` describing what is *actually* present
|
|
69
72
|
(`ConstraintType.ACTUAL`).
|
|
70
73
|
|
|
74
|
+
The DSD's time dimension is given as a `TimeRange` by default, from the
|
|
75
|
+
earliest period's start to the latest period's end, both inclusive
|
|
76
|
+
(`period_range`): the .Stat Suite Data Explorer reads a time
|
|
77
|
+
dimension's availability only from a range. Gaps between periods are
|
|
78
|
+
not recorded. The time dimension keeps its list of periods when
|
|
79
|
+
``time_dimension="values"``, when any period is one `period_bounds`
|
|
80
|
+
cannot read (a date-time, a ``<start>/<duration>`` interval), when it
|
|
81
|
+
holds no periods, and when the registry holds no DSD for the dataflow.
|
|
82
|
+
|
|
71
83
|
The dimension set and physical column names come from the binding's
|
|
72
84
|
``dimension_column_map`` — the binding is the authoritative record of
|
|
73
85
|
what columns the materialised table actually has, which is exactly the
|
|
@@ -86,17 +98,21 @@ def build_dataflow_constraint(
|
|
|
86
98
|
dataflow id. Override for byte-compatibility with an existing
|
|
87
99
|
consumer's naming scheme.
|
|
88
100
|
version: Version for the emitted constraint. Defaults to ``"1.0"``.
|
|
101
|
+
time_dimension: ``"range"`` gives the time dimension as a
|
|
102
|
+
`TimeRange`; ``"values"`` gives its distinct periods.
|
|
89
103
|
|
|
90
104
|
Returns:
|
|
91
105
|
A `DataConstraint` of type ``ACTUAL`` attached to the dataflow,
|
|
92
106
|
carrying one inclusive `CubeRegion` of per-dimension distinct
|
|
93
|
-
values.
|
|
107
|
+
values, with the time dimension's as a range.
|
|
94
108
|
|
|
95
109
|
Raises:
|
|
96
110
|
KeyError: If no `DataflowBinding` exists for ``dataflow_urn``.
|
|
111
|
+
ValueError: If ``time_dimension`` is neither ``"range"`` nor ``"values"``.
|
|
97
112
|
TypeError: If ``conn`` is omitted and the registry cannot
|
|
98
113
|
not expose a DuckDB ``connection``.
|
|
99
114
|
"""
|
|
115
|
+
_check_time_dimension(time_dimension)
|
|
100
116
|
binding = registry.binding_for(dataflow_urn)
|
|
101
117
|
if binding is None:
|
|
102
118
|
err = (
|
|
@@ -115,12 +131,13 @@ def build_dataflow_constraint(
|
|
|
115
131
|
)
|
|
116
132
|
raise TypeError(err)
|
|
117
133
|
|
|
134
|
+
time_id = _time_dimension_id(registry, dataflow_urn) if time_dimension == "range" else None
|
|
118
135
|
table = located(binding.database_role, binding.table_location)
|
|
119
136
|
key_values: list[KeyValue] = []
|
|
120
137
|
for dim_id in sorted(binding.dimension_column_map):
|
|
121
138
|
column = binding.dimension_column_map[dim_id]
|
|
122
139
|
values = _distinct_values(conn, table, column)
|
|
123
|
-
key_values.append(
|
|
140
|
+
key_values.append(_key_value(dim_id, frozenset(values), time_id))
|
|
124
141
|
|
|
125
142
|
region = CubeRegion(include=True, keys=tuple(key_values))
|
|
126
143
|
attachment = ConstraintAttachment(dataflows=(Ref[Dataflow].unresolved(dataflow_urn),))
|
|
@@ -147,6 +164,7 @@ def build_component_availability(
|
|
|
147
164
|
conn: duckdb.DuckDBPyConnection | None = None,
|
|
148
165
|
constraint_id: str | None = None,
|
|
149
166
|
version: str = "1.0",
|
|
167
|
+
time_dimension: Literal["range", "values"] = "range",
|
|
150
168
|
) -> DataConstraint:
|
|
151
169
|
"""Synthesise the per-component availability slice for ``(key, component_id, mode)``.
|
|
152
170
|
|
|
@@ -188,6 +206,12 @@ def build_component_availability(
|
|
|
188
206
|
``C``'s own constraint **dropped**, i.e. the values that would still
|
|
189
207
|
leave the cube non-empty if added to the key.
|
|
190
208
|
|
|
209
|
+
The DSD's time dimension is given as a `TimeRange` by default, as in
|
|
210
|
+
`build_dataflow_constraint`, and under the same rules: it keeps its list
|
|
211
|
+
of periods when ``time_dimension="values"``, when any period is one
|
|
212
|
+
`period_bounds` cannot read, when it holds no periods, and when the
|
|
213
|
+
registry holds no DSD for the dataflow.
|
|
214
|
+
|
|
191
215
|
Args:
|
|
192
216
|
registry: An open registry: a published `EditionRegistry` or a `LocalRegistry`.
|
|
193
217
|
dataflow_urn: URN of the dataflow to describe.
|
|
@@ -211,6 +235,8 @@ def build_component_availability(
|
|
|
211
235
|
constraint_id: Id for the emitted constraint. Defaults to the
|
|
212
236
|
dataflow id.
|
|
213
237
|
version: Version for the emitted constraint. Defaults to ``"1.0"``.
|
|
238
|
+
time_dimension: ``"range"`` gives the time dimension as a
|
|
239
|
+
`TimeRange`; ``"values"`` gives its distinct periods.
|
|
214
240
|
|
|
215
241
|
Returns:
|
|
216
242
|
A `DataConstraint` of type ``ACTUAL`` attached to the dataflow,
|
|
@@ -221,14 +247,16 @@ def build_component_availability(
|
|
|
221
247
|
Raises:
|
|
222
248
|
KeyError: If no `DataflowBinding` exists, or ``component_id`` (when
|
|
223
249
|
not ``"all"``) is not a column on the bound table.
|
|
224
|
-
ValueError: If ``mode`` is unrecognised, or the
|
|
225
|
-
segment count that does not match the DSD's
|
|
250
|
+
ValueError: If ``mode`` or ``time_dimension`` is unrecognised, or the
|
|
251
|
+
dotted ``key`` has a segment count that does not match the DSD's
|
|
252
|
+
key dimensions.
|
|
226
253
|
TypeError: If ``conn`` is omitted and the registry cannot
|
|
227
254
|
not expose a DuckDB ``connection``.
|
|
228
255
|
"""
|
|
229
256
|
if mode not in ("exact", "available"):
|
|
230
257
|
err = f"Unrecognised mode {mode!r}; expected 'exact' or 'available'."
|
|
231
258
|
raise ValueError(err)
|
|
259
|
+
_check_time_dimension(time_dimension)
|
|
232
260
|
|
|
233
261
|
binding = registry.binding_for(dataflow_urn)
|
|
234
262
|
if binding is None:
|
|
@@ -261,6 +289,7 @@ def build_component_availability(
|
|
|
261
289
|
held = _held_values(registry, dataflow_urn)
|
|
262
290
|
component_filter = _drop_covering(component_filter, held)
|
|
263
291
|
|
|
292
|
+
time_id = _time_dimension_id(registry, dataflow_urn) if time_dimension == "range" else None
|
|
264
293
|
table = located(binding.database_role, binding.table_location)
|
|
265
294
|
key_values: list[KeyValue] = []
|
|
266
295
|
components: list[ComponentValueSet] = []
|
|
@@ -279,7 +308,7 @@ def build_component_availability(
|
|
|
279
308
|
# value sets (2.1 `Attribute`, 3.x `Component`). Both were keys until
|
|
280
309
|
# #433 gave components a field, so an attribute read as a dimension.
|
|
281
310
|
if target in binding.dimension_column_map:
|
|
282
|
-
key_values.append(
|
|
311
|
+
key_values.append(_key_value(target, values, time_id))
|
|
283
312
|
else:
|
|
284
313
|
components.append(ComponentValueSet(component_id=target, values=values))
|
|
285
314
|
|
|
@@ -316,6 +345,42 @@ def _resolve_key_slot_ids(registry: EditionRegistry, dataflow_urn: SdmxUrn[Dataf
|
|
|
316
345
|
return dsd.key_slot_ids(api)
|
|
317
346
|
|
|
318
347
|
|
|
348
|
+
def _check_time_dimension(time_dimension: str) -> None:
|
|
349
|
+
"""Refuse a ``time_dimension`` other than ``"range"`` or ``"values"``.
|
|
350
|
+
|
|
351
|
+
Raises:
|
|
352
|
+
ValueError: If ``time_dimension`` is unrecognised.
|
|
353
|
+
"""
|
|
354
|
+
if time_dimension not in ("range", "values"):
|
|
355
|
+
err = f"Unrecognised time_dimension {time_dimension!r}; expected 'range' or 'values'."
|
|
356
|
+
raise ValueError(err)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
def _time_dimension_id(registry: EditionRegistry, dataflow_urn: SdmxUrn[Dataflow]) -> str | None:
|
|
360
|
+
"""The id of the dataflow's DSD's time dimension; None without a DSD in the registry or a time dimension in it."""
|
|
361
|
+
flow = registry.get(dataflow_urn)
|
|
362
|
+
structure = flow.structure if isinstance(flow, Dataflow) else None
|
|
363
|
+
if not isinstance(structure, Ref):
|
|
364
|
+
return None
|
|
365
|
+
dsd = registry.get(structure.urn)
|
|
366
|
+
if not isinstance(dsd, DataStructure) or dsd.time_dimension is None:
|
|
367
|
+
return None
|
|
368
|
+
return dsd.time_dimension.id
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
def _key_value(dimension_id: str, values: frozenset[str], time_id: str | None) -> KeyValue:
|
|
372
|
+
"""One dimension's `KeyValue`: the `TimeRange` its periods cover for the time dimension, else its values.
|
|
373
|
+
|
|
374
|
+
The time dimension keeps its values when `period_range` gives no range:
|
|
375
|
+
it holds no periods, or a period whose bounds cannot be read.
|
|
376
|
+
"""
|
|
377
|
+
if dimension_id == time_id:
|
|
378
|
+
time_range = period_range(values)
|
|
379
|
+
if time_range is not None:
|
|
380
|
+
return KeyValue(dimension_id=dimension_id, time_range=time_range)
|
|
381
|
+
return KeyValue(dimension_id=dimension_id, values=values)
|
|
382
|
+
|
|
383
|
+
|
|
319
384
|
def _component_column(binding: DataflowBinding, component_id: str) -> str:
|
|
320
385
|
"""Physical column for ``component_id`` — dimension first, then attribute."""
|
|
321
386
|
column = binding.dimension_column_map.get(component_id) or binding.attribute_column_map.get(component_id)
|
|
@@ -26,15 +26,19 @@ seals through `seal(extensions=...)`.
|
|
|
26
26
|
inventory, the data files DuckLake references, and each file's placement
|
|
27
27
|
tier (by longest prefix match).
|
|
28
28
|
- `settle_lake` (`_write.py`): flushes inlined data and rewrites delete files.
|
|
29
|
-
For a final edition it also merges adjacent files
|
|
30
|
-
expires snapshots.
|
|
29
|
+
For a final edition it also merges adjacent files smaller than the lake's
|
|
30
|
+
`target_file_size`, and on request it expires snapshots.
|
|
31
31
|
- `check_edition` (`_check.py`): checks an edition against its manifest under the
|
|
32
32
|
profile `at="publish"`, `"receive"` or `"open"` and returns a `Report`.
|
|
33
33
|
`Report.ok` says whether it passed. `Check` is the type an extension check
|
|
34
34
|
implements, and `Profile` is the profile literal. Findings are `Finding`s
|
|
35
35
|
(`_finding.py`). An argument the profile does not use (`structures=` at
|
|
36
36
|
`open`, `remote=` at `publish`, `lookup=` outside `receive`,
|
|
37
|
-
`fingerprints=True` at `open`) raises `ValueError`. `
|
|
37
|
+
`fingerprints=True` at `open`) raises `ValueError`. `tiers=` names the
|
|
38
|
+
placement tiers held on local disk, at every profile: the `files` check
|
|
39
|
+
reports a missing file only when its tier is in `tiers`, and checks a
|
|
40
|
+
present file whatever its tier (GH-384). The `remote`, `lake` and
|
|
41
|
+
`bindings` checks ignore `tiers`, and an extension check is not told it. `fingerprints=None`
|
|
38
42
|
(the default) recomputes the fingerprints at `publish` only;
|
|
39
43
|
`fingerprints=True` adds them at `receive`, and `fingerprints=False` skips
|
|
40
44
|
them at `publish`, for the process that sealed the edition, right after
|
|
@@ -53,7 +57,8 @@ seals through `seal(extensions=...)`.
|
|
|
53
57
|
for this `(product_id, edition id, manifest sha256)` it runs `receive` and writes
|
|
54
58
|
the stamp when the report is clean; with one it runs `open`. An unreadable
|
|
55
59
|
manifest, or a `product_id` that cannot name a stamp path, gets a `receive`
|
|
56
|
-
check and no stamp. `references=False` goes to its `receive` calls only
|
|
60
|
+
check and no stamp. `references=False` goes to its `receive` calls only,
|
|
61
|
+
and `tiers=` to both profiles.
|
|
57
62
|
- `copy_edition` and `edition_files` (`_copy.py`): copy the files of the chosen
|
|
58
63
|
tiers and verify each one, and list the paths such a copy needs.
|
|
59
64
|
- `verify_remote`, `RemoteFile`, `content_md5` and `content_crc32c`
|
|
@@ -142,6 +147,13 @@ seals through `seal(extensions=...)`.
|
|
|
142
147
|
`references`. A `references=False` call accepts either stamp. A full call
|
|
143
148
|
that meets a deferred stamp runs `receive`, and replaces the stamp when that
|
|
144
149
|
finds nothing.
|
|
150
|
+
- A stamp records the tiers its check covered, as `tiers`, and satisfies a
|
|
151
|
+
call only when it records every tier in the call's `tiers` (GH-384). A
|
|
152
|
+
stamp without `tiers`, as releases through 0.88 wrote, records every tier. A
|
|
153
|
+
clean `receive` writes the call's tiers and the tiers of the same-manifest
|
|
154
|
+
stamp it replaces; its `checked` is the new report's alone, so a
|
|
155
|
+
`references=False` call that needs more tiers than a full stamp records
|
|
156
|
+
leaves a deferred stamp.
|
|
145
157
|
- `settle_lake` never deletes files from `data/`.
|
|
146
158
|
- `check_edition`'s `tags` check, at `publish` and `receive`, reports every
|
|
147
159
|
stored language tag `normalize_tag` would change or refuse: a store built
|
|
@@ -9,11 +9,15 @@ read them where the registry does (GH-180). ``open`` runs each time a server ope
|
|
|
9
9
|
only. `check_on_open` runs ``receive`` once per edition id and manifest, records
|
|
10
10
|
a stamp, and runs ``open`` after that. Each check names what it found rather
|
|
11
11
|
than stopping at the first, so one run lists everything wrong.
|
|
12
|
+
|
|
13
|
+
A server that holds part of an edition names the placement tiers it holds in
|
|
14
|
+
``tiers=``, and the ``files`` check then accepts the absence of a file of any
|
|
15
|
+
other tier (GH-384). A stamp records the tiers its ``receive`` check covered.
|
|
12
16
|
"""
|
|
13
17
|
|
|
14
18
|
import hashlib
|
|
15
19
|
import json
|
|
16
|
-
from collections.abc import Callable, Iterable, Mapping, Sequence
|
|
20
|
+
from collections.abc import Callable, Collection, Iterable, Mapping, Sequence
|
|
17
21
|
from contextlib import ExitStack
|
|
18
22
|
from datetime import UTC, datetime
|
|
19
23
|
from functools import partial
|
|
@@ -42,6 +46,7 @@ from sdmxlib.storage._manifest import (
|
|
|
42
46
|
Manifest,
|
|
43
47
|
ManifestError,
|
|
44
48
|
StoreFormatError,
|
|
49
|
+
Tier,
|
|
45
50
|
read_manifest,
|
|
46
51
|
unlisted,
|
|
47
52
|
)
|
|
@@ -60,6 +65,9 @@ type Check = Callable[[Path, Manifest, EditionRegistry, Profile], Iterable[Findi
|
|
|
60
65
|
#: A blob store's report of one file, as `verify_remote` takes it.
|
|
61
66
|
type Lookup = Callable[[EditionFile], RemoteFile | None]
|
|
62
67
|
|
|
68
|
+
#: Every placement tier, in the order a stamp lists them.
|
|
69
|
+
_TIERS: tuple[Tier, ...] = ("required", "lazy", "remote")
|
|
70
|
+
|
|
63
71
|
|
|
64
72
|
@frozen
|
|
65
73
|
class Report:
|
|
@@ -95,6 +103,7 @@ def check_edition(
|
|
|
95
103
|
expect: Manifest | str | Path | None = None,
|
|
96
104
|
structures: str | Path | Sequence[str | Path] | None = None,
|
|
97
105
|
references: bool = True,
|
|
106
|
+
tiers: Collection[Tier] = ("required", "lazy", "remote"),
|
|
98
107
|
extensions: Mapping[str, Check] | None = None,
|
|
99
108
|
) -> Report:
|
|
100
109
|
"""Check a sealed edition against its manifest and against itself, as profile `at` asks.
|
|
@@ -124,6 +133,18 @@ def check_edition(
|
|
|
124
133
|
through `engine`, and without a `lookup` the ``remote`` check sizes each
|
|
125
134
|
listed one there.
|
|
126
135
|
|
|
136
|
+
`tiers` names the placement tiers the caller holds on local disk, as
|
|
137
|
+
`copy_edition` and `edition_files` take it. The ``files`` check reports a
|
|
138
|
+
missing file only when its tier is in `tiers`. A file that is present is
|
|
139
|
+
checked as the profile asks whatever its tier, and an unlisted file is
|
|
140
|
+
reported as before. `tiers` and `remote` are independent. `remote` and
|
|
141
|
+
`lookup` say where the data files are read and checked, and with either
|
|
142
|
+
the ``files`` check skips ``data/`` whatever `tiers` holds. The
|
|
143
|
+
``remote``, ``lake`` and ``bindings`` checks cover every data file
|
|
144
|
+
whatever `tiers` holds, since they read the data where the registry reads
|
|
145
|
+
it. A server that pulled the required tier and reads its data from object
|
|
146
|
+
storage passes ``remote=`` and ``tiers=("required",)``.
|
|
147
|
+
|
|
127
148
|
A manifest that cannot be read, or a store on another schema version or in
|
|
128
149
|
a DuckDB or DuckLake format this engine cannot read, ends the run there:
|
|
129
150
|
nothing after it can be checked against either.
|
|
@@ -179,8 +200,13 @@ def check_edition(
|
|
|
179
200
|
them. `structures` then still runs the ``partials`` check. An
|
|
180
201
|
edition with bindings is allowed, and its references go unchecked
|
|
181
202
|
too.
|
|
203
|
+
tiers: The placement tiers held on local disk. A manifest entry of
|
|
204
|
+
another tier is not reported when its file is missing. The
|
|
205
|
+
default holds every tier, so every missing file is a finding.
|
|
182
206
|
extensions: More checks, by name, for parts of the edition other
|
|
183
|
-
packages own (statcatlib's search index, say).
|
|
207
|
+
packages own (statcatlib's search index, say). An extension
|
|
208
|
+
check is not told `tiers`: pass an extension that reads the files
|
|
209
|
+
of a tier only in a call whose `tiers` holds that tier.
|
|
184
210
|
|
|
185
211
|
Returns:
|
|
186
212
|
What was checked and what was found.
|
|
@@ -200,7 +226,7 @@ def check_edition(
|
|
|
200
226
|
manifest = read_manifest(root)
|
|
201
227
|
except ManifestError as exc:
|
|
202
228
|
return Report(root, at, tuple(checked), (Finding("manifest", MANIFEST_NAME, str(exc)),))
|
|
203
|
-
findings = list(_files(root, manifest, at, remote=lookup is not None or remote is not None))
|
|
229
|
+
findings = list(_files(root, manifest, at, remote=lookup is not None or remote is not None, tiers=tiers))
|
|
204
230
|
checked.append("files")
|
|
205
231
|
if expect is not None:
|
|
206
232
|
try:
|
|
@@ -329,6 +355,7 @@ def check_on_open(
|
|
|
329
355
|
engine: EditionEngine | None = None,
|
|
330
356
|
lookup: Lookup | None = None,
|
|
331
357
|
references: bool = True,
|
|
358
|
+
tiers: Collection[Tier] = ("required", "lazy", "remote"),
|
|
332
359
|
extensions: Mapping[str, Check] | None = None,
|
|
333
360
|
) -> Report:
|
|
334
361
|
"""Check an edition as a server opens it: ``receive`` once per edition id and manifest, ``open`` after.
|
|
@@ -345,6 +372,21 @@ def check_on_open(
|
|
|
345
372
|
replaces the stamp when that finds nothing. A stamp that a deferring call
|
|
346
373
|
wrote stays in place when that ``receive`` finds something.
|
|
347
374
|
|
|
375
|
+
A stamp also records the tiers its check covered, and satisfies a call
|
|
376
|
+
only when it records every tier in the call's `tiers`. A server pulls the
|
|
377
|
+
required tier, calls with ``tiers=("required",)`` and reports ready. Once
|
|
378
|
+
it has pulled the lazy tier it calls with ``tiers=("required", "lazy")``:
|
|
379
|
+
the stamp records the required tier alone, so ``receive`` runs again and
|
|
380
|
+
hashes the files pulled since. A clean ``receive`` writes a stamp
|
|
381
|
+
recording the call's tiers and the tiers of the stamp it replaces, when
|
|
382
|
+
that stamp is for the same manifest. A ``receive`` check hashes every
|
|
383
|
+
listed edition file that is present, so the earlier tiers stay verified,
|
|
384
|
+
and the ``open`` profile reports a file that has gone missing since. A
|
|
385
|
+
stamp without recorded tiers, as releases through 0.88 wrote, records every
|
|
386
|
+
tier. Those releases ignore the recorded tiers, so they read a stamp for
|
|
387
|
+
the required tier as a stamp for the whole edition: clear the stamps
|
|
388
|
+
directory when moving a server back to one.
|
|
389
|
+
|
|
348
390
|
Args:
|
|
349
391
|
path: The edition directory.
|
|
350
392
|
stamps: The directory holding the stamps, outside every edition: local
|
|
@@ -354,6 +396,7 @@ def check_on_open(
|
|
|
354
396
|
lookup: As `check_edition`'s, for the receive check.
|
|
355
397
|
references: As `check_edition`'s, for the receive check. The ``open``
|
|
356
398
|
profile never runs that check.
|
|
399
|
+
tiers: As `check_edition`'s, for either profile.
|
|
357
400
|
extensions: As `check_edition`'s, for either profile.
|
|
358
401
|
|
|
359
402
|
Returns:
|
|
@@ -368,6 +411,7 @@ def check_on_open(
|
|
|
368
411
|
engine=engine,
|
|
369
412
|
lookup=lookup,
|
|
370
413
|
references=references,
|
|
414
|
+
tiers=tiers,
|
|
371
415
|
extensions=extensions,
|
|
372
416
|
)
|
|
373
417
|
try:
|
|
@@ -380,11 +424,13 @@ def check_on_open(
|
|
|
380
424
|
report = receive()
|
|
381
425
|
detail = f"product_id {manifest.product_id!r} cannot name a stamp directory, so the check is not stamped"
|
|
382
426
|
return attrs.evolve(report, findings=(*report.findings, Finding("manifest", MANIFEST_NAME, detail)))
|
|
383
|
-
|
|
384
|
-
|
|
427
|
+
recorded = _recorded(stamp, digest)
|
|
428
|
+
held = _stamped_tiers(recorded)
|
|
429
|
+
if recorded is not None and held.issuperset(tiers) and (not references or _lists_references(recorded)):
|
|
430
|
+
return check_edition(root, at="open", remote=remote, engine=engine, tiers=tiers, extensions=extensions)
|
|
385
431
|
report = receive()
|
|
386
432
|
if report.ok:
|
|
387
|
-
_write_stamp(stamp, digest, report)
|
|
433
|
+
_write_stamp(stamp, digest, report, held.union(tiers))
|
|
388
434
|
return report
|
|
389
435
|
|
|
390
436
|
|
|
@@ -397,35 +443,49 @@ def _names_a_file_under(stamp: Path, stamps: Path) -> bool:
|
|
|
397
443
|
return len(parts) == 2 and all(part not in {".", ".."} for part in parts)
|
|
398
444
|
|
|
399
445
|
|
|
400
|
-
def
|
|
401
|
-
"""
|
|
402
|
-
|
|
403
|
-
When `references` is true, the recorded check must also list ``references``.
|
|
404
|
-
"""
|
|
446
|
+
def _recorded(stamp: Path, digest: str) -> dict[str, object] | None:
|
|
447
|
+
"""The record `stamp` holds, when it is of a clean receive check of the manifest with sha256 `digest`."""
|
|
405
448
|
try:
|
|
406
449
|
recorded = json.loads(stamp.read_text())
|
|
407
450
|
except OSError, ValueError:
|
|
408
|
-
return
|
|
451
|
+
return None
|
|
409
452
|
if not isinstance(recorded, dict) or recorded.get("manifest_sha256") != digest:
|
|
410
|
-
return
|
|
411
|
-
|
|
412
|
-
|
|
453
|
+
return None
|
|
454
|
+
return {str(key): value for key, value in recorded.items()}
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
def _lists_references(recorded: Mapping[str, object]) -> bool:
|
|
458
|
+
"""Whether the stamp's recorded checks list ``references``."""
|
|
413
459
|
checked = recorded.get("checked")
|
|
414
460
|
return isinstance(checked, list) and "references" in checked
|
|
415
461
|
|
|
416
462
|
|
|
417
|
-
def
|
|
418
|
-
"""
|
|
463
|
+
def _stamped_tiers(recorded: Mapping[str, object] | None) -> frozenset[str]:
|
|
464
|
+
"""The tiers a stamp's check covered: every tier for a stamp that records none, as releases through 0.88 wrote."""
|
|
465
|
+
if recorded is None:
|
|
466
|
+
return frozenset()
|
|
467
|
+
if "tiers" not in recorded:
|
|
468
|
+
return frozenset(_TIERS)
|
|
469
|
+
tiers = recorded["tiers"]
|
|
470
|
+
if not isinstance(tiers, list):
|
|
471
|
+
return frozenset()
|
|
472
|
+
return frozenset(tier for tier in tiers if isinstance(tier, str))
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
def _write_stamp(stamp: Path, digest: str, report: Report, tiers: Collection[str]) -> None:
|
|
476
|
+
"""Record `report` and the `tiers` it covers under `stamp`, whole or not at all, replacing any stamp there."""
|
|
419
477
|
record = {
|
|
420
478
|
"manifest_sha256": digest,
|
|
421
479
|
"at": report.at,
|
|
422
480
|
"checked": list(report.checked),
|
|
481
|
+
"tiers": [tier for tier in _TIERS if tier in tiers],
|
|
423
482
|
"verified_at": datetime.now(UTC).isoformat(),
|
|
424
483
|
}
|
|
425
484
|
replace_durably(stamp, json.dumps(record, indent=2).encode())
|
|
426
485
|
|
|
427
486
|
|
|
428
|
-
def _files(root: Path, manifest: Manifest, at: Profile, *, remote: bool) -> Iterable[Finding]:
|
|
487
|
+
def _files(root: Path, manifest: Manifest, at: Profile, *, remote: bool, tiers: Collection[Tier]) -> Iterable[Finding]:
|
|
488
|
+
"""What the ``files`` check finds; a missing file is reported only when its tier is in `tiers`."""
|
|
429
489
|
on_disk = {
|
|
430
490
|
p.relative_to(root).as_posix(): p
|
|
431
491
|
for p in sorted(root.rglob("*"))
|
|
@@ -443,12 +503,10 @@ def _files(root: Path, manifest: Manifest, at: Profile, *, remote: bool) -> Iter
|
|
|
443
503
|
subject = entry.path
|
|
444
504
|
found = on_disk.pop(entry.path, None)
|
|
445
505
|
hashed = at != "open"
|
|
446
|
-
if found is None:
|
|
506
|
+
if found is not None:
|
|
507
|
+
yield from _listed_file(entry, subject, found, hashed=hashed)
|
|
508
|
+
elif entry.tier in tiers:
|
|
447
509
|
yield Finding("files", subject, "listed in the manifest but missing")
|
|
448
|
-
elif (size := found.stat().st_size) != entry.size:
|
|
449
|
-
yield Finding("files", subject, f"{size} bytes, the manifest says {entry.size}")
|
|
450
|
-
elif hashed and (differs := differing(entry, digests_of(found))):
|
|
451
|
-
yield Finding("files", subject, f"contents differ from the manifest's {', '.join(differs)}")
|
|
452
510
|
if at == "open":
|
|
453
511
|
return
|
|
454
512
|
for extra in on_disk:
|
|
@@ -460,6 +518,14 @@ def _files(root: Path, manifest: Manifest, at: Profile, *, remote: bool) -> Iter
|
|
|
460
518
|
yield Finding("files", extra, "in the edition but not in the manifest")
|
|
461
519
|
|
|
462
520
|
|
|
521
|
+
def _listed_file(entry: EditionFile, subject: str, found: Path, *, hashed: bool) -> Iterable[Finding]:
|
|
522
|
+
"""How the file `found` differs from its manifest `entry`: by size, or when `hashed`, by digest."""
|
|
523
|
+
if (size := found.stat().st_size) != entry.size:
|
|
524
|
+
yield Finding("files", subject, f"{size} bytes, the manifest says {entry.size}")
|
|
525
|
+
elif hashed and (differs := differing(entry, digests_of(found))):
|
|
526
|
+
yield Finding("files", subject, f"contents differ from the manifest's {', '.join(differs)}")
|
|
527
|
+
|
|
528
|
+
|
|
463
529
|
def _fingerprints(root: Path, manifest: Manifest, opened: EditionRegistry) -> list[Finding]:
|
|
464
530
|
"""The fingerprints recomputed, against the manifest's.
|
|
465
531
|
|
|
@@ -50,7 +50,8 @@ def copy_edition(
|
|
|
50
50
|
`tiers` limits the copy to the files of those placement tiers: a server
|
|
51
51
|
pulls tiers 1 and 2 and reads tier 3 remotely, so ``tiers=("required", "lazy")`` is what
|
|
52
52
|
it holds. A copy without every tier is incomplete by intent, and
|
|
53
|
-
`check_edition` reports the files it left out
|
|
53
|
+
`check_edition` reports the files it left out unless it is given the same
|
|
54
|
+
`tiers`.
|
|
54
55
|
|
|
55
56
|
Args:
|
|
56
57
|
source: A sealed edition directory.
|
|
@@ -309,10 +309,6 @@ def artefact_entries(
|
|
|
309
309
|
return tuple(entries)
|
|
310
310
|
|
|
311
311
|
|
|
312
|
-
#: Larger than any data file, so a merge leaves one file per table.
|
|
313
|
-
_ONE_FILE = 1 << 62
|
|
314
|
-
|
|
315
|
-
|
|
316
312
|
def settle_lake(
|
|
317
313
|
conn: duckdb.DuckDBPyConnection,
|
|
318
314
|
*,
|
|
@@ -326,10 +322,15 @@ def settle_lake(
|
|
|
326
322
|
(``delete_threshold => 0``: DuckLake's default skips a table whose
|
|
327
323
|
deleted rows are few, which is exactly a daily delta), so no delete file
|
|
328
324
|
ships and every edition reads its rows from data files alone.
|
|
329
|
-
- A ``final`` edition's tables have their files merged:
|
|
330
|
-
be appended.
|
|
331
|
-
|
|
332
|
-
|
|
325
|
+
- A ``final`` edition's tables have their adjacent small files merged:
|
|
326
|
+
nothing will be appended. The lake's ``target_file_size`` (DuckLake's
|
|
327
|
+
default is 512 MB) decides which files merge: adjacent files smaller
|
|
328
|
+
than it are merged together, and a file DuckLake wrote at that size
|
|
329
|
+
stays as written. A table under the target size ends in one file, or one per
|
|
330
|
+
partition; a larger table keeps about one file per target size (design
|
|
331
|
+
§4.5 says why). DuckLake sorts what it merges by a table's
|
|
332
|
+
``SORTED BY``, which the producer sets (`write_observations`'
|
|
333
|
+
``sorted_by``); this sets no sort of its own.
|
|
333
334
|
- With `expire_snapshots`, every snapshot but the current one is expired,
|
|
334
335
|
so the catalog and the manifest hold only current files.
|
|
335
336
|
|
|
@@ -345,7 +346,7 @@ def settle_lake(
|
|
|
345
346
|
conn.execute("CALL ducklake_flush_inlined_data('lake')")
|
|
346
347
|
conn.execute("CALL ducklake_rewrite_data_files('lake', delete_threshold => 0)")
|
|
347
348
|
if lifecycle == "final":
|
|
348
|
-
conn.execute("CALL ducklake_merge_adjacent_files('lake'
|
|
349
|
+
conn.execute("CALL ducklake_merge_adjacent_files('lake')")
|
|
349
350
|
if expire_snapshots:
|
|
350
351
|
conn.execute("CALL ducklake_expire_snapshots('lake', older_than => now())")
|
|
351
352
|
|
|
@@ -56,8 +56,10 @@ serialisers in `structure_values.py`.
|
|
|
56
56
|
`serialize_concepts` (`structure_values.py`): the public `__all__`; each
|
|
57
57
|
returns TypedDicts.
|
|
58
58
|
- `resolve_urn` and `resolve_any_urn` (`_resolve.py`), and `zoneless_periods`
|
|
59
|
-
(`_periods.py`): resolve URNs to Refs, and find
|
|
60
|
-
no time zone.
|
|
59
|
+
(`_periods.py`): resolve URNs to Refs, and find a constraint's validity
|
|
60
|
+
date-times that have no time zone. A time range's start and end are exempt:
|
|
61
|
+
the writers write them zoneless, as NSI does, for the .Stat Data Explorer
|
|
62
|
+
(GH-392).
|
|
61
63
|
|
|
62
64
|
## Invariants
|
|
63
65
|
|
|
@@ -78,8 +80,8 @@ serialisers in `structure_values.py`.
|
|
|
78
80
|
its own, and an entry its struct cannot decode is refused alone.
|
|
79
81
|
- `write` passes the message through `without_dropped(msg, "json")`.
|
|
80
82
|
`_refuse_unwritable` then raises `ValidationError` for a version that fails
|
|
81
|
-
`check_writable(..., "json")`, or for a constraint with a
|
|
82
|
-
that has no zone. Both checks finish before any encoding.
|
|
83
|
+
`check_writable(..., "json")`, or for a constraint with a validity
|
|
84
|
+
date-time that has no zone. Both checks finish before any encoding.
|
|
83
85
|
- Pretty printing uses `msgspec.json.format(indent=2)`.
|
|
84
86
|
- A singular `name` (or `description`, `text`) with no map states no
|
|
85
87
|
language. It is read in the language `meta.contentLanguages` declares when
|