sdmxlib 0.83.0__tar.gz → 0.84.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.83.0 → sdmxlib-0.84.0}/PKG-INFO +1 -1
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/pyproject.toml +1 -1
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/pyproject.toml.orig +1 -1
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/EGM.md +3 -1
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/_duckdb.py +22 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/builders/contentconstraint.py +3 -2
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/EGM.md +8 -4
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_availability.py +3 -2
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_build.py +2 -1
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_check.py +25 -16
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_write.py +10 -9
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/EGM.md +8 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/data_store.py +18 -13
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/sql.py +25 -13
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/observations.py +2 -1
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_synthetic.py +2 -2
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/LICENSE +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/README.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/_facet_types.xsd +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/_facets.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/_read_errors.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/_singleflight.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/_time.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/_freshness.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/client.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/federated.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/policy.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/providers.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/registry.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/api/session.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/builders/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/builders/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/builders/metadata_annotation.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/data_store.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_canonical.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_copy.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_fetch.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_finding.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_fingerprint.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_overlay.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/_remote.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/manifest.schema.json +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/edition/overlay.schema.json +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_arrow.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_attachment.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_coerce.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_index.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_positions.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_refuse.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/_tags.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/data_format.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/gaps.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/render.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_csv/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_csv/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_csv/reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_csv/writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_data_common.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_dto.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_header.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_losses.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_periods.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_resolve.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_structure_dto.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/_structure_ingest.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/data.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/data_v1.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/data_v2.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/metadata.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/structure_values.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json/writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json_1_0/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json_1_0/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_json_1_0/writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_allowed_children.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_closed_world.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_common.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_header.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_losses.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_v3_reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml/_v3_writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/_providers.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/_synthetic.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/namespaces.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml21/writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml30/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml30/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml30/metadata.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml30/namespaces.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml30/reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml30/writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml31/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml31/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml31/namespaces.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml31/reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/formats/sdmx_ml31/writer.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/_format.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/_reader.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/_rules.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/conformance.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/schemas/catalog.schema.json +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/schemas/current.schema.json +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/schemas/leaf.schema.json +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/inventory/schemas/root.schema.json +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/_scan.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/engine.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/object_store.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/local/registry.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_binding.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_container.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_invariants.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_items.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_label_match.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_rebind.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_referenceable.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_refshape.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_resolvers.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_rules.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/_tree.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/annotations.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/base.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/binding.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/category.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/codelist.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/collections.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/concept.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/constraint.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/convert.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/dataflow.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/datastructure.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/errors.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/expr.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/header.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/hierarchy.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/in_memory_registry.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/istring.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/link.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/mapping.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/message.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/metadata_provision.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/metadataflow.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/metadataset.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/metadatastructure.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/organisation.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/provision.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/ref.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/registry.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/representation.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/rest_api.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/rollup.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/urn.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/validation.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/valuelist.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/version.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/model/version_rewrite.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/polars.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/py.typed +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_closure.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_common.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_compile.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_edges.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_execute.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_expr.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_joins.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_plan.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_pushdown.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_rebase.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/_rest.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/accessors.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/query.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/raw.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/query/schema.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/rest.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/session.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/sql.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/EGM.md +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/__init__.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_checked.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_columns.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_files.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_kinds.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_layout.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_manifest.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_parsed.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_projections.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_references.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_tags.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/_trim.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/lazy.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/readers.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/resolve.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/schema.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/storage/writers.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.0}/src/sdmxlib/testing.py +0 -0
- {sdmxlib-0.83.0 → sdmxlib-0.84.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.84.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
|
|
@@ -61,7 +61,9 @@ the subpackages share.
|
|
|
61
61
|
REST ingest); `csv_errors` and `converting` convert at a query terminal and
|
|
62
62
|
in a drained stream, and only errors DuckDB's CSV reader raised.
|
|
63
63
|
- `first` and `count` (`_duckdb.py`): a cursor's first row with its result
|
|
64
|
-
finished, and the row count from a cursor.
|
|
64
|
+
finished, and the row count from a cursor. `quote_identifier` and `located`
|
|
65
|
+
(`_duckdb.py`): a DuckDB quoted identifier, and a binding's relation
|
|
66
|
+
``"<database_role>".<table_location>`` with its catalog quoted.
|
|
65
67
|
- `synthetic_edition`, `profile_edition`, `Shape`, `Dim` and `HierarchyShape`
|
|
66
68
|
(`testing.py`): build a seeded synthetic edition that passes `check_edition`,
|
|
67
69
|
or take a `Shape` from an existing edition.
|
|
@@ -40,3 +40,25 @@ def count(cursor: duckdb.DuckDBPyConnection) -> int:
|
|
|
40
40
|
"""
|
|
41
41
|
row = first(cursor)
|
|
42
42
|
return int(row[0]) if row is not None else 0
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def quote_identifier(name: str) -> str:
|
|
46
|
+
"""`name` as a DuckDB quoted identifier: in double quotes, each inner double quote doubled.
|
|
47
|
+
|
|
48
|
+
A catalog alias carries the product id (`EditionEngine.attach`), and a
|
|
49
|
+
product named after a StatCan table id, ``14100287``, starts with a digit,
|
|
50
|
+
which an unquoted identifier cannot. DuckDB resolves a quoted identifier
|
|
51
|
+
without regard to case, as it does an unquoted one.
|
|
52
|
+
"""
|
|
53
|
+
return '"' + name.replace('"', '""') + '"'
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def located(catalog: str, location: str) -> str:
|
|
57
|
+
"""The relation ``<catalog>.<location>``, with `catalog` quoted.
|
|
58
|
+
|
|
59
|
+
A binding names its table by its catalog (``database_role``) and its
|
|
60
|
+
``schema.table`` inside it (``table_location``). The catalog is an ATTACH
|
|
61
|
+
alias the registry chose, quoted here; the location is the producer's and
|
|
62
|
+
written as it stands.
|
|
63
|
+
"""
|
|
64
|
+
return f"{quote_identifier(catalog)}.{location}"
|
|
@@ -31,6 +31,7 @@ from typing import Literal
|
|
|
31
31
|
|
|
32
32
|
import duckdb
|
|
33
33
|
|
|
34
|
+
from sdmxlib._duckdb import located
|
|
34
35
|
from sdmxlib.local.registry import EditionRegistry, LocalRegistry
|
|
35
36
|
from sdmxlib.model.binding import DataflowBinding
|
|
36
37
|
from sdmxlib.model.constraint import (
|
|
@@ -114,7 +115,7 @@ def build_dataflow_constraint(
|
|
|
114
115
|
)
|
|
115
116
|
raise TypeError(err)
|
|
116
117
|
|
|
117
|
-
table =
|
|
118
|
+
table = located(binding.database_role, binding.table_location)
|
|
118
119
|
key_values: list[KeyValue] = []
|
|
119
120
|
for dim_id in sorted(binding.dimension_column_map):
|
|
120
121
|
column = binding.dimension_column_map[dim_id]
|
|
@@ -260,7 +261,7 @@ def build_component_availability(
|
|
|
260
261
|
held = _held_values(registry, dataflow_urn)
|
|
261
262
|
component_filter = _drop_covering(component_filter, held)
|
|
262
263
|
|
|
263
|
-
table =
|
|
264
|
+
table = located(binding.database_role, binding.table_location)
|
|
264
265
|
key_values: list[KeyValue] = []
|
|
265
266
|
components: list[ComponentValueSet] = []
|
|
266
267
|
for target in targets:
|
|
@@ -33,8 +33,12 @@ seals through `seal(extensions=...)`.
|
|
|
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
|
-
`open`, `remote=` at `publish`, `lookup=`
|
|
37
|
-
`
|
|
36
|
+
`open`, `remote=` at `publish`, `lookup=` outside `receive`,
|
|
37
|
+
`fingerprints=True` at `open`) raises `ValueError`. `fingerprints=None`
|
|
38
|
+
(the default) recomputes the fingerprints at `publish` only;
|
|
39
|
+
`fingerprints=True` adds them at `receive`, and `fingerprints=False` skips
|
|
40
|
+
them at `publish`, for the process that sealed the edition, right after
|
|
41
|
+
`seal` (GH-357). `structures=` takes one edition or a
|
|
38
42
|
sequence of them, and a partial is checked against the one holding its
|
|
39
43
|
full artefact with its `partial_of` fingerprint; an empty sequence raises
|
|
40
44
|
`ValueError`. For an edition with no bindings (a structure product), the
|
|
@@ -134,8 +138,8 @@ seals through `seal(extensions=...)`.
|
|
|
134
138
|
manifest only when the table's uuid, current data file ids and current
|
|
135
139
|
columns in this edition's lake catalog equal those in the previous
|
|
136
140
|
edition's catalog, and neither has a delete file. Every other table is
|
|
137
|
-
fingerprinted by reading its rows. `check_edition(at="publish")`
|
|
138
|
-
|
|
141
|
+
fingerprinted by reading its rows. `check_edition(at="publish")` reads
|
|
142
|
+
every row unless given `fingerprints=False`.
|
|
139
143
|
- An edition with a lake is refused when a coded column holds a value
|
|
140
144
|
outside its codelist. The survey scans every binding before refusing, and
|
|
141
145
|
stores availability only when nothing is refused.
|
|
@@ -15,6 +15,7 @@ One scan per component column at publish answers two questions:
|
|
|
15
15
|
|
|
16
16
|
from attrs import frozen
|
|
17
17
|
|
|
18
|
+
from sdmxlib._duckdb import located
|
|
18
19
|
from sdmxlib.builders.contentconstraint import _distinct_values
|
|
19
20
|
from sdmxlib.local.registry import EditionRegistry
|
|
20
21
|
from sdmxlib.model.binding import DataflowBinding
|
|
@@ -111,6 +112,6 @@ def survey(
|
|
|
111
112
|
|
|
112
113
|
def _tables(binding: DataflowBinding) -> list[str]:
|
|
113
114
|
"""The tables `binding` reads: its own, then its series-attribute sidecar."""
|
|
114
|
-
main =
|
|
115
|
+
main = located(binding.database_role, binding.table_location)
|
|
115
116
|
sidecar = binding.series_attributes_location
|
|
116
|
-
return [main] if sidecar is None else [main,
|
|
117
|
+
return [main] if sidecar is None else [main, located(binding.database_role, sidecar)]
|
|
@@ -30,6 +30,7 @@ from pathlib import Path
|
|
|
30
30
|
|
|
31
31
|
import msgspec
|
|
32
32
|
|
|
33
|
+
from sdmxlib._duckdb import located
|
|
33
34
|
from sdmxlib.api.registry import RestRegistry
|
|
34
35
|
from sdmxlib.builders.contentconstraint import _distinct_values
|
|
35
36
|
from sdmxlib.data_store import WriteSource
|
|
@@ -410,7 +411,7 @@ def _observed_codes(
|
|
|
410
411
|
Raises:
|
|
411
412
|
ValueError: If a column holds a value that is not a code of its codelist.
|
|
412
413
|
"""
|
|
413
|
-
table =
|
|
414
|
+
table = located(binding.database_role, binding.table_location)
|
|
414
415
|
columns = table_columns(edition.connection, table)
|
|
415
416
|
mapped = {**binding.dimension_column_map, **binding.attribute_column_map, **binding.measure_column_map}
|
|
416
417
|
for component_id, urn in _components(dsd).items():
|
|
@@ -91,7 +91,7 @@ def check_edition(
|
|
|
91
91
|
remote: str | None = None,
|
|
92
92
|
engine: EditionEngine | None = None,
|
|
93
93
|
lookup: Lookup | None = None,
|
|
94
|
-
fingerprints: bool =
|
|
94
|
+
fingerprints: bool | None = None,
|
|
95
95
|
expect: Manifest | str | Path | None = None,
|
|
96
96
|
structures: str | Path | Sequence[str | Path] | None = None,
|
|
97
97
|
extensions: Mapping[str, Check] | None = None,
|
|
@@ -109,7 +109,7 @@ def check_edition(
|
|
|
109
109
|
| bindings: the manifest's, each with the count it gives | yes | yes | no |
|
|
110
110
|
| references: every stored reference names something in the store (see `structures`) | yes | yes | no |
|
|
111
111
|
| tags: every stored language tag is in the form `normalize_tag` gives | yes | yes | no |
|
|
112
|
-
| fingerprints: recomputed, equal to the manifest's |
|
|
112
|
+
| fingerprints: recomputed, equal to the manifest's | unless `fingerprints` is False | if it is True | no |
|
|
113
113
|
| availability: coded columns hold codes; stored availability is the data's | yes | no | no |
|
|
114
114
|
| expect: fingerprints equal to an earlier manifest's | with `expect` | with `expect` | with `expect` |
|
|
115
115
|
| partials: `partial_of` and the items match the full artefact | with `structures` | with `structures` | no |
|
|
@@ -137,15 +137,26 @@ def check_edition(
|
|
|
137
137
|
credentials; one of its own when None.
|
|
138
138
|
lookup: At ``receive``, what the blob store reports for a ``data/``
|
|
139
139
|
entry, or None for a file it does not hold (see `verify_remote`).
|
|
140
|
-
fingerprints:
|
|
141
|
-
|
|
140
|
+
fingerprints: Whether to recompute every artefact, binding and
|
|
141
|
+
content fingerprint from the store and compare it with the
|
|
142
|
+
manifest's. None takes the profile's default: ``publish``
|
|
143
|
+
recomputes them, ``receive`` and ``open`` do not. True opts a
|
|
144
|
+
``receive`` check in. False skips them at ``publish``, for the
|
|
145
|
+
process that sealed the edition, right after `seal`: `seal`
|
|
146
|
+
computed the manifest's fingerprints from this store, and the
|
|
147
|
+
``files`` check, which still hashes every file, shows the files
|
|
148
|
+
are the ones sealed. On the 2021 Census Profile edition, 2.0 GB
|
|
149
|
+
of data files, the check took 774 s with the recomputation and
|
|
150
|
+
46 s without it. Check an edition received from elsewhere, or
|
|
151
|
+
one sealed by another process, with the default.
|
|
142
152
|
expect: An earlier edition's manifest, or its directory, whose
|
|
143
153
|
content this one must have: a republish that is to change no
|
|
144
154
|
content, such as every edition rebuilt at a new store schema. Each
|
|
145
155
|
artefact, binding and the edition fingerprint that differs is a
|
|
146
156
|
finding under ``expect``. Read from the manifests alone, so at
|
|
147
|
-
``publish``, where the fingerprints are also recomputed
|
|
148
|
-
run says the store's content is
|
|
157
|
+
``publish``, where the fingerprints are also recomputed unless
|
|
158
|
+
``fingerprints=False``, a clean run says the store's content is
|
|
159
|
+
the earlier one's.
|
|
149
160
|
structures: The editions holding the full artefacts this edition's
|
|
150
161
|
partials were cut from, structure products say: one edition or a
|
|
151
162
|
sequence of them. Each partial whose manifest entry records
|
|
@@ -167,9 +178,9 @@ def check_edition(
|
|
|
167
178
|
What was checked and what was found.
|
|
168
179
|
|
|
169
180
|
Raises:
|
|
170
|
-
ValueError: If `lookup`, `
|
|
171
|
-
|
|
172
|
-
empty sequence.
|
|
181
|
+
ValueError: If `lookup`, `remote` or `structures` is given at a
|
|
182
|
+
profile that does not use it, `fingerprints` is True at ``open``,
|
|
183
|
+
or `structures` is an empty sequence.
|
|
173
184
|
"""
|
|
174
185
|
_refuse_unused(at, lookup=lookup, fingerprints=fingerprints, remote=remote, structures=structures)
|
|
175
186
|
root = Path(path)
|
|
@@ -237,7 +248,7 @@ def _refuse_unused(
|
|
|
237
248
|
at: Profile,
|
|
238
249
|
*,
|
|
239
250
|
lookup: Lookup | None,
|
|
240
|
-
fingerprints: bool,
|
|
251
|
+
fingerprints: bool | None,
|
|
241
252
|
remote: str | None,
|
|
242
253
|
structures: str | Path | Sequence[str | Path] | None,
|
|
243
254
|
) -> None:
|
|
@@ -254,10 +265,8 @@ def _refuse_unused(
|
|
|
254
265
|
if lookup is not None and at != "receive":
|
|
255
266
|
msg = f"lookup= verifies data files at receive; at={at!r} does not use it"
|
|
256
267
|
raise ValueError(msg)
|
|
257
|
-
if fingerprints and at
|
|
258
|
-
msg =
|
|
259
|
-
"always recomputes them" if at == "publish" else "never does"
|
|
260
|
-
)
|
|
268
|
+
if fingerprints and at == "open":
|
|
269
|
+
msg = "fingerprints=True recomputes them from the store; at='open' reads no store"
|
|
261
270
|
raise ValueError(msg)
|
|
262
271
|
|
|
263
272
|
|
|
@@ -268,7 +277,7 @@ def _steps(
|
|
|
268
277
|
at: Profile,
|
|
269
278
|
*,
|
|
270
279
|
sized_remotely: bool,
|
|
271
|
-
fingerprints: bool,
|
|
280
|
+
fingerprints: bool | None,
|
|
272
281
|
structures: tuple[Path, ...] | None,
|
|
273
282
|
extensions: Mapping[str, Check],
|
|
274
283
|
) -> list[tuple[str, Callable[[], Iterable[Finding]]]]:
|
|
@@ -284,7 +293,7 @@ def _steps(
|
|
|
284
293
|
("references", partial(_references, reg, None if manifest.bindings else structures)),
|
|
285
294
|
("tags", partial(_tags, reg)),
|
|
286
295
|
]
|
|
287
|
-
if at == "publish"
|
|
296
|
+
if fingerprints or (fingerprints is None and at == "publish"):
|
|
288
297
|
steps.append(("fingerprints", partial(_fingerprints, root, manifest, reg)))
|
|
289
298
|
if at == "publish":
|
|
290
299
|
steps.append(("availability", partial(_availability, manifest, reg)))
|
|
@@ -12,7 +12,7 @@ from typing import Literal
|
|
|
12
12
|
import duckdb
|
|
13
13
|
import google_crc32c
|
|
14
14
|
|
|
15
|
-
from sdmxlib._duckdb import first
|
|
15
|
+
from sdmxlib._duckdb import first, quote_identifier
|
|
16
16
|
from sdmxlib.edition._availability import survey
|
|
17
17
|
from sdmxlib.edition._canonical import CANONICAL_FORM
|
|
18
18
|
from sdmxlib.edition._fingerprint import (
|
|
@@ -54,20 +54,21 @@ from sdmxlib.storage.writers import clear_availability, put_availability
|
|
|
54
54
|
#: Every data file and delete file the lake catalog references from any snapshot
|
|
55
55
|
#: it keeps, with the schema and table paths each one's path is relative to.
|
|
56
56
|
#: The table and schema rows are the ones live when the file was written.
|
|
57
|
-
#: ``
|
|
58
|
-
#:
|
|
57
|
+
#: ``{metadata}`` is the database DuckLake attaches behind the catalog's alias,
|
|
58
|
+
#: ``__ducklake_metadata_<alias>``, quoted. The alias is ``lake`` in a builder and
|
|
59
|
+
#: ``<prefix>__tables`` in an `EditionEngine`.
|
|
59
60
|
_LAKE_FILES = """
|
|
60
61
|
SELECT s.path, s.path_is_relative, t.path, t.path_is_relative, f.path, f.path_is_relative
|
|
61
62
|
FROM (
|
|
62
|
-
SELECT table_id, begin_snapshot, path, path_is_relative FROM
|
|
63
|
+
SELECT table_id, begin_snapshot, path, path_is_relative FROM {metadata}.ducklake_data_file
|
|
63
64
|
UNION ALL
|
|
64
|
-
SELECT table_id, begin_snapshot, path, path_is_relative FROM
|
|
65
|
+
SELECT table_id, begin_snapshot, path, path_is_relative FROM {metadata}.ducklake_delete_file
|
|
65
66
|
) AS f
|
|
66
|
-
JOIN
|
|
67
|
+
JOIN {metadata}.ducklake_table AS t
|
|
67
68
|
ON t.table_id = f.table_id
|
|
68
69
|
AND t.begin_snapshot <= f.begin_snapshot
|
|
69
70
|
AND (t.end_snapshot IS NULL OR f.begin_snapshot < t.end_snapshot)
|
|
70
|
-
JOIN
|
|
71
|
+
JOIN {metadata}.ducklake_schema AS s
|
|
71
72
|
ON s.schema_id = t.schema_id
|
|
72
73
|
AND s.begin_snapshot <= f.begin_snapshot
|
|
73
74
|
AND (s.end_snapshot IS NULL OR f.begin_snapshot < s.end_snapshot)
|
|
@@ -200,7 +201,7 @@ def lake_files(conn: duckdb.DuckDBPyConnection, data: Path | str, *, lake: str =
|
|
|
200
201
|
ManifestError: If the catalog references a file outside `data`.
|
|
201
202
|
"""
|
|
202
203
|
found: set[str] = set()
|
|
203
|
-
for row in conn.execute(_LAKE_FILES.format(
|
|
204
|
+
for row in conn.execute(_LAKE_FILES.format(metadata=quote_identifier(f"__ducklake_metadata_{lake}"))).fetchall():
|
|
204
205
|
path = ""
|
|
205
206
|
anchored = False
|
|
206
207
|
for part, relative in zip(row[::2], row[1::2], strict=True):
|
|
@@ -359,7 +360,7 @@ type _TableState = tuple[object, ...]
|
|
|
359
360
|
def _table_state(conn: duckdb.DuckDBPyConnection, db: str, table_location: str) -> _TableState | None:
|
|
360
361
|
"""The state of the table at ``schema.table`` `table_location` in catalog database `db`; None with a delete file."""
|
|
361
362
|
schema, _, table = table_location.partition(".")
|
|
362
|
-
row = first(conn.execute(_TABLE_STATE.format(db=db), {"schema": schema, "table": table}))
|
|
363
|
+
row = first(conn.execute(_TABLE_STATE.format(db=quote_identifier(db)), {"schema": schema, "table": table}))
|
|
363
364
|
return None if row is None else tuple(row)
|
|
364
365
|
|
|
365
366
|
|
|
@@ -99,6 +99,14 @@ plane: it attaches the catalogs, serves observation reads and takes writes.
|
|
|
99
99
|
`check_scan_integrity`.
|
|
100
100
|
- The lake is attached as `ducklake:<root>/tables.ducklake` with `DATA_PATH` and
|
|
101
101
|
`OVERRIDE_DATA_PATH true`. A read-only class also adds `READ_ONLY`.
|
|
102
|
+
- SQL names an attached catalog quoted: `ATTACH ... AS "<alias>"`, a binding's
|
|
103
|
+
relation as `"<database_role>".<table_location>` (`_duckdb.located`) and
|
|
104
|
+
DuckLake's `"__ducklake_metadata_<alias>"`. An alias carries the product id,
|
|
105
|
+
and a product id may start with a digit (`14100287`), which an unquoted
|
|
106
|
+
identifier cannot (GH-356). `data_store._sql_identifier` still refuses any
|
|
107
|
+
name but letters, digits and underscores before quoting it.
|
|
108
|
+
`SchemaInspector.invalidate` matches a table named with its parts quoted or
|
|
109
|
+
bare.
|
|
102
110
|
- Every read cursor is a `conn.cursor()` passed through `use_sdmx(...,
|
|
103
111
|
catalog)` (`storage/schema.py`), because a derived cursor does not inherit
|
|
104
112
|
`USE`. Read cursors are cached per thread through `threading.local`.
|
|
@@ -28,6 +28,7 @@ from typing import TYPE_CHECKING, Literal, Self, override
|
|
|
28
28
|
import duckdb
|
|
29
29
|
import polars as pl
|
|
30
30
|
|
|
31
|
+
from sdmxlib._duckdb import located, quote_identifier
|
|
31
32
|
from sdmxlib.data_store import WriteSource
|
|
32
33
|
from sdmxlib.local.object_store import OptionValue, StoreSecret
|
|
33
34
|
from sdmxlib.local.sql import SchemaInspector
|
|
@@ -548,7 +549,7 @@ class DuckDBDataStore(SessionFactory):
|
|
|
548
549
|
component the DSD leaves untyped.
|
|
549
550
|
"""
|
|
550
551
|
try:
|
|
551
|
-
return self.inspect().column_types(
|
|
552
|
+
return self.inspect().column_types(located(binding.database_role, binding.table_location))
|
|
552
553
|
except duckdb.CatalogException:
|
|
553
554
|
return column_types(binding, dsd) if dsd is not None else {}
|
|
554
555
|
|
|
@@ -626,16 +627,17 @@ class DuckDBDataStore(SessionFactory):
|
|
|
626
627
|
msg = f"Invalid {name} identifier: {value!r}"
|
|
627
628
|
raise ValueError(msg)
|
|
628
629
|
conn = self.connection
|
|
629
|
-
|
|
630
|
+
target = located(lake_alias, f"{schema}.{table}")
|
|
631
|
+
conn.execute(f"CREATE SCHEMA IF NOT EXISTS {located(lake_alias, schema)}")
|
|
630
632
|
conn.execute(
|
|
631
|
-
f"CREATE OR REPLACE TABLE {
|
|
633
|
+
f"CREATE OR REPLACE TABLE {target} AS SELECT * FROM read_csv(?, types=?, header=true)",
|
|
632
634
|
[str(path), dict(types)],
|
|
633
635
|
)
|
|
634
|
-
refuse_mixed_structures(conn,
|
|
635
|
-
refuse_actions(conn,
|
|
636
|
+
refuse_mixed_structures(conn, target, kind="TABLE")
|
|
637
|
+
refuse_actions(conn, target, kind="TABLE")
|
|
636
638
|
# A column `types` leaves out is inferred, so a replacement may change
|
|
637
639
|
# its type (#518) — and the inspector's cached `DESCRIBE` with it.
|
|
638
|
-
self.inspect().invalidate(
|
|
640
|
+
self.inspect().invalidate(target)
|
|
639
641
|
|
|
640
642
|
def write_observations(
|
|
641
643
|
self,
|
|
@@ -704,8 +706,8 @@ class DuckDBDataStore(SessionFactory):
|
|
|
704
706
|
view_name = f"__sdmxlib_write_obs_{id(source):x}"
|
|
705
707
|
conn.register(view_name, _as_relation(conn, source))
|
|
706
708
|
try:
|
|
707
|
-
target = f"{
|
|
708
|
-
conn.execute(f"CREATE SCHEMA IF NOT EXISTS {lake_alias
|
|
709
|
+
target = located(lake_alias, f"{schema}.{table}")
|
|
710
|
+
conn.execute(f"CREATE SCHEMA IF NOT EXISTS {located(lake_alias, schema)}")
|
|
709
711
|
partitions = _column_list(conn, view_name, partition_by)
|
|
710
712
|
if sorted_by and not _is_ducklake(conn, lake_alias):
|
|
711
713
|
msg = (
|
|
@@ -807,16 +809,19 @@ def _column_list(conn: duckdb.DuckDBPyConnection, view_name: str, names: tuple[s
|
|
|
807
809
|
|
|
808
810
|
|
|
809
811
|
def _sql_identifier(name: str) -> str:
|
|
810
|
-
"""
|
|
812
|
+
"""`name` as a DuckDB quoted identifier (extension name, ATTACH alias, column).
|
|
811
813
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
814
|
+
Only letters, digits and underscores are accepted, so no name reaches the
|
|
815
|
+
SQL that could close the quotes. Quoted, a name may start with a digit:
|
|
816
|
+
an alias carrying a product id such as ``14100287`` attaches.
|
|
817
|
+
|
|
818
|
+
Raises:
|
|
819
|
+
ValueError: If `name` holds anything but letters, digits and underscores.
|
|
815
820
|
"""
|
|
816
821
|
if not _is_valid_identifier(name):
|
|
817
822
|
msg = f"Invalid SQL identifier: {name!r}"
|
|
818
823
|
raise ValueError(msg)
|
|
819
|
-
return name
|
|
824
|
+
return quote_identifier(name)
|
|
820
825
|
|
|
821
826
|
|
|
822
827
|
def _is_valid_identifier(name: str) -> bool:
|
|
@@ -51,7 +51,7 @@ import threading
|
|
|
51
51
|
import duckdb
|
|
52
52
|
from attrs import frozen
|
|
53
53
|
|
|
54
|
-
from sdmxlib._duckdb import first
|
|
54
|
+
from sdmxlib._duckdb import first, located, quote_identifier
|
|
55
55
|
from sdmxlib.model.binding import DataflowBinding
|
|
56
56
|
from sdmxlib.session import cursor_for
|
|
57
57
|
|
|
@@ -233,12 +233,19 @@ class SchemaInspector:
|
|
|
233
233
|
return partitions
|
|
234
234
|
|
|
235
235
|
def invalidate(self, table: str) -> None:
|
|
236
|
-
"""Drop everything cached about ``table`` (e.g. after a rewrite).
|
|
236
|
+
"""Drop everything cached about ``table`` (e.g. after a rewrite).
|
|
237
|
+
|
|
238
|
+
`plan` names a binding's table with its catalog quoted
|
|
239
|
+
(``"lake".d.obs``); ``table`` may name it with its parts quoted or
|
|
240
|
+
bare, and both spellings drop the same entries.
|
|
241
|
+
"""
|
|
242
|
+
name = _unquoted(table)
|
|
237
243
|
with self._lock:
|
|
238
|
-
self._columns_cache
|
|
239
|
-
|
|
244
|
+
for cached in [k for k in self._columns_cache if _unquoted(k) == name]:
|
|
245
|
+
del self._columns_cache[cached]
|
|
246
|
+
for cache_key in [k for k in self._key_counts_cache if _unquoted(k[0]) == name]:
|
|
240
247
|
del self._key_counts_cache[cache_key]
|
|
241
|
-
for cache_key in [k for k in self._partitions_cache if f"{k[0]}.{k[1]}" ==
|
|
248
|
+
for cache_key in [k for k in self._partitions_cache if f"{k[0]}.{k[1]}" == name]:
|
|
242
249
|
del self._partitions_cache[cache_key]
|
|
243
250
|
|
|
244
251
|
def invalidate_all(self) -> None:
|
|
@@ -266,11 +273,11 @@ class SchemaInspector:
|
|
|
266
273
|
some combination of those keys, which would multiply every
|
|
267
274
|
observation the join matches.
|
|
268
275
|
"""
|
|
269
|
-
main =
|
|
276
|
+
main = located(binding.database_role, binding.table_location)
|
|
270
277
|
sidecar_loc = binding.series_attributes_location
|
|
271
278
|
if sidecar_loc is None:
|
|
272
279
|
return QueryPlan(main=main, sidecar=None, join_keys=())
|
|
273
|
-
sidecar =
|
|
280
|
+
sidecar = located(binding.database_role, sidecar_loc)
|
|
274
281
|
join_keys = self.shared_columns(main, sidecar)
|
|
275
282
|
if not join_keys:
|
|
276
283
|
msg = (
|
|
@@ -292,6 +299,11 @@ class SchemaInspector:
|
|
|
292
299
|
return QueryPlan(main=main, sidecar=sidecar, join_keys=join_keys)
|
|
293
300
|
|
|
294
301
|
|
|
302
|
+
def _unquoted(table: str) -> str:
|
|
303
|
+
"""`table` with its identifiers' double quotes removed, the form `invalidate` compares names in."""
|
|
304
|
+
return table.replace('"', "")
|
|
305
|
+
|
|
306
|
+
|
|
295
307
|
def _ducklake_partitions(conn: duckdb.DuckDBPyConnection, catalog: str, table_location: str) -> tuple[str, ...]:
|
|
296
308
|
"""A DuckLake table's current identity partition columns, or ``()`` when `catalog` is not a DuckLake catalog."""
|
|
297
309
|
lakes = conn.execute("SELECT database_name FROM duckdb_databases() WHERE type = 'ducklake'").fetchall()
|
|
@@ -299,16 +311,16 @@ def _ducklake_partitions(conn: duckdb.DuckDBPyConnection, catalog: str, table_lo
|
|
|
299
311
|
return ()
|
|
300
312
|
# DuckLake attaches the catalog's metadata under this name, not listed in
|
|
301
313
|
# `duckdb_databases()` but readable.
|
|
302
|
-
metadata = f"__ducklake_metadata_{catalog}"
|
|
314
|
+
metadata = quote_identifier(f"__ducklake_metadata_{catalog}")
|
|
303
315
|
schema, _, table = table_location.rpartition(".")
|
|
304
316
|
rows = conn.execute(
|
|
305
317
|
f"""
|
|
306
318
|
SELECT col.column_name, pc.transform
|
|
307
|
-
FROM
|
|
308
|
-
JOIN
|
|
309
|
-
JOIN
|
|
310
|
-
JOIN
|
|
311
|
-
JOIN
|
|
319
|
+
FROM {metadata}.ducklake_partition_info AS pi
|
|
320
|
+
JOIN {metadata}.ducklake_partition_column AS pc USING (partition_id, table_id)
|
|
321
|
+
JOIN {metadata}.ducklake_table AS t ON t.table_id = pi.table_id AND t.end_snapshot IS NULL
|
|
322
|
+
JOIN {metadata}.ducklake_schema AS s ON s.schema_id = t.schema_id AND s.end_snapshot IS NULL
|
|
323
|
+
JOIN {metadata}.ducklake_column AS col
|
|
312
324
|
ON col.table_id = pi.table_id AND col.column_id = pc.column_id AND col.end_snapshot IS NULL
|
|
313
325
|
WHERE pi.end_snapshot IS NULL AND s.schema_name = ? AND t.table_name = ?
|
|
314
326
|
ORDER BY pc.partition_key_index
|
|
@@ -42,6 +42,7 @@ import polars as pl
|
|
|
42
42
|
import pyarrow as pa
|
|
43
43
|
import pyarrow.parquet as pq
|
|
44
44
|
|
|
45
|
+
from sdmxlib._duckdb import located
|
|
45
46
|
from sdmxlib.formats._arrow import frame_of
|
|
46
47
|
from sdmxlib.formats.sdmx_json import data_v1, data_v2
|
|
47
48
|
from sdmxlib.model.binding import DataflowBinding
|
|
@@ -187,7 +188,7 @@ class Observations(Cols[ObsRow]):
|
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
#: Qualified observation table — already two-part, hence `__schema__`.
|
|
190
|
-
self.__table__ =
|
|
191
|
+
self.__table__ = located(binding.database_role, binding.table_location)
|
|
191
192
|
#: `None`: the table name above qualifies itself.
|
|
192
193
|
self.__schema__ = None
|
|
193
194
|
#: The dimension columns, in DSD order.
|
|
@@ -7,7 +7,7 @@ identifier a `DataflowBinding` validated, never caller text.
|
|
|
7
7
|
|
|
8
8
|
import duckdb
|
|
9
9
|
|
|
10
|
-
from sdmxlib._duckdb import first
|
|
10
|
+
from sdmxlib._duckdb import first, located
|
|
11
11
|
from sdmxlib.model.binding import DataflowBinding
|
|
12
12
|
|
|
13
13
|
|
|
@@ -42,6 +42,6 @@ def observations_from(template: str, *, multiplier: int, offset: int, space: int
|
|
|
42
42
|
|
|
43
43
|
def distinct_periods(conn: duckdb.DuckDBPyConnection, binding: DataflowBinding, column: str) -> int:
|
|
44
44
|
"""About how many distinct values `column` holds in the binding's table (HyperLogLog)."""
|
|
45
|
-
location =
|
|
45
|
+
location = located(binding.database_role, binding.table_location)
|
|
46
46
|
row = first(conn.execute(f'SELECT approx_count_distinct("{column}") FROM {location}'))
|
|
47
47
|
return int(row[0]) if row is not None else 0
|
|
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
|
|
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
|