datakeel 0.27.0__py3-none-any.whl
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.
- datakeel/THIRD_PARTY_NOTICES.md +223 -0
- datakeel/__init__.py +8 -0
- datakeel/_contracts/agents/catalog-analyst.yaml +11 -0
- datakeel/_contracts/agents/evidence-reviewer.yaml +9 -0
- datakeel/_contracts/agents/kg-standard-analyst.yaml +12 -0
- datakeel/_contracts/agents/metric-manager.yaml +10 -0
- datakeel/_contracts/agents/production-ops.yaml +18 -0
- datakeel/_contracts/agents/training-auditor.yaml +12 -0
- datakeel/_contracts/annotation_qa/normal-single.json +27 -0
- datakeel/_contracts/ask/enterprise-reviews.yaml +20 -0
- datakeel/_contracts/ask/knowledge.yaml +311 -0
- datakeel/_contracts/ask/questions.yaml +90 -0
- datakeel/_contracts/assets/ranking.yaml +10 -0
- datakeel/_contracts/delivery-manifest.schema.json +181 -0
- datakeel/_contracts/evidence/lexicon.yaml +22 -0
- datakeel/_contracts/evidence/near_duplicate.yaml +12 -0
- datakeel/_contracts/evidence/questions.yaml +139 -0
- datakeel/_contracts/golden/01-read-only.yaml +20 -0
- datakeel/_contracts/golden/02-filtered-search.yaml +22 -0
- datakeel/_contracts/golden/03-reversible.yaml +44 -0
- datakeel/_contracts/golden/04-irreversible-approval.yaml +45 -0
- datakeel/_contracts/golden/05-rejected.yaml +42 -0
- datakeel/_contracts/golden/06-frozen-approval.yaml +45 -0
- datakeel/_contracts/golden/07-repeated-loop.yaml +37 -0
- datakeel/_contracts/golden/08-budget.yaml +22 -0
- datakeel/_contracts/golden/09-cross-turn-reference.yaml +49 -0
- datakeel/_contracts/golden/10-unknown-tool.yaml +21 -0
- datakeel/_contracts/golden/11-dry-run.yaml +39 -0
- datakeel/_contracts/golden/12-long-conversation.yaml +124 -0
- datakeel/_contracts/golden/13-evidence-query.yaml +105 -0
- datakeel/_contracts/golden/14-evidence-unknown.yaml +70 -0
- datakeel/_contracts/golden/15-evidence-version.yaml +134 -0
- datakeel/_contracts/golden/16-evidence-approval.yaml +134 -0
- datakeel/_contracts/golden/17-ask-answer.yaml +149 -0
- datakeel/_contracts/golden/18-ask-clarification.yaml +75 -0
- datakeel/_contracts/golden/19-ask-unanswerable.yaml +78 -0
- datakeel/_contracts/golden/20-ask-updated-metric.yaml +328 -0
- datakeel/_contracts/golden/21-delegation-catalog.yaml +48 -0
- datakeel/_contracts/golden/22-delegation-scope.yaml +51 -0
- datakeel/_contracts/golden/23-delegation-depth.yaml +75 -0
- datakeel/_contracts/golden/24-delegation-concurrency.yaml +65 -0
- datakeel/_contracts/golden/25-canary-text.yaml +18 -0
- datakeel/_contracts/golden/26-canary-arguments.yaml +25 -0
- datakeel/_contracts/golden/27-injection-approval.yaml +49 -0
- datakeel/_contracts/golden/28-memory-write.yaml +42 -0
- datakeel/_contracts/golden/29-memory-cross-session.yaml +38 -0
- datakeel/_contracts/golden/30-memory-delete.yaml +39 -0
- datakeel/_contracts/golden/31-memory-minimum-overlap.yaml +38 -0
- datakeel/_contracts/golden/32-canary-prefix.yaml +18 -0
- datakeel/_contracts/golden/33-kg-query.yaml +77 -0
- datakeel/_contracts/golden/34-kg-explain-review.yaml +90 -0
- datakeel/_contracts/golden/35-kg-replay-action.yaml +32 -0
- datakeel/_contracts/golden/36-kg-external-approval.yaml +35 -0
- datakeel/_contracts/golden/37-ask-knowledge-owner.yaml +107 -0
- datakeel/_contracts/golden/38-ask-knowledge-upstream.yaml +81 -0
- datakeel/_contracts/golden/39-ask-knowledge-clarification.yaml +64 -0
- datakeel/_contracts/golden/40-ask-knowledge-reviewed.yaml +65 -0
- datakeel/_contracts/golden/41-image-kg-explain.yaml +81 -0
- datakeel/_contracts/golden/41-standard-coverage.yaml +52 -0
- datakeel/_contracts/golden/42-image-kg-replay.yaml +27 -0
- datakeel/_contracts/golden/42-standard-usage.yaml +44 -0
- datakeel/_contracts/golden/43-image-kg-external.yaml +27 -0
- datakeel/_contracts/golden/44-annotation-quality.yaml +81 -0
- datakeel/_contracts/golden/44-asset-access.yaml +35 -0
- datakeel/_contracts/golden/44-quality-failures.yaml +54 -0
- datakeel/_contracts/golden/45-quality-table-history.yaml +50 -0
- datakeel/_contracts/golden/46-training-distribution.yaml +53 -0
- datakeel/_contracts/golden/46-training-quality.yaml +43 -0
- datakeel/_contracts/golden/47-training-leakage.yaml +51 -0
- datakeel/_contracts/golden/48-one-sentence-clarify.yaml +24 -0
- datakeel/_contracts/golden/48-one-sentence-multistep.yaml +23 -0
- datakeel/_contracts/golden/48-one-sentence-overreach.yaml +19 -0
- datakeel/_contracts/golden/49-one-sentence-permission-first.yaml +19 -0
- datakeel/_contracts/golden/49-one-sentence-unknown-param.yaml +21 -0
- datakeel/_contracts/golden/49-one-sentence-unsupported.yaml +18 -0
- datakeel/_contracts/kg/demo/image-truncated.png +0 -0
- datakeel/_contracts/kg/demo/image-truncated.yaml +18 -0
- datakeel/_contracts/kg/demo/long-documents.yaml +38 -0
- datakeel/_contracts/kg/eval/cases.yaml +1243 -0
- datakeel/_contracts/kg/eval/examples.yaml +80 -0
- datakeel/_contracts/kg/eval/image/SOURCES.md +5 -0
- datakeel/_contracts/kg/eval/image/cases.yaml +6552 -0
- datakeel/_contracts/kg/eval/image/images/b01.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b02.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b03.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b04.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b05.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b06.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b07.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b08.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b09.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b10.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b11.png +0 -0
- datakeel/_contracts/kg/eval/image/images/b12.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en01_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en01_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en02_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en02_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en03_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en03_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en04_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en04_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en05_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en05_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en06_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en06_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en07_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en07_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en08_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en08_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en09_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en09_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en10_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en10_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en11_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en11_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/en12_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/en12_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh01_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh01_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh02_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh02_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh03_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh03_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh04_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh04_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh05_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh05_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh06_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh06_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh07_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh07_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh08_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh08_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh09_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh09_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh10_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh10_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh11_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh11_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image/images/zh12_clean.png +0 -0
- datakeel/_contracts/kg/eval/image/images/zh12_scan.jpg +0 -0
- datakeel/_contracts/kg/eval/image-auto/SOURCES.md +17 -0
- datakeel/_contracts/kg/eval/image-auto/cases.yaml +183 -0
- datakeel/_contracts/kg/eval/image-auto/images/connector.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/grey.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/strike.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-lineage.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-location.png +0 -0
- datakeel/_contracts/kg/eval/image-auto/images/text-staff.png +0 -0
- datakeel/_contracts/kg/eval/truncated.yaml +2 -0
- datakeel/_contracts/kg/profiles/cloud.yaml +16 -0
- datakeel/_contracts/kg/profiles/fake-long.yaml +14 -0
- datakeel/_contracts/kg/profiles/fake.yaml +14 -0
- datakeel/_contracts/kg/profiles/ollama.yaml +19 -0
- datakeel/_contracts/kg/profiles/replay-demo.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-enterprise.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-flash.yaml +14 -0
- datakeel/_contracts/kg/profiles/replay-image-auto.yaml +10 -0
- datakeel/_contracts/kg/profiles/replay-image-cloud-flash.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-flash.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-qwen.yaml +9 -0
- datakeel/_contracts/kg/profiles/replay-image-rapidocr-qwen.yaml +9 -0
- datakeel/_contracts/kg/prompts/image-transcription-v1.txt +9 -0
- datakeel/_contracts/kg/recordings/auto-extraction.yaml +215 -0
- datakeel/_contracts/kg/recordings/auto-transcription.yaml +248 -0
- datakeel/_contracts/kg/recordings/deepseek-flash.yaml +2607 -0
- datakeel/_contracts/kg/recordings/fake-long.yaml +345 -0
- datakeel/_contracts/kg/recordings/image-cloud-flash.yaml +3784 -0
- datakeel/_contracts/kg/recordings/image-flash.yaml +3796 -0
- datakeel/_contracts/kg/recordings/image-qwen.yaml +1334 -0
- datakeel/_contracts/kg/recordings/image-rapidocr-qwen.yaml +4528 -0
- datakeel/_contracts/kg/recordings/qwen-flash-image.yaml +3711 -0
- datakeel/_contracts/kg/recordings/qwen-image.yaml +3754 -0
- datakeel/_contracts/kg/recordings/qwen3.5.yaml +2463 -0
- datakeel/_contracts/kg/recordings/rapidocr-image.yaml +4092 -0
- datakeel/_contracts/kg/schema.yaml +155 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash-auto.yaml +21 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash-coordinates.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/bailian-qwen35-flash.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/fake.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/ollama-vision-local.yaml +16 -0
- datakeel/_contracts/kg/transcription-profiles/rapidocr-local.yaml +12 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto-ocr.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto-vlm.yaml +7 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-auto.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-demo-failure.yaml +14 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-demo.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-flash.yaml +8 -0
- datakeel/_contracts/kg/transcription-profiles/replay-image-ocr.yaml +8 -0
- datakeel/_contracts/model-prices.yaml +107 -0
- datakeel/_contracts/quality-rules/example.yaml +17 -0
- datakeel/_contracts/quality-rules/schema.json +348 -0
- datakeel/_contracts/routing/intent-cases.yaml +382 -0
- datakeel/_contracts/routing/intent-regression.yaml +168 -0
- datakeel/_contracts/routing/model-tier-cases.yaml +103 -0
- datakeel/_contracts/routing/models-tiered.example.yaml +47 -0
- datakeel/_contracts/routing/models.yaml +41 -0
- datakeel/_contracts/semantic-layer/dimensions.yaml +186 -0
- datakeel/_contracts/semantic-layer/metrics.yaml +467 -0
- datakeel/_contracts/semantic-layer/owners.yaml +22 -0
- datakeel/_contracts/semantic-layer/terms.yaml +184 -0
- datakeel/_contracts/standards/enterprise.yaml +935 -0
- datakeel/_contracts/standards/standards.schema.json +331 -0
- datakeel/_contracts/standards/synonyms.yaml +65 -0
- datakeel/_contracts/workflows/dataset-health.yaml +147 -0
- datakeel/_contracts/workflows/low-quality-cleanup.yaml +153 -0
- datakeel/_contracts/workflows/metric-change.yaml +158 -0
- datakeel/action_store/__init__.py +4 -0
- datakeel/action_store/file_handlers.py +120 -0
- datakeel/action_store/lifecycle.py +206 -0
- datakeel/action_store/validation.py +85 -0
- datakeel/actions/__init__.py +4 -0
- datakeel/actions/action_language.py +245 -0
- datakeel/actions/approvals.py +8 -0
- datakeel/actions/authorization.json +155 -0
- datakeel/actions/authorization.py +47 -0
- datakeel/actions/budget.py +104 -0
- datakeel/actions/catalog_parameters.py +63 -0
- datakeel/actions/custom_runs.py +49 -0
- datakeel/actions/data_asset_parameters.py +57 -0
- datakeel/actions/datasheet_parameters.py +59 -0
- datakeel/actions/declarations.py +141 -0
- datakeel/actions/dq_parameters.py +50 -0
- datakeel/actions/execution.py +8 -0
- datakeel/actions/execution_targets.json +67 -0
- datakeel/actions/file_declarations.json +244 -0
- datakeel/actions/file_declarations.py +58 -0
- datakeel/actions/identity_parameters.py +85 -0
- datakeel/actions/ir.py +102 -0
- datakeel/actions/kg_parameters.py +34 -0
- datakeel/actions/label_draft_parameters.py +62 -0
- datakeel/actions/llm_data_parameters.py +18 -0
- datakeel/actions/models.py +254 -0
- datakeel/actions/parameters.py +248 -0
- datakeel/actions/planning.py +8 -0
- datakeel/actions/policy.py +65 -0
- datakeel/actions/production_catalog_parameters.py +170 -0
- datakeel/actions/production_language.py +174 -0
- datakeel/actions/production_parameters.py +231 -0
- datakeel/actions/production_references.py +60 -0
- datakeel/actions/receipts.py +61 -0
- datakeel/actions/recovery.py +48 -0
- datakeel/actions/reference_assets.json +16 -0
- datakeel/actions/references.py +192 -0
- datakeel/actions/registry.py +141 -0
- datakeel/actions/release_parameters.py +43 -0
- datakeel/actions/selection_parameters.py +13 -0
- datakeel/actions/service.py +25 -0
- datakeel/actions/standard_parameters.py +48 -0
- datakeel/actions/worker.py +8 -0
- datakeel/agent/__init__.py +4 -0
- datakeel/agent/confirm.py +34 -0
- datakeel/agent/context.py +92 -0
- datakeel/agent/demo.py +173 -0
- datakeel/agent/dispatch.py +100 -0
- datakeel/agent/evidence_demo.py +152 -0
- datakeel/agent/factory.py +41 -0
- datakeel/agent/guards.py +97 -0
- datakeel/agent/memory.py +142 -0
- datakeel/agent/metering.py +151 -0
- datakeel/agent/models.py +59 -0
- datakeel/agent/providers.py +34 -0
- datakeel/agent/recovery.py +38 -0
- datakeel/agent/service.py +185 -0
- datakeel/agent/tools.py +196 -0
- datakeel/annotation_qa/__init__.py +61 -0
- datakeel/annotation_qa/categorical.py +99 -0
- datakeel/annotation_qa/classification.py +80 -0
- datakeel/annotation_qa/confidence_tiers.py +142 -0
- datakeel/annotation_qa/consensus.py +291 -0
- datakeel/annotation_qa/findings.py +215 -0
- datakeel/annotation_qa/geometry.py +187 -0
- datakeel/annotation_qa/grouping.py +32 -0
- datakeel/annotation_qa/labels.py +144 -0
- datakeel/annotation_qa/outliers.py +192 -0
- datakeel/annotation_qa/polygon_area.py +92 -0
- datakeel/annotation_qa/prelabel_crosscheck.py +64 -0
- datakeel/annotation_qa/prelabel_match.py +166 -0
- datakeel/annotation_qa/prelabel_metrics.py +72 -0
- datakeel/annotation_qa/review_messages.py +139 -0
- datakeel/annotation_qa/review_rules.py +257 -0
- datakeel/annotation_qa/rework.py +154 -0
- datakeel/annotation_qa/risk_scoring.py +109 -0
- datakeel/annotation_qa/service.py +64 -0
- datakeel/api/__init__.py +4 -0
- datakeel/api/app.py +112 -0
- datakeel/api/dependencies.py +18 -0
- datakeel/api/errors.py +43 -0
- datakeel/api/identity_access.py +128 -0
- datakeel/api/routes/__init__.py +4 -0
- datakeel/api/routes/actions.py +120 -0
- datakeel/api/routes/agent.py +396 -0
- datakeel/api/routes/annotation_qa.py +94 -0
- datakeel/api/routes/ask.py +82 -0
- datakeel/api/routes/catalog.py +92 -0
- datakeel/api/routes/custom_operators.py +82 -0
- datakeel/api/routes/data_assets.py +136 -0
- datakeel/api/routes/datasets.py +122 -0
- datakeel/api/routes/datasheets.py +101 -0
- datakeel/api/routes/delivery.py +50 -0
- datakeel/api/routes/evidence.py +68 -0
- datakeel/api/routes/governance.py +93 -0
- datakeel/api/routes/harness.py +42 -0
- datakeel/api/routes/intents.py +47 -0
- datakeel/api/routes/kg.py +191 -0
- datakeel/api/routes/lineage.py +70 -0
- datakeel/api/routes/llm_data.py +94 -0
- datakeel/api/routes/memories.py +56 -0
- datakeel/api/routes/metadata_imports.py +46 -0
- datakeel/api/routes/ontology.py +42 -0
- datakeel/api/routes/openlineage.py +46 -0
- datakeel/api/routes/production.py +170 -0
- datakeel/api/routes/quality_rules.py +85 -0
- datakeel/api/routes/releases.py +62 -0
- datakeel/api/routes/search.py +20 -0
- datakeel/api/routes/standards.py +102 -0
- datakeel/api/routes/standards_reporting.py +26 -0
- datakeel/api/routes/system.py +32 -0
- datakeel/api/routes/tasks.py +71 -0
- datakeel/api/routes/training.py +126 -0
- datakeel/api/routes/uploads.py +61 -0
- datakeel/api/routes/workflow_runs.py +113 -0
- datakeel/api/workflow_stream.py +62 -0
- datakeel/ask/__init__.py +4 -0
- datakeel/ask/access.py +42 -0
- datakeel/ask/charts.py +107 -0
- datakeel/ask/comparisons.py +113 -0
- datakeel/ask/consumption.py +278 -0
- datakeel/ask/dimension_cues.py +50 -0
- datakeel/ask/dimensions.py +237 -0
- datakeel/ask/evaluation.py +153 -0
- datakeel/ask/evaluation_checks.py +102 -0
- datakeel/ask/followup.py +335 -0
- datakeel/ask/followup_cues.py +162 -0
- datakeel/ask/followup_frames.py +60 -0
- datakeel/ask/generic.py +62 -0
- datakeel/ask/interpretation_en.py +48 -0
- datakeel/ask/knowledge_claims.py +229 -0
- datakeel/ask/knowledge_count.py +102 -0
- datakeel/ask/knowledge_focus.py +197 -0
- datakeel/ask/knowledge_frames.py +187 -0
- datakeel/ask/knowledge_intent_candidates.py +158 -0
- datakeel/ask/knowledge_names.py +59 -0
- datakeel/ask/knowledge_parser.py +259 -0
- datakeel/ask/knowledge_roles.py +352 -0
- datakeel/ask/knowledge_routing.py +227 -0
- datakeel/ask/knowledge_scope.py +161 -0
- datakeel/ask/knowledge_service.py +225 -0
- datakeel/ask/knowledge_subjects.py +255 -0
- datakeel/ask/knowledge_system.py +119 -0
- datakeel/ask/knowledge_vocabulary.py +351 -0
- datakeel/ask/matching.py +173 -0
- datakeel/ask/models.py +72 -0
- datakeel/ask/parser.py +20 -0
- datakeel/ask/profile.py +224 -0
- datakeel/ask/reasons.py +77 -0
- datakeel/ask/rerank.py +44 -0
- datakeel/ask/resolution.py +98 -0
- datakeel/ask/service.py +357 -0
- datakeel/ask/time.py +189 -0
- datakeel/ask/time_atoms.py +321 -0
- datakeel/ask/time_vocabulary.py +126 -0
- datakeel/assets/__init__.py +4 -0
- datakeel/assets/access.py +8 -0
- datakeel/assets/ranking.py +29 -0
- datakeel/assets/service.py +82 -0
- datakeel/catalog/__init__.py +4 -0
- datakeel/catalog/importers/__init__.py +4 -0
- datakeel/catalog/importers/airflow.py +306 -0
- datakeel/catalog/importers/airflow_rest.py +178 -0
- datakeel/catalog/importers/base.py +17 -0
- datakeel/catalog/importers/database.py +180 -0
- datakeel/catalog/importers/dbt.py +276 -0
- datakeel/catalog/importers/dbt_models.py +138 -0
- datakeel/catalog/importers/dbt_objects.py +283 -0
- datakeel/catalog/importers/dbt_retention.py +69 -0
- datakeel/catalog/importers/dbt_runs.py +95 -0
- datakeel/catalog/importers/dbt_semantics.py +200 -0
- datakeel/catalog/importers/helpers.py +30 -0
- datakeel/catalog/importers/models.py +23 -0
- datakeel/catalog/importers/sql.py +226 -0
- datakeel/catalog/importers/tabular.py +87 -0
- datakeel/catalog/metadata_service.py +101 -0
- datakeel/catalog/service.py +66 -0
- datakeel/cli/__init__.py +302 -0
- datakeel/cli/__main__.py +9 -0
- datakeel/cli/agent.py +285 -0
- datakeel/cli/ask.py +38 -0
- datakeel/cli/ask_evaluation.py +44 -0
- datakeel/cli/asset_demo.py +107 -0
- datakeel/cli/catalog.py +17 -0
- datakeel/cli/custom_operators.py +117 -0
- datakeel/cli/data_assets.py +125 -0
- datakeel/cli/database.py +77 -0
- datakeel/cli/delivery.py +122 -0
- datakeel/cli/demo.py +239 -0
- datakeel/cli/enterprise.py +89 -0
- datakeel/cli/evaluation.py +45 -0
- datakeel/cli/evidence.py +36 -0
- datakeel/cli/evidence_benchmark.py +69 -0
- datakeel/cli/evidence_evaluation.py +89 -0
- datakeel/cli/image_kg_demo.py +80 -0
- datakeel/cli/intents.py +57 -0
- datakeel/cli/kg_demo.py +93 -0
- datakeel/cli/kg_evaluation.py +148 -0
- datakeel/cli/kg_image_evaluation.py +176 -0
- datakeel/cli/llm_data.py +27 -0
- datakeel/cli/mcp.py +23 -0
- datakeel/cli/media_demo.py +88 -0
- datakeel/cli/memory.py +105 -0
- datakeel/cli/metadata_imports.py +80 -0
- datakeel/cli/parsers.py +15 -0
- datakeel/cli/production.py +94 -0
- datakeel/cli/production_demo.py +166 -0
- datakeel/cli/quality.py +83 -0
- datakeel/cli/release_plans.py +63 -0
- datakeel/cli/routing.py +61 -0
- datakeel/cli/standards.py +145 -0
- datakeel/cli/timeseries_demo.py +124 -0
- datakeel/cli/training.py +124 -0
- datakeel/cli/workflow.py +247 -0
- datakeel/core/__init__.py +4 -0
- datakeel/core/agent_models.py +177 -0
- datakeel/core/annotation_aql.py +77 -0
- datakeel/core/annotation_models.py +342 -0
- datakeel/core/annotation_sampling.py +156 -0
- datakeel/core/ask_chart_models.py +29 -0
- datakeel/core/ask_conversation_models.py +22 -0
- datakeel/core/ask_eval.py +109 -0
- datakeel/core/ask_frame_models.py +51 -0
- datakeel/core/ask_models.py +326 -0
- datakeel/core/canary.py +93 -0
- datakeel/core/catalog_canonical.py +67 -0
- datakeel/core/catalog_identity.py +16 -0
- datakeel/core/catalog_models.py +184 -0
- datakeel/core/catalog_projection.py +40 -0
- datakeel/core/catalog_vocabulary.py +30 -0
- datakeel/core/context_tokens.py +30 -0
- datakeel/core/custom_operators.py +84 -0
- datakeel/core/custom_requests.py +27 -0
- datakeel/core/custom_review.py +112 -0
- datakeel/core/custom_sandbox.py +78 -0
- datakeel/core/custom_schema.py +122 -0
- datakeel/core/data_asset_models.py +226 -0
- datakeel/core/datasheet_execution.py +58 -0
- datakeel/core/datasheet_models.py +133 -0
- datakeel/core/datasheet_types.py +85 -0
- datakeel/core/delivery_models.py +100 -0
- datakeel/core/dq_cron.py +98 -0
- datakeel/core/dq_models.py +208 -0
- datakeel/core/dq_monitor.py +83 -0
- datakeel/core/dq_views.py +38 -0
- datakeel/core/envelopes.py +42 -0
- datakeel/core/errors.py +58 -0
- datakeel/core/evidence_cache.py +139 -0
- datakeel/core/evidence_drafts.py +37 -0
- datakeel/core/evidence_eval.py +105 -0
- datakeel/core/evidence_execution.py +58 -0
- datakeel/core/evidence_inputs.py +43 -0
- datakeel/core/evidence_models.py +268 -0
- datakeel/core/evidence_replay.py +36 -0
- datakeel/core/file_queries.py +17 -0
- datakeel/core/harness_eval.py +162 -0
- datakeel/core/harness_models.py +149 -0
- datakeel/core/harness_pricing.py +67 -0
- datakeel/core/identity_models.py +77 -0
- datakeel/core/image_orientation.py +189 -0
- datakeel/core/intent_models.py +151 -0
- datakeel/core/json_schema.py +81 -0
- datakeel/core/keypoint_models.py +42 -0
- datakeel/core/kg_cache.py +28 -0
- datakeel/core/kg_contracts.py +181 -0
- datakeel/core/kg_costs.py +17 -0
- datakeel/core/kg_errors.py +26 -0
- datakeel/core/kg_eval_models.py +219 -0
- datakeel/core/kg_execution.py +264 -0
- datakeel/core/kg_image_auto_eval.py +36 -0
- datakeel/core/kg_image_eval.py +31 -0
- datakeel/core/kg_image_request.py +19 -0
- datakeel/core/kg_images.py +95 -0
- datakeel/core/kg_models.py +79 -0
- datakeel/core/kg_product.py +51 -0
- datakeel/core/kg_queries.py +119 -0
- datakeel/core/kg_registry.py +46 -0
- datakeel/core/knowledge_citations.py +33 -0
- datakeel/core/knowledge_eval.py +91 -0
- datakeel/core/knowledge_models.py +148 -0
- datakeel/core/knowledge_reviews.py +33 -0
- datakeel/core/label_guidelines.py +82 -0
- datakeel/core/link_matching.py +115 -0
- datakeel/core/link_models.py +74 -0
- datakeel/core/llm_data_governance.py +80 -0
- datakeel/core/llm_data_models.py +120 -0
- datakeel/core/logging.py +56 -0
- datakeel/core/media_alignment.py +42 -0
- datakeel/core/media_metadata.py +43 -0
- datakeel/core/media_models.py +139 -0
- datakeel/core/memory_models.py +95 -0
- datakeel/core/metadata_imports.py +102 -0
- datakeel/core/metadata_projection.py +100 -0
- datakeel/core/metric_history_models.py +30 -0
- datakeel/core/metric_models.py +217 -0
- datakeel/core/model_parameters.py +22 -0
- datakeel/core/models.py +113 -0
- datakeel/core/object_kinds.py +52 -0
- datakeel/core/orchestration.py +126 -0
- datakeel/core/orchestration_airflow.py +109 -0
- datakeel/core/orchestration_catalog.py +162 -0
- datakeel/core/orchestration_sources.py +72 -0
- datakeel/core/pii.py +338 -0
- datakeel/core/pii_credentials.py +201 -0
- datakeel/core/pii_patterns.py +153 -0
- datakeel/core/portable_metadata.py +92 -0
- datakeel/core/predicate_registry.py +154 -0
- datakeel/core/prelabel_models.py +273 -0
- datakeel/core/production_attributes.py +178 -0
- datakeel/core/production_catalog_models.py +286 -0
- datakeel/core/production_keypoints.py +112 -0
- datakeel/core/production_kinds.py +39 -0
- datakeel/core/production_models.py +254 -0
- datakeel/core/production_prediction_models.py +31 -0
- datakeel/core/production_reads.py +129 -0
- datakeel/core/production_segments.py +104 -0
- datakeel/core/production_team_models.py +158 -0
- datakeel/core/production_upgrade_models.py +79 -0
- datakeel/core/profile_models.py +140 -0
- datakeel/core/question_models.py +42 -0
- datakeel/core/recovery.py +27 -0
- datakeel/core/release_models.py +149 -0
- datakeel/core/routing_models.py +59 -0
- datakeel/core/schema.py +170 -0
- datakeel/core/search_models.py +43 -0
- datakeel/core/settings.py +102 -0
- datakeel/core/standard_history_models.py +50 -0
- datakeel/core/standard_models.py +280 -0
- datakeel/core/standard_reporting_models.py +59 -0
- datakeel/core/training_export_models.py +167 -0
- datakeel/core/training_models.py +159 -0
- datakeel/core/transcription_auto.py +90 -0
- datakeel/core/transcription_coordinates.py +103 -0
- datakeel/core/transcription_errors.py +26 -0
- datakeel/core/transcription_models.py +177 -0
- datakeel/core/transcription_wire.py +37 -0
- datakeel/core/uploads.py +127 -0
- datakeel/core/vector_assertion_rules.py +73 -0
- datakeel/core/vector_measurements.py +56 -0
- datakeel/core/vector_models.py +325 -0
- datakeel/core/vector_query.py +64 -0
- datakeel/core/vector_results.py +172 -0
- datakeel/core/workbench_models.py +251 -0
- datakeel/core/workflow_models.py +103 -0
- datakeel/dataset_store/__init__.py +8 -0
- datakeel/dataset_store/dataset_service.py +344 -0
- datakeel/dataset_store/datasets.py +251 -0
- datakeel/dataset_store/display_order.py +112 -0
- datakeel/dataset_store/events.py +33 -0
- datakeel/dataset_store/file_discovery.py +250 -0
- datakeel/dataset_store/file_pages.py +122 -0
- datakeel/dataset_store/file_rows.py +64 -0
- datakeel/dataset_store/file_state.py +104 -0
- datakeel/dataset_store/image_geometry.py +143 -0
- datakeel/dataset_store/import_sources.py +40 -0
- datakeel/dataset_store/lineage_service.py +259 -0
- datakeel/dataset_store/media_artifacts.py +50 -0
- datakeel/dataset_store/media_observations.py +96 -0
- datakeel/dataset_store/metadata_store.py +129 -0
- datakeel/dataset_store/object_projection.py +232 -0
- datakeel/dataset_store/object_queries.py +143 -0
- datakeel/dataset_store/openlineage_store.py +102 -0
- datakeel/dataset_store/profile_queries.py +132 -0
- datakeel/dataset_store/rows.py +77 -0
- datakeel/dataset_store/schema.py +62 -0
- datakeel/dataset_store/search.py +78 -0
- datakeel/dataset_store/search_sources.py +157 -0
- datakeel/dataset_store/upload_files.py +115 -0
- datakeel/dataset_store/upload_folders.py +79 -0
- datakeel/dataset_store/upload_service.py +168 -0
- datakeel/dataset_store/version_diff.py +191 -0
- datakeel/dataset_store/version_stream.py +110 -0
- datakeel/datasets/__init__.py +4 -0
- datakeel/datasets/openlineage_projection.py +162 -0
- datakeel/datasets/records.py +33 -0
- datakeel/datasets/views.py +126 -0
- datakeel/datasheets/__init__.py +4 -0
- datakeel/datasheets/destination.py +50 -0
- datakeel/datasheets/matching.py +171 -0
- datakeel/datasheets/measurement_labels.py +135 -0
- datakeel/datasheets/names.py +144 -0
- datakeel/datasheets/number_labels.py +107 -0
- datakeel/datasheets/number_words.py +141 -0
- datakeel/datasheets/numeric.py +276 -0
- datakeel/datasheets/prompt.py +81 -0
- datakeel/datasheets/render.py +134 -0
- datakeel/datasheets/sentences.py +64 -0
- datakeel/datasheets/templates.py +170 -0
- datakeel/datasheets/units.py +176 -0
- datakeel/datasheets/validation.py +89 -0
- datakeel/datasheets/vocabulary.py +327 -0
- datakeel/delegation/__init__.py +4 -0
- datakeel/delegation/demo.py +34 -0
- datakeel/delegation/loader.py +99 -0
- datakeel/delegation/models.py +72 -0
- datakeel/delegation/parallel.py +123 -0
- datakeel/delegation/policy.py +51 -0
- datakeel/delegation/scripts.py +30 -0
- datakeel/delegation/service.py +166 -0
- datakeel/delegation/tree.py +58 -0
- datakeel/delivery/__init__.py +4 -0
- datakeel/delivery/checks.py +205 -0
- datakeel/delivery/manifest.py +69 -0
- datakeel/delivery/reconcile.py +143 -0
- datakeel/docs/p9/enterprise-docs.yaml +542 -0
- datakeel/docs/p9/enterprise-flash.yaml +372 -0
- datakeel/evidence/__init__.py +4 -0
- datakeel/evidence/cache.py +8 -0
- datakeel/evidence/execution.py +52 -0
- datakeel/evidence/kg_images.py +106 -0
- datakeel/evidence/models.py +38 -0
- datakeel/evidence/presentation.py +140 -0
- datakeel/evidence/query_models.py +117 -0
- datakeel/evidence/registry.py +15 -0
- datakeel/evidence/runtime_compute.py +130 -0
- datakeel/evidence/runtime_inputs.py +198 -0
- datakeel/evidence/runtime_publication.py +61 -0
- datakeel/evidence/vector_cloud.py +200 -0
- datakeel/evidence/vector_duplicate.py +114 -0
- datakeel/evidence/vector_execution.py +322 -0
- datakeel/evidence/vector_parameters.py +16 -0
- datakeel/evidence/vector_payload.py +127 -0
- datakeel/evidence/vector_plan.py +133 -0
- datakeel/evidence/vector_plan_sets.py +77 -0
- datakeel/evidence/vector_publication.py +138 -0
- datakeel/evidence/vector_set_execution.py +133 -0
- datakeel/evidence/vector_set_publication.py +60 -0
- datakeel/evidence/vector_sets.py +207 -0
- datakeel/evidence/vector_transport.py +171 -0
- datakeel/extraction_runtime/__init__.py +4 -0
- datakeel/extraction_runtime/adapter.py +240 -0
- datakeel/extraction_runtime/factory.py +77 -0
- datakeel/extraction_runtime/transport.py +156 -0
- datakeel/governance/__init__.py +9 -0
- datakeel/governance/compliance.py +134 -0
- datakeel/governance/models.py +15 -0
- datakeel/governance/validation.py +145 -0
- datakeel/harness/__init__.py +4 -0
- datakeel/harness/annotation_cases.py +192 -0
- datakeel/harness/assessment.py +131 -0
- datakeel/harness/asset_cases.py +40 -0
- datakeel/harness/cases.py +128 -0
- datakeel/harness/dq_cases.py +74 -0
- datakeel/harness/enterprise_cases.py +33 -0
- datakeel/harness/enterprise_kg.py +101 -0
- datakeel/harness/enterprise_reviews.py +60 -0
- datakeel/harness/evaluation.py +38 -0
- datakeel/harness/evidence_cases.py +42 -0
- datakeel/harness/evidence_evaluation.py +163 -0
- datakeel/harness/evidence_metrics.py +141 -0
- datakeel/harness/evidence_questions.py +96 -0
- datakeel/harness/execution.py +220 -0
- datakeel/harness/image_kg_cases.py +66 -0
- datakeel/harness/injection_cases.py +41 -0
- datakeel/harness/kg_cases.py +53 -0
- datakeel/harness/knowledge_checks.py +123 -0
- datakeel/harness/knowledge_evaluation.py +110 -0
- datakeel/harness/llm_data_cases.py +19 -0
- datakeel/harness/operations.py +56 -0
- datakeel/harness/otel.py +199 -0
- datakeel/harness/otel_checked.py +146 -0
- datakeel/harness/pricing.py +29 -0
- datakeel/harness/resources.py +14 -0
- datakeel/harness/service.py +20 -0
- datakeel/harness/standard_cases.py +126 -0
- datakeel/harness/team_cases.py +33 -0
- datakeel/harness/tool_assessment.py +48 -0
- datakeel/harness/training_cases.py +53 -0
- datakeel/http.py +17 -0
- datakeel/intents/__init__.py +4 -0
- datakeel/intents/already.py +173 -0
- datakeel/intents/answers.py +221 -0
- datakeel/intents/capability.py +79 -0
- datakeel/intents/catalog.py +360 -0
- datakeel/intents/catalog_lookup.py +74 -0
- datakeel/intents/chain_replan.py +162 -0
- datakeel/intents/chains.py +221 -0
- datakeel/intents/choices.py +45 -0
- datakeel/intents/created.py +98 -0
- datakeel/intents/derived.py +193 -0
- datakeel/intents/describe.py +374 -0
- datakeel/intents/drafts.py +60 -0
- datakeel/intents/duplicates.py +168 -0
- datakeel/intents/edits.py +335 -0
- datakeel/intents/estimates.py +108 -0
- datakeel/intents/exclusions.py +83 -0
- datakeel/intents/explore.py +263 -0
- datakeel/intents/field_names.py +397 -0
- datakeel/intents/fill.py +388 -0
- datakeel/intents/fill_state.py +158 -0
- datakeel/intents/grounding.py +92 -0
- datakeel/intents/group_fill.py +394 -0
- datakeel/intents/impossible.py +165 -0
- datakeel/intents/landing.py +73 -0
- datakeel/intents/model_calls.py +120 -0
- datakeel/intents/model_parse.py +398 -0
- datakeel/intents/named_kinds.py +78 -0
- datakeel/intents/object_answers.py +114 -0
- datakeel/intents/object_edits.py +178 -0
- datakeel/intents/outcomes.py +110 -0
- datakeel/intents/partial.py +115 -0
- datakeel/intents/plain_words.py +27 -0
- datakeel/intents/planner.py +400 -0
- datakeel/intents/precondition_reasons.py +134 -0
- datakeel/intents/preconditions.py +396 -0
- datakeel/intents/public_text.py +276 -0
- datakeel/intents/read_scope.py +197 -0
- datakeel/intents/readonly.py +79 -0
- datakeel/intents/recipes.py +291 -0
- datakeel/intents/replanning.py +143 -0
- datakeel/intents/resolve.py +397 -0
- datakeel/intents/rules.py +118 -0
- datakeel/intents/scene.py +58 -0
- datakeel/intents/scope_words.py +49 -0
- datakeel/intents/segments.py +83 -0
- datakeel/intents/selectors.py +227 -0
- datakeel/intents/signatures.py +157 -0
- datakeel/intents/singular.py +50 -0
- datakeel/intents/step_values.py +80 -0
- datakeel/intents/task_files.py +78 -0
- datakeel/intents/task_scope.py +315 -0
- datakeel/intents/turns.py +157 -0
- datakeel/intents/validate.py +397 -0
- datakeel/intents/verify.py +398 -0
- datakeel/intents/what_changes.py +113 -0
- datakeel/intents/wording.py +397 -0
- datakeel/kg/__init__.py +4 -0
- datakeel/kg/aliases.py +173 -0
- datakeel/kg/assembly.py +208 -0
- datakeel/kg/cache.py +67 -0
- datakeel/kg/endpoints.py +56 -0
- datakeel/kg/extractors.py +117 -0
- datakeel/kg/gliner.py +80 -0
- datakeel/kg/identity.py +92 -0
- datakeel/kg/loader.py +65 -0
- datakeel/kg/policy.py +32 -0
- datakeel/kg/prompt.py +132 -0
- datakeel/kg/retention.py +63 -0
- datakeel/kg/text.py +41 -0
- datakeel/kg/verification.py +77 -0
- datakeel/kg_eval/__init__.py +6 -0
- datakeel/kg_eval/alignment.py +90 -0
- datakeel/kg_eval/counts.py +95 -0
- datakeel/kg_eval/execution.py +110 -0
- datakeel/kg_eval/image_auto_metrics.py +61 -0
- datakeel/kg_eval/image_execution.py +220 -0
- datakeel/kg_eval/image_loader.py +68 -0
- datakeel/kg_eval/image_metrics.py +146 -0
- datakeel/kg_eval/image_projection.py +52 -0
- datakeel/kg_eval/image_service.py +120 -0
- datakeel/kg_eval/loader.py +81 -0
- datakeel/kg_eval/projection.py +106 -0
- datakeel/kg_eval/scoring.py +112 -0
- datakeel/kg_eval/service.py +88 -0
- datakeel/label_drafts/__init__.py +4 -0
- datakeel/label_drafts/answer.py +249 -0
- datakeel/label_drafts/checked.py +143 -0
- datakeel/label_drafts/complete.py +200 -0
- datakeel/label_drafts/model.py +311 -0
- datakeel/label_drafts/models.py +71 -0
- datakeel/label_drafts/offline.py +174 -0
- datakeel/label_drafts/standards.py +211 -0
- datakeel/lineage/__init__.py +4 -0
- datakeel/lineage/collapse.py +122 -0
- datakeel/lineage/exports.py +202 -0
- datakeel/lineage/models.py +122 -0
- datakeel/lineage/service.py +231 -0
- datakeel/llm_data/__init__.py +9 -0
- datakeel/llm_data/acceleration.py +117 -0
- datakeel/llm_data/checks.py +203 -0
- datakeel/llm_data/contamination.py +175 -0
- datakeel/llm_data/engine.py +293 -0
- datakeel/llm_data/index.py +222 -0
- datakeel/llm_data/language.py +76 -0
- datakeel/llm_data/parsing.py +309 -0
- datakeel/llm_data/similarity.py +114 -0
- datakeel/llm_data/streaming.py +97 -0
- datakeel/mcp/__init__.py +8 -0
- datakeel/mcp/catalog.py +45 -0
- datakeel/mcp/dispatch.py +51 -0
- datakeel/mcp/local_tools.py +168 -0
- datakeel/mcp/server.py +134 -0
- datakeel/memory/__init__.py +4 -0
- datakeel/memory/consolidation.py +95 -0
- datakeel/memory/retrieval.py +112 -0
- datakeel/memory/service.py +160 -0
- datakeel/memory/tools.py +52 -0
- datakeel/metrics/__init__.py +4 -0
- datakeel/metrics/compiler.py +126 -0
- datakeel/metrics/compiler_filters.py +59 -0
- datakeel/metrics/date_boundaries.py +40 -0
- datakeel/metrics/execution.py +141 -0
- datakeel/metrics/loader.py +45 -0
- datakeel/metrics/projection.py +176 -0
- datakeel/metrics/resolution.py +37 -0
- datakeel/metrics/sql_safety.py +29 -0
- datakeel/metrics/time_grouping.py +36 -0
- datakeel/ontology/__init__.py +4 -0
- datakeel/ontology/annotation_demo.py +58 -0
- datakeel/ontology/annotation_functions.py +23 -0
- datakeel/ontology/annotation_parameters.py +15 -0
- datakeel/ontology/catalog_functions.py +137 -0
- datakeel/ontology/catalog_parameters.py +32 -0
- datakeel/ontology/data_asset_access.py +20 -0
- datakeel/ontology/dq_functions.py +99 -0
- datakeel/ontology/evidence_functions.py +39 -0
- datakeel/ontology/function_language.py +242 -0
- datakeel/ontology/functions.py +330 -0
- datakeel/ontology/kg_functions.py +40 -0
- datakeel/ontology/language_check.py +32 -0
- datakeel/ontology/llm_data_functions.py +25 -0
- datakeel/ontology/models.py +244 -0
- datakeel/ontology/parameters.py +56 -0
- datakeel/ontology/production_functions.py +171 -0
- datakeel/ontology/production_links.py +62 -0
- datakeel/ontology/properties.py +61 -0
- datakeel/ontology/registry.py +148 -0
- datakeel/ontology/standard_functions.py +65 -0
- datakeel/ontology/tool_batch.py +134 -0
- datakeel/ontology/tool_history.py +249 -0
- datakeel/ontology/tool_models.py +80 -0
- datakeel/ontology/tool_refs.py +106 -0
- datakeel/ontology/tool_search.py +147 -0
- datakeel/ontology/tooling.py +218 -0
- datakeel/ontology/training_functions.py +69 -0
- datakeel/ontology/training_parameters.py +26 -0
- datakeel/operators/__init__.py +92 -0
- datakeel/operators/audio/__init__.py +13 -0
- datakeel/operators/audio/clipping.py +74 -0
- datakeel/operators/audio/clipping_stream.py +121 -0
- datakeel/operators/audio/common.py +130 -0
- datakeel/operators/audio/dedup.py +73 -0
- datakeel/operators/audio/fingerprint.py +179 -0
- datakeel/operators/audio/flat_tops.py +149 -0
- datakeel/operators/audio/loudness.py +165 -0
- datakeel/operators/audio/models.py +57 -0
- datakeel/operators/audio/params.py +78 -0
- datakeel/operators/audio/probe.py +27 -0
- datakeel/operators/audio/streaming.py +124 -0
- datakeel/operators/audio/trim_silence.py +66 -0
- datakeel/operators/audio/vad.py +27 -0
- datakeel/operators/base.py +241 -0
- datakeel/operators/custom_container.py +393 -0
- datakeel/operators/custom_job.py +42 -0
- datakeel/operators/custom_memory.py +74 -0
- datakeel/operators/custom_output.py +135 -0
- datakeel/operators/custom_process.py +95 -0
- datakeel/operators/custom_sandbox.py +88 -0
- datakeel/operators/custom_subprocess.py +132 -0
- datakeel/operators/custom_usage.py +35 -0
- datakeel/operators/evidence/__init__.py +4 -0
- datakeel/operators/evidence/annotation_labels.py +148 -0
- datakeel/operators/evidence/caption_mentions.py +88 -0
- datakeel/operators/evidence/common.py +58 -0
- datakeel/operators/evidence/contracts.py +81 -0
- datakeel/operators/evidence/facts.py +56 -0
- datakeel/operators/evidence/image_phash.py +78 -0
- datakeel/operators/evidence/label_gap.py +61 -0
- datakeel/operators/evidence/llm_extractor.py +50 -0
- datakeel/operators/evidence/near_duplicate.py +99 -0
- datakeel/operators/evidence/near_duplicate_hashes.py +149 -0
- datakeel/operators/evidence/vector.py +43 -0
- datakeel/operators/failures.py +97 -0
- datakeel/operators/file/__init__.py +4 -0
- datakeel/operators/file/corrupt_check.py +44 -0
- datakeel/operators/file/dedup.py +30 -0
- datakeel/operators/file/empty_check.py +31 -0
- datakeel/operators/image/__init__.py +4 -0
- datakeel/operators/image/batch.py +34 -0
- datakeel/operators/image/convert.py +29 -0
- datakeel/operators/image/helpers.py +102 -0
- datakeel/operators/image/limits.py +24 -0
- datakeel/operators/image/parallel.py +45 -0
- datakeel/operators/image/quality.py +88 -0
- datakeel/operators/image/quality_scores.py +157 -0
- datakeel/operators/image/quality_signals.py +177 -0
- datakeel/operators/image/resize.py +37 -0
- datakeel/operators/image/thumbnail.py +35 -0
- datakeel/operators/media/__init__.py +4 -0
- datakeel/operators/media/align.py +191 -0
- datakeel/operators/media/command.py +165 -0
- datakeel/operators/media/isolation.py +104 -0
- datakeel/operators/media/probe_annotation.py +50 -0
- datakeel/operators/media/provenance.py +79 -0
- datakeel/operators/media/tools.py +284 -0
- datakeel/operators/pointcloud/__init__.py +4 -0
- datakeel/operators/pointcloud/artifacts.py +65 -0
- datakeel/operators/pointcloud/batch.py +42 -0
- datakeel/operators/pointcloud/cells.py +74 -0
- datakeel/operators/pointcloud/clean.py +36 -0
- datakeel/operators/pointcloud/codec.py +101 -0
- datakeel/operators/pointcloud/components.py +308 -0
- datakeel/operators/pointcloud/downsample.py +45 -0
- datakeel/operators/pointcloud/io.py +37 -0
- datakeel/operators/pointcloud/models.py +253 -0
- datakeel/operators/pointcloud/neighbors.py +168 -0
- datakeel/operators/pointcloud/outliers.py +44 -0
- datakeel/operators/pointcloud/pcd.py +98 -0
- datakeel/operators/pointcloud/ply.py +112 -0
- datakeel/operators/pointcloud/preview.py +83 -0
- datakeel/operators/pointcloud/probe.py +197 -0
- datakeel/operators/pointcloud/shape.py +111 -0
- datakeel/operators/pointcloud/statistics.py +105 -0
- datakeel/operators/pointcloud/unit_check.py +112 -0
- datakeel/operators/table/__init__.py +4 -0
- datakeel/operators/table/inference.py +166 -0
- datakeel/operators/table/io.py +146 -0
- datakeel/operators/table/models.py +99 -0
- datakeel/operators/table/params.py +30 -0
- datakeel/operators/table/profile.py +175 -0
- datakeel/operators/table/relations.py +77 -0
- datakeel/operators/table/statistics.py +62 -0
- datakeel/operators/text/__init__.py +4 -0
- datakeel/operators/text/dedup.py +40 -0
- datakeel/operators/text/encoding_fix.py +39 -0
- datakeel/operators/text/pii_redact.py +39 -0
- datakeel/operators/text/quality.py +46 -0
- datakeel/operators/text/training_quality.py +44 -0
- datakeel/operators/timeseries/__init__.py +4 -0
- datakeel/operators/timeseries/anomaly.py +119 -0
- datakeel/operators/timeseries/common.py +125 -0
- datakeel/operators/timeseries/gaps.py +80 -0
- datakeel/operators/timeseries/models.py +182 -0
- datakeel/operators/timeseries/order_dedup.py +91 -0
- datakeel/operators/timeseries/parsing.py +109 -0
- datakeel/operators/timeseries/resample.py +123 -0
- datakeel/operators/timeseries/rules.py +184 -0
- datakeel/operators/timeseries/timestamp_normalize.py +107 -0
- datakeel/operators/timeseries/unit_check.py +99 -0
- datakeel/operators/video/__init__.py +12 -0
- datakeel/operators/video/analysis.py +197 -0
- datakeel/operators/video/dedup.py +215 -0
- datakeel/operators/video/frames.py +163 -0
- datakeel/operators/video/freeze.py +160 -0
- datakeel/operators/video/invalid_frames.py +118 -0
- datakeel/operators/video/normalize.py +62 -0
- datakeel/operators/video/probe.py +27 -0
- datakeel/operators/video/render.py +79 -0
- datakeel/operators/video/segment.py +103 -0
- datakeel/operators/video/sequence.py +341 -0
- datakeel/persistence/__init__.py +21 -0
- datakeel/persistence/canonical.py +73 -0
- datakeel/persistence/canonical_tables.json +695 -0
- datakeel/persistence/legacy.py +157 -0
- datakeel/persistence/legacy_rows.py +153 -0
- datakeel/persistence/task_completion.py +141 -0
- datakeel/persistence/task_queries.py +34 -0
- datakeel/persistence/task_queue.py +32 -0
- datakeel/persistence/task_vector.py +74 -0
- datakeel/persistence/vector.py +13 -0
- datakeel/persistence/vector_tables.json +23 -0
- datakeel/pipeline/__init__.py +19 -0
- datakeel/pipeline/defaults.py +54 -0
- datakeel/pipeline/evidence.py +36 -0
- datakeel/pipeline/execution.py +200 -0
- datakeel/pipeline/image_pointcloud.py +40 -0
- datakeel/pipeline/media.py +75 -0
- datakeel/pipeline/models.py +62 -0
- datakeel/pipeline/sharding.py +32 -0
- datakeel/pipeline/tabular.py +59 -0
- datakeel/pipeline/validation.py +136 -0
- datakeel/prelabel/__init__.py +37 -0
- datakeel/prelabel/client.py +116 -0
- datakeel/prelabel/credential_source.py +56 -0
- datakeel/prelabel/estimate.py +98 -0
- datakeel/prelabel/images.py +59 -0
- datakeel/prelabel/parse.py +177 -0
- datakeel/prelabel/prompt.py +53 -0
- datakeel/quality/__init__.py +9 -0
- datakeel/quality/annotation.py +108 -0
- datakeel/quality/annotation_report.py +43 -0
- datakeel/quality/dq_constraints.py +208 -0
- datakeel/quality/dq_contracts.py +21 -0
- datakeel/quality/dq_engine.py +222 -0
- datakeel/quality/dq_evaluation.py +53 -0
- datakeel/quality/dq_regex.py +75 -0
- datakeel/quality/dq_report.py +13 -0
- datakeel/quality/dq_source.py +257 -0
- datakeel/quality/dq_statistics.py +146 -0
- datakeel/quality/dq_types.py +134 -0
- datakeel/quality/image_pointcloud.py +253 -0
- datakeel/quality/llm_data.py +68 -0
- datakeel/quality/media.py +251 -0
- datakeel/quality/models.py +84 -0
- datakeel/quality/report.py +222 -0
- datakeel/quality/scoring.py +379 -0
- datakeel/quality/standards.py +139 -0
- datakeel/quality/tabular.py +188 -0
- datakeel/quality/tabular_models.py +58 -0
- datakeel/quality/tabular_report.py +51 -0
- datakeel/routing/__init__.py +4 -0
- datakeel/routing/accounting.py +128 -0
- datakeel/routing/attempts.py +37 -0
- datakeel/routing/classifier.py +96 -0
- datakeel/routing/concepts.py +140 -0
- datakeel/routing/config.py +156 -0
- datakeel/routing/evaluation.py +113 -0
- datakeel/routing/intent.py +253 -0
- datakeel/routing/models.py +68 -0
- datakeel/routing/questions.py +172 -0
- datakeel/routing/scopes.py +137 -0
- datakeel/routing/service.py +89 -0
- datakeel/routing/tiers.py +36 -0
- datakeel/runtime/__init__.py +8 -0
- datakeel/runtime/chat.py +229 -0
- datakeel/runtime/chat_provider.py +139 -0
- datakeel/runtime/delegation_graph.py +120 -0
- datakeel/runtime/graph.py +370 -0
- datakeel/runtime/saver.py +172 -0
- datakeel/runtime/serializer.py +75 -0
- datakeel/runtime/tracing.py +26 -0
- datakeel/runtime/workflow_graph.py +239 -0
- datakeel/runtime/workflow_service.py +119 -0
- datakeel/sample.py +42 -0
- datakeel/sample_annotation_qa.py +127 -0
- datakeel/sample_enterprise/__init__.py +9 -0
- datakeel/sample_enterprise/common.py +27 -0
- datakeel/sample_enterprise/crm.py +68 -0
- datakeel/sample_enterprise/ecommerce.py +91 -0
- datakeel/sample_enterprise/erp.py +68 -0
- datakeel/sample_enterprise/generator.py +59 -0
- datakeel/sample_enterprise/gold.py +150 -0
- datakeel/sample_enterprise/models.py +68 -0
- datakeel/sample_enterprise/service.py +62 -0
- datakeel/sample_evidence/__init__.py +9 -0
- datakeel/sample_evidence/generator.py +159 -0
- datakeel/sample_evidence/images.py +65 -0
- datakeel/sample_evidence/models.py +82 -0
- datakeel/sample_image_kg.py +48 -0
- datakeel/sample_kg.py +68 -0
- datakeel/sample_media/__init__.py +8 -0
- datakeel/sample_media/generator.py +103 -0
- datakeel/sample_standards.py +66 -0
- datakeel/sample_timeseries.py +82 -0
- datakeel/sandbox_entry.py +186 -0
- datakeel/sandbox_worker.py +59 -0
- datakeel/semantic/__init__.py +270 -0
- datakeel/semantic/_snapshot.json +939 -0
- datakeel/semantic/_snapshot.py +11 -0
- datakeel/semantic/snapshot.ts +940 -0
- datakeel/standards/__init__.py +4 -0
- datakeel/standards/checks.py +279 -0
- datakeel/standards/coverage.py +88 -0
- datakeel/standards/lexical.py +223 -0
- datakeel/standards/loader.py +77 -0
- datakeel/standards/mapping.py +106 -0
- datakeel/standards/matching.py +378 -0
- datakeel/standards/names.py +197 -0
- datakeel/storage/__init__.py +4 -0
- datakeel/storage/action_access.py +101 -0
- datakeel/storage/action_approvals.py +106 -0
- datakeel/storage/action_deferred.py +88 -0
- datakeel/storage/action_execution.py +194 -0
- datakeel/storage/action_export.py +142 -0
- datakeel/storage/action_locks.py +66 -0
- datakeel/storage/action_operations.py +168 -0
- datakeel/storage/action_planning.py +277 -0
- datakeel/storage/action_reads.py +64 -0
- datakeel/storage/action_requests.py +80 -0
- datakeel/storage/action_rows.py +78 -0
- datakeel/storage/action_selection.py +105 -0
- datakeel/storage/action_snapshot.py +118 -0
- datakeel/storage/action_store.py +78 -0
- datakeel/storage/action_targets.py +70 -0
- datakeel/storage/action_worker.py +103 -0
- datakeel/storage/annotation_actions.py +63 -0
- datakeel/storage/annotation_frames.py +102 -0
- datakeel/storage/annotation_legacy.py +57 -0
- datakeel/storage/annotation_rework.py +90 -0
- datakeel/storage/annotation_rows.py +48 -0
- datakeel/storage/annotation_sampling.py +161 -0
- datakeel/storage/annotation_store.py +218 -0
- datakeel/storage/approval_evidence.py +29 -0
- datakeel/storage/ask_conversation_rows.py +24 -0
- datakeel/storage/ask_conversations.py +162 -0
- datakeel/storage/ask_evaluations.py +37 -0
- datakeel/storage/ask_evidence.py +189 -0
- datakeel/storage/ask_review.py +68 -0
- datakeel/storage/ask_rows.py +32 -0
- datakeel/storage/ask_store.py +164 -0
- datakeel/storage/base.py +8 -0
- datakeel/storage/budget_accounts.py +76 -0
- datakeel/storage/budget_rows.py +42 -0
- datakeel/storage/budget_service.py +90 -0
- datakeel/storage/catalog_action_state.py +86 -0
- datakeel/storage/catalog_actions.py +100 -0
- datakeel/storage/catalog_details.py +62 -0
- datakeel/storage/catalog_fields.py +56 -0
- datakeel/storage/catalog_graph.py +132 -0
- datakeel/storage/catalog_locks.py +17 -0
- datakeel/storage/catalog_pages.py +65 -0
- datakeel/storage/catalog_projection.py +120 -0
- datakeel/storage/catalog_queries.py +130 -0
- datakeel/storage/catalog_reads.py +31 -0
- datakeel/storage/catalog_rows.py +33 -0
- datakeel/storage/catalog_store.py +124 -0
- datakeel/storage/checkpoint_store.py +189 -0
- datakeel/storage/conversation_asset_refs.py +122 -0
- datakeel/storage/conversation_authorization.py +111 -0
- datakeel/storage/conversation_lock.py +62 -0
- datakeel/storage/conversation_memory_sources.py +57 -0
- datakeel/storage/conversation_resume.py +51 -0
- datakeel/storage/conversation_rows.py +58 -0
- datakeel/storage/conversation_secrets.py +19 -0
- datakeel/storage/conversation_store.py +183 -0
- datakeel/storage/custom_rows.py +31 -0
- datakeel/storage/custom_store.py +176 -0
- datakeel/storage/custom_validation.py +22 -0
- datakeel/storage/data_asset_access.py +218 -0
- datakeel/storage/data_asset_action_state.py +64 -0
- datakeel/storage/data_asset_actions.py +85 -0
- datakeel/storage/data_asset_cards.py +155 -0
- datakeel/storage/data_asset_context.py +87 -0
- datakeel/storage/data_asset_events.py +31 -0
- datakeel/storage/data_asset_grants.py +312 -0
- datakeel/storage/data_asset_native.py +113 -0
- datakeel/storage/data_asset_quality.py +88 -0
- datakeel/storage/data_asset_reads.py +17 -0
- datakeel/storage/data_asset_review.py +49 -0
- datakeel/storage/data_asset_rows.py +101 -0
- datakeel/storage/data_asset_store.py +229 -0
- datakeel/storage/data_asset_targets.py +142 -0
- datakeel/storage/database.py +127 -0
- datakeel/storage/datasheet_actions.py +121 -0
- datakeel/storage/datasheet_facts.py +192 -0
- datakeel/storage/datasheet_job_rows.py +25 -0
- datakeel/storage/datasheet_jobs.py +161 -0
- datakeel/storage/datasheet_rows.py +22 -0
- datakeel/storage/datasheet_sources.py +208 -0
- datakeel/storage/datasheet_store.py +159 -0
- datakeel/storage/datasheet_values.py +105 -0
- datakeel/storage/delivery_rows.py +21 -0
- datakeel/storage/delivery_service.py +213 -0
- datakeel/storage/dq_actions.py +191 -0
- datakeel/storage/dq_issues.py +154 -0
- datakeel/storage/dq_jobs.py +196 -0
- datakeel/storage/dq_reads.py +114 -0
- datakeel/storage/dq_results.py +125 -0
- datakeel/storage/dq_rows.py +96 -0
- datakeel/storage/dq_store.py +109 -0
- datakeel/storage/dq_views.py +173 -0
- datakeel/storage/dq_webhooks.py +60 -0
- datakeel/storage/draft_metering.py +104 -0
- datakeel/storage/evidence_actions.py +274 -0
- datakeel/storage/evidence_artifacts.py +50 -0
- datakeel/storage/evidence_cache.py +148 -0
- datakeel/storage/evidence_constraints.py +80 -0
- datakeel/storage/evidence_decisions.py +144 -0
- datakeel/storage/evidence_evaluations.py +51 -0
- datakeel/storage/evidence_filters.py +68 -0
- datakeel/storage/evidence_import.py +54 -0
- datakeel/storage/evidence_projection.py +212 -0
- datakeel/storage/evidence_queries.py +172 -0
- datakeel/storage/evidence_rows.py +49 -0
- datakeel/storage/evidence_runs.py +37 -0
- datakeel/storage/evidence_snapshot.py +102 -0
- datakeel/storage/evidence_store.py +274 -0
- datakeel/storage/governance_service.py +294 -0
- datakeel/storage/harness_evaluations.py +55 -0
- datakeel/storage/harness_rows.py +41 -0
- datakeel/storage/harness_service.py +150 -0
- datakeel/storage/identity_actions.py +115 -0
- datakeel/storage/identity_authorization.py +97 -0
- datakeel/storage/identity_mutations.py +192 -0
- datakeel/storage/identity_rows.py +54 -0
- datakeel/storage/identity_sessions.py +66 -0
- datakeel/storage/identity_store.py +146 -0
- datakeel/storage/intent_chains.py +100 -0
- datakeel/storage/intent_reads.py +212 -0
- datakeel/storage/intent_rows.py +22 -0
- datakeel/storage/kg_context.py +80 -0
- datakeel/storage/kg_eval_rows.py +22 -0
- datakeel/storage/kg_evaluations.py +60 -0
- datakeel/storage/kg_graph.py +96 -0
- datakeel/storage/kg_image_attribution.py +42 -0
- datakeel/storage/kg_image_eval_store.py +61 -0
- datakeel/storage/kg_image_preparation.py +203 -0
- datakeel/storage/kg_image_sources.py +205 -0
- datakeel/storage/kg_inputs.py +110 -0
- datakeel/storage/kg_preparation.py +176 -0
- datakeel/storage/kg_pricing.py +51 -0
- datakeel/storage/kg_progress.py +61 -0
- datakeel/storage/kg_provenance.py +39 -0
- datakeel/storage/kg_publication.py +268 -0
- datakeel/storage/kg_queries.py +241 -0
- datakeel/storage/kg_reviews.py +82 -0
- datakeel/storage/kg_rows.py +34 -0
- datakeel/storage/kg_run_reads.py +39 -0
- datakeel/storage/kg_source_documents.py +48 -0
- datakeel/storage/kg_store.py +208 -0
- datakeel/storage/kg_transcription_selection.py +40 -0
- datakeel/storage/label_drafts.py +308 -0
- datakeel/storage/link_context.py +105 -0
- datakeel/storage/link_drafts.py +129 -0
- datakeel/storage/link_queries.py +108 -0
- datakeel/storage/link_reviews.py +76 -0
- datakeel/storage/link_store.py +119 -0
- datakeel/storage/llm_data_access.py +51 -0
- datakeel/storage/llm_data_actions.py +233 -0
- datakeel/storage/llm_data_constraints.py +42 -0
- datakeel/storage/llm_data_evaluations.py +90 -0
- datakeel/storage/llm_data_facts.py +46 -0
- datakeel/storage/llm_data_reads.py +60 -0
- datakeel/storage/llm_data_rows.py +43 -0
- datakeel/storage/llm_data_selection.py +58 -0
- datakeel/storage/llm_data_sources.py +92 -0
- datakeel/storage/llm_data_store.py +253 -0
- datakeel/storage/memory_rows.py +45 -0
- datakeel/storage/memory_store.py +262 -0
- datakeel/storage/metric_audit.py +69 -0
- datakeel/storage/metric_drafts.py +125 -0
- datakeel/storage/metric_store.py +159 -0
- datakeel/storage/migrations.py +45 -0
- datakeel/storage/objects.py +221 -0
- datakeel/storage/pg_triggers.py +29 -0
- datakeel/storage/prediction_frames.py +133 -0
- datakeel/storage/production_acceptance.py +209 -0
- datakeel/storage/production_action_state.py +120 -0
- datakeel/storage/production_actions.py +169 -0
- datakeel/storage/production_ai_audit.py +100 -0
- datakeel/storage/production_ai_facts.py +158 -0
- datakeel/storage/production_ai_review.py +126 -0
- datakeel/storage/production_ai_rows.py +62 -0
- datakeel/storage/production_ai_rules.py +140 -0
- datakeel/storage/production_assignments.py +275 -0
- datakeel/storage/production_catalog.py +276 -0
- datakeel/storage/production_catalog_actions.py +115 -0
- datakeel/storage/production_catalog_changes.py +228 -0
- datakeel/storage/production_catalog_impact.py +76 -0
- datakeel/storage/production_catalog_plans.py +200 -0
- datakeel/storage/production_catalog_rows.py +113 -0
- datakeel/storage/production_cloud_labeling.py +198 -0
- datakeel/storage/production_cloud_prelabel.py +233 -0
- datakeel/storage/production_cloud_runner.py +317 -0
- datakeel/storage/production_counters.py +64 -0
- datakeel/storage/production_dispatch.py +206 -0
- datakeel/storage/production_dispatch_plans.py +36 -0
- datakeel/storage/production_dispatch_rules.py +161 -0
- datakeel/storage/production_finalize.py +167 -0
- datakeel/storage/production_human.py +8 -0
- datakeel/storage/production_idempotency.py +67 -0
- datakeel/storage/production_keypoint_upgrades.py +80 -0
- datakeel/storage/production_leases.py +175 -0
- datakeel/storage/production_load_locks.py +60 -0
- datakeel/storage/production_members.py +49 -0
- datakeel/storage/production_native.py +59 -0
- datakeel/storage/production_objects.py +188 -0
- datakeel/storage/production_prediction_parsing.py +369 -0
- datakeel/storage/production_predictions.py +190 -0
- datakeel/storage/production_prelabel_reads.py +107 -0
- datakeel/storage/production_prelabel_refs.py +84 -0
- datakeel/storage/production_prelabel_runs.py +188 -0
- datakeel/storage/production_prelabel_writes.py +133 -0
- datakeel/storage/production_projects.py +250 -0
- datakeel/storage/production_queries.py +252 -0
- datakeel/storage/production_reaper.py +152 -0
- datakeel/storage/production_review_policy.py +69 -0
- datakeel/storage/production_reviews.py +161 -0
- datakeel/storage/production_revisions.py +134 -0
- datakeel/storage/production_rows.py +162 -0
- datakeel/storage/production_schema.py +74 -0
- datakeel/storage/production_separation.py +81 -0
- datakeel/storage/production_statistics.py +160 -0
- datakeel/storage/production_task_images.py +46 -0
- datakeel/storage/production_tasks.py +85 -0
- datakeel/storage/production_team_reads.py +141 -0
- datakeel/storage/production_team_rows.py +86 -0
- datakeel/storage/production_template_upgrade.py +275 -0
- datakeel/storage/production_template_versions.py +140 -0
- datakeel/storage/production_tiers.py +75 -0
- datakeel/storage/release_actions.py +212 -0
- datakeel/storage/release_constraints.py +96 -0
- datakeel/storage/release_rows.py +43 -0
- datakeel/storage/release_service.py +105 -0
- datakeel/storage/standard_changes.py +222 -0
- datakeel/storage/standard_observations.py +121 -0
- datakeel/storage/standard_profiles.py +94 -0
- datakeel/storage/standard_queries.py +55 -0
- datakeel/storage/standard_store.py +109 -0
- datakeel/storage/term_changes.py +59 -0
- datakeel/storage/tool_invocations.py +127 -0
- datakeel/storage/tool_rows.py +29 -0
- datakeel/storage/training_download.py +67 -0
- datakeel/storage/training_export.py +175 -0
- datakeel/storage/training_import.py +67 -0
- datakeel/storage/training_inputs.py +220 -0
- datakeel/storage/training_rows.py +81 -0
- datakeel/storage/training_store.py +283 -0
- datakeel/storage/transcription_pricing.py +38 -0
- datakeel/storage/transcription_rows.py +19 -0
- datakeel/storage/transcription_store.py +65 -0
- datakeel/storage/vector_authorization.py +154 -0
- datakeel/storage/vector_budget.py +195 -0
- datakeel/storage/vector_cache.py +106 -0
- datakeel/storage/vector_current.py +37 -0
- datakeel/storage/vector_cursor.py +68 -0
- datakeel/storage/vector_integrity.py +70 -0
- datakeel/storage/vector_planning.py +86 -0
- datakeel/storage/vector_queries.py +196 -0
- datakeel/storage/vector_query_snapshot.py +188 -0
- datakeel/storage/vector_references.py +63 -0
- datakeel/storage/vector_reports.py +90 -0
- datakeel/storage/vector_rows.py +49 -0
- datakeel/storage/vector_set_integrity.py +74 -0
- datakeel/storage/workbench_assignees.py +63 -0
- datakeel/storage/workbench_pixels.py +20 -0
- datakeel/storage/workbench_reads.py +282 -0
- datakeel/storage/workbench_risk.py +121 -0
- datakeel/storage/workbench_samples.py +179 -0
- datakeel/storage/workflow_recovery.py +149 -0
- datakeel/storage/workflow_rows.py +66 -0
- datakeel/storage/workflow_store.py +202 -0
- datakeel/training/__init__.py +4 -0
- datakeel/training/export.py +153 -0
- datakeel/training/export_common.py +264 -0
- datakeel/training/export_detection.py +188 -0
- datakeel/training/export_hf.py +76 -0
- datakeel/training/export_keypoints.py +92 -0
- datakeel/training/export_records.py +76 -0
- datakeel/training/export_segments.py +63 -0
- datakeel/training/importers.py +143 -0
- datakeel/training/leakage.py +157 -0
- datakeel/training/native.py +38 -0
- datakeel/training/proportions.py +224 -0
- datakeel/training/refinement.py +147 -0
- datakeel/training/single_prevalence.py +196 -0
- datakeel/training/splitting.py +248 -0
- datakeel/training/text_hashes.py +62 -0
- datakeel/transcription/__init__.py +4 -0
- datakeel/transcription/adapters.py +103 -0
- datakeel/transcription/alignment.py +144 -0
- datakeel/transcription/auto.py +192 -0
- datakeel/transcription/auto_adapter.py +84 -0
- datakeel/transcription/auto_document.py +77 -0
- datakeel/transcription/auto_rows.py +123 -0
- datakeel/transcription/cache.py +38 -0
- datakeel/transcription/coordinates.py +58 -0
- datakeel/transcription/factory.py +140 -0
- datakeel/transcription/images.py +36 -0
- datakeel/transcription/loader.py +56 -0
- datakeel/transcription/ocr.py +117 -0
- datakeel/transcription/policy.py +28 -0
- datakeel/transcription/prompt.py +54 -0
- datakeel/transcription/quality.py +89 -0
- datakeel/transcription/transport.py +157 -0
- datakeel/versioning/__init__.py +66 -0
- datakeel/versioning/campaign.py +257 -0
- datakeel/versioning/campaign_v2.py +304 -0
- datakeel/versioning/campaign_v3.py +304 -0
- datakeel/versioning/configuration.py +56 -0
- datakeel/versioning/facts_v2.py +82 -0
- datakeel/versioning/inspect.py +185 -0
- datakeel/versioning/inspect_v2.py +224 -0
- datakeel/versioning/inspect_v3.py +184 -0
- datakeel/versioning/location.py +48 -0
- datakeel/versioning/lock.py +25 -0
- datakeel/versioning/models.py +76 -0
- datakeel/versioning/recovery.py +144 -0
- datakeel/versioning/recovery_models.py +34 -0
- datakeel/versioning/references.py +55 -0
- datakeel/versioning/registry.py +14 -0
- datakeel/versioning/sqlite_b1.json +1598 -0
- datakeel/versioning/sqlite_b2.json +1628 -0
- datakeel/versioning/sqlite_b2_altered_shards.json +6 -0
- datakeel/versioning/sqlite_b3.json +1628 -0
- datakeel/versioning/v1.py +106 -0
- datakeel/versioning/v2.py +66 -0
- datakeel/versioning/v3.py +68 -0
- datakeel/web_dist/.runtime-dependencies.json +16 -0
- datakeel/web_dist/.source-hash +1 -0
- datakeel/web_dist/THIRD-PARTY-LICENSES.txt +446 -0
- datakeel/web_dist/action-runs/index.html +19 -0
- datakeel/web_dist/assets/index-DMt5we1u.css +1 -0
- datakeel/web_dist/assets/index-N04GGpcG.js +69 -0
- datakeel/web_dist/assets/source-code-pro-latin-400-normal-DEXWLoHG.woff2 +0 -0
- datakeel/web_dist/assets/source-code-pro-latin-500-normal-DrRT_DWv.woff2 +0 -0
- datakeel/web_dist/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
- datakeel/web_dist/assets/source-serif-4-latin-700-normal-CGGdTIBe.woff2 +0 -0
- datakeel/web_dist/favicon.svg +1 -0
- datakeel/web_dist/index.html +19 -0
- datakeel/web_dist/lineage/index.html +19 -0
- datakeel/web_dist/report/index.html +19 -0
- datakeel/web_dist/tasks/index.html +19 -0
- datakeel/worker/__init__.py +4 -0
- datakeel/worker/custom_runner.py +148 -0
- datakeel/worker/datasheet_model.py +144 -0
- datakeel/worker/datasheet_runner.py +57 -0
- datakeel/worker/dq_runner.py +63 -0
- datakeel/worker/dq_webhooks.py +65 -0
- datakeel/worker/heartbeat.py +15 -0
- datakeel/worker/kg_execution.py +183 -0
- datakeel/worker/kg_metering.py +131 -0
- datakeel/worker/kg_report.py +129 -0
- datakeel/worker/kg_runner.py +111 -0
- datakeel/worker/kg_transcription.py +259 -0
- datakeel/worker/media_observations.py +68 -0
- datakeel/worker/observations.py +112 -0
- datakeel/worker/queue.py +9 -0
- datakeel/worker/runner.py +159 -0
- datakeel/worker/transcription_consent.py +30 -0
- datakeel/worker/transcription_metering.py +140 -0
- datakeel/worker_store/__init__.py +4 -0
- datakeel/worker_store/completion.py +65 -0
- datakeel/worker_store/rows.py +59 -0
- datakeel/worker_store/schema.py +13 -0
- datakeel/worker_store/task_models.py +42 -0
- datakeel/worker_store/task_queries.py +29 -0
- datakeel/worker_store/task_queue.py +389 -0
- datakeel/worker_store/task_terminal.py +100 -0
- datakeel/worker_store/task_views.py +51 -0
- datakeel/workflows/__init__.py +4 -0
- datakeel/workflows/execution.py +129 -0
- datakeel/workflows/loader.py +104 -0
- datakeel/workflows/models.py +158 -0
- datakeel/workflows/resolver.py +152 -0
- datakeel/workflows/schemas.py +116 -0
- datakeel/workflows/validation.py +143 -0
- datakeel-0.27.0.dist-info/METADATA +248 -0
- datakeel-0.27.0.dist-info/RECORD +1430 -0
- datakeel-0.27.0.dist-info/WHEEL +4 -0
- datakeel-0.27.0.dist-info/entry_points.txt +2 -0
- datakeel-0.27.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Evaluate bounded scalar observations without exposing business values."""
|
|
5
|
+
|
|
6
|
+
import math
|
|
7
|
+
from statistics import fmean
|
|
8
|
+
|
|
9
|
+
from datakeel.core.dq_models import DqRule
|
|
10
|
+
from datakeel.core.errors import ExecutionError
|
|
11
|
+
from datakeel.core.metric_models import Scalar
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def validate_distribution_values(rule: DqRule, values: tuple[Scalar, ...]) -> None:
|
|
15
|
+
"""Reject malformed numeric distributions before collecting any baseline observation."""
|
|
16
|
+
if rule.kind != "distribution_drift" or rule.params.statistic == "null_rate":
|
|
17
|
+
return
|
|
18
|
+
if any(
|
|
19
|
+
value is not None
|
|
20
|
+
and (
|
|
21
|
+
not isinstance(value, int | float)
|
|
22
|
+
or isinstance(value, bool)
|
|
23
|
+
or not math.isfinite(value)
|
|
24
|
+
)
|
|
25
|
+
for value in values
|
|
26
|
+
):
|
|
27
|
+
msg = "Numeric distribution requires finite numeric or NULL values in every row"
|
|
28
|
+
raise ExecutionError(msg)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def stable_mean(values: tuple[float, ...]) -> float:
|
|
32
|
+
"""Scale finite inputs before summation to avoid intermediate floating-point overflow."""
|
|
33
|
+
scale = max((abs(value) for value in values), default=0.0)
|
|
34
|
+
return fmean(value / scale for value in values) * scale if scale else 0.0
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def relative_change(actual: float, baseline: float) -> float:
|
|
38
|
+
"""Use symmetric absolute relative deviation with a finite zero-baseline result."""
|
|
39
|
+
change = abs(actual / baseline - 1) if baseline else float(actual != 0)
|
|
40
|
+
if not math.isfinite(change):
|
|
41
|
+
msg = "Numeric quality drift exceeds finite representation"
|
|
42
|
+
raise ExecutionError(msg)
|
|
43
|
+
return change
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def population_stability(actual: tuple[float, ...], baseline: tuple[float, ...]) -> float:
|
|
47
|
+
"""Compute PSI with a fixed epsilon so empty bins remain finite and deterministic."""
|
|
48
|
+
epsilon = 0.0001
|
|
49
|
+
return sum(
|
|
50
|
+
(max(current, epsilon) - max(previous, epsilon))
|
|
51
|
+
* math.log(max(current, epsilon) / max(previous, epsilon))
|
|
52
|
+
for current, previous in zip(actual, baseline, strict=True)
|
|
53
|
+
)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Isolate arbitrary regular expressions so backtracking cannot stall a worker."""
|
|
5
|
+
|
|
6
|
+
import multiprocessing
|
|
7
|
+
import re
|
|
8
|
+
from multiprocessing.connection import Connection
|
|
9
|
+
|
|
10
|
+
from datakeel.core.catalog_models import SourceProperties
|
|
11
|
+
from datakeel.core.dq_models import DqMetrics, DqRule
|
|
12
|
+
from datakeel.core.errors import ExecutionError
|
|
13
|
+
from datakeel.core.models import BoundaryModel
|
|
14
|
+
from datakeel.quality.dq_source import iter_rule_values
|
|
15
|
+
from datakeel.quality.dq_statistics import ColumnStatistics
|
|
16
|
+
|
|
17
|
+
_SAMPLE_LIMIT = 5
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class RegexObservation(BoundaryModel):
|
|
21
|
+
"""Return only constant-size aggregate evidence from the isolated regex scanner."""
|
|
22
|
+
|
|
23
|
+
metrics: DqMetrics
|
|
24
|
+
failed_count: int
|
|
25
|
+
samples: tuple[int, ...]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def regex_observation(rule: DqRule, source: SourceProperties) -> RegexObservation:
|
|
29
|
+
"""Stream and match in one isolated process under the complete rule deadline."""
|
|
30
|
+
context = multiprocessing.get_context("spawn")
|
|
31
|
+
reader, writer = context.Pipe(duplex=False)
|
|
32
|
+
process = context.Process(target=_match_stream, args=(writer, rule, source), daemon=True)
|
|
33
|
+
process.start()
|
|
34
|
+
writer.close()
|
|
35
|
+
try:
|
|
36
|
+
if not reader.poll(rule.timeout_ms / 1000):
|
|
37
|
+
msg = "Quality regex execution exceeded its timeout"
|
|
38
|
+
raise ExecutionError(msg)
|
|
39
|
+
result = reader.recv()
|
|
40
|
+
if isinstance(result, str):
|
|
41
|
+
raise ExecutionError(result)
|
|
42
|
+
return RegexObservation.model_validate(result)
|
|
43
|
+
except EOFError as error:
|
|
44
|
+
msg = "Quality regex execution could not produce a result"
|
|
45
|
+
raise ExecutionError(msg) from error
|
|
46
|
+
finally:
|
|
47
|
+
reader.close()
|
|
48
|
+
if process.is_alive():
|
|
49
|
+
process.terminate()
|
|
50
|
+
process.join()
|
|
51
|
+
process.close()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _match_stream(writer: Connection, rule: DqRule, source: SourceProperties) -> None:
|
|
55
|
+
compiled = re.compile(rule.params.pattern or "")
|
|
56
|
+
statistics = ColumnStatistics()
|
|
57
|
+
failed = 0
|
|
58
|
+
samples: list[int] = []
|
|
59
|
+
try:
|
|
60
|
+
for values in iter_rule_values(rule, source):
|
|
61
|
+
for index, value in enumerate(values, statistics.rows + 1):
|
|
62
|
+
if value is not None and compiled.fullmatch(str(value)) is None:
|
|
63
|
+
failed += 1
|
|
64
|
+
if len(samples) < _SAMPLE_LIMIT:
|
|
65
|
+
samples.append(index)
|
|
66
|
+
statistics.add(values)
|
|
67
|
+
writer.send(
|
|
68
|
+
RegexObservation(
|
|
69
|
+
metrics=statistics.metrics(), failed_count=failed, samples=tuple(samples)
|
|
70
|
+
).model_dump()
|
|
71
|
+
)
|
|
72
|
+
except ExecutionError as error:
|
|
73
|
+
writer.send(str(error))
|
|
74
|
+
finally:
|
|
75
|
+
writer.close()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Consistent coverage descriptions for stored rule and dataset reports."""
|
|
5
|
+
|
|
6
|
+
from datakeel.core.dq_models import DqResult
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def coverage_text(result: DqResult | None) -> str:
|
|
10
|
+
"""Distinguish complete observations from legacy results or unsuccessful executions."""
|
|
11
|
+
if result is None or result.coverage != "complete" or result.rows_total is None:
|
|
12
|
+
return "coverage unknown"
|
|
13
|
+
return f"coverage 100% ({result.rows_scanned}/{result.rows_total} rows; complete)"
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Reuse the semantic query boundary for bounded read-only quality scans."""
|
|
5
|
+
|
|
6
|
+
from collections.abc import Iterator
|
|
7
|
+
from datetime import UTC, datetime
|
|
8
|
+
from time import monotonic
|
|
9
|
+
from typing import NamedTuple
|
|
10
|
+
|
|
11
|
+
from sqlglot import exp
|
|
12
|
+
|
|
13
|
+
from datakeel.core.catalog_models import SourceProperties
|
|
14
|
+
from datakeel.core.dq_models import DqQueryLimits, DqRule
|
|
15
|
+
from datakeel.core.errors import ExecutionError, ValidationError
|
|
16
|
+
from datakeel.core.metric_models import CompiledQuery, QueryResult, Scalar
|
|
17
|
+
from datakeel.core.models import BoundaryModel
|
|
18
|
+
from datakeel.metrics.execution import execute_queries, execute_query, stream_query
|
|
19
|
+
from datakeel.metrics.sql_safety import validate_select
|
|
20
|
+
from datakeel.quality.dq_types import nulls_only
|
|
21
|
+
|
|
22
|
+
# Side-effect-free built-ins that sqlglot does not model as typed function expressions.
|
|
23
|
+
_PURE_FUNCTIONS = {
|
|
24
|
+
"sqlite": frozenset({"datetime", "julianday", "time", "total", "unixepoch"}),
|
|
25
|
+
"postgres": frozenset({"age", "json_typeof", "jsonb_typeof", "make_date"}),
|
|
26
|
+
}
|
|
27
|
+
_UNIX_EPOCH_JULIAN_DAY = 2440587.5
|
|
28
|
+
_ISO_DATE_PREFIX = "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def iter_rule_values(
|
|
32
|
+
rule: DqRule, source: SourceProperties, *, reference: bool = False
|
|
33
|
+
) -> Iterator[tuple[Scalar, ...]]:
|
|
34
|
+
"""Stream an entire column in bounded batches from one read-only database snapshot."""
|
|
35
|
+
table = rule.params.reference_table if reference else rule.target.table
|
|
36
|
+
column = rule.params.reference_column if reference else rule.target.column
|
|
37
|
+
schema = (
|
|
38
|
+
rule.params.reference_schema or rule.target.schema_name
|
|
39
|
+
if reference
|
|
40
|
+
else rule.target.schema_name
|
|
41
|
+
)
|
|
42
|
+
if not table:
|
|
43
|
+
msg = "A reference table is required"
|
|
44
|
+
raise ValidationError(msg)
|
|
45
|
+
selection: exp.Expr = exp.column(column, quoted=True) if column else exp.Literal.number(1)
|
|
46
|
+
if column and not reference and nulls_only(rule):
|
|
47
|
+
# NULL checks never fetch values, so JSON, array and binary columns stay evaluable.
|
|
48
|
+
selection = (
|
|
49
|
+
exp.Case().when(selection.is_(exp.null()), exp.null()).else_(exp.Literal.number(1))
|
|
50
|
+
)
|
|
51
|
+
query = exp.select(selection).from_(exp.table_(table, db=schema, quoted=True))
|
|
52
|
+
compiled = compile_rule_query(rule, source, query.sql(dialect=source_dialect(source)))
|
|
53
|
+
for batch in stream_query(
|
|
54
|
+
source.connection_url or "",
|
|
55
|
+
compiled,
|
|
56
|
+
DqQueryLimits(timeout_ms=rule.timeout_ms, max_rows=rule.max_rows),
|
|
57
|
+
):
|
|
58
|
+
yield tuple(row[0] for row in batch.rows)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class TableAggregate(NamedTuple):
|
|
62
|
+
"""Database-side totals: row count, newest valid timestamp and unparsable timestamp cells."""
|
|
63
|
+
|
|
64
|
+
row_count: int
|
|
65
|
+
latest: datetime | None = None
|
|
66
|
+
invalid: int = 0
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def read_table_aggregate(rule: DqRule, source: SourceProperties) -> TableAggregate:
|
|
70
|
+
"""Push COUNT/MAX into one bounded read-only statement, so table size has no row cap."""
|
|
71
|
+
dialect = source_dialect(source)
|
|
72
|
+
table = exp.table_(rule.target.table, db=rule.target.schema_name, quoted=True)
|
|
73
|
+
count = exp.Count(this=exp.Star())
|
|
74
|
+
if rule.kind != "freshness" or not rule.target.column:
|
|
75
|
+
row = _single_row(rule, source, exp.select(count).from_(table).sql(dialect=dialect))
|
|
76
|
+
return TableAggregate(whole_number(row[0]))
|
|
77
|
+
column = exp.column(rule.target.column, quoted=True)
|
|
78
|
+
if dialect == "postgres":
|
|
79
|
+
# DATE/TIMESTAMP columns only; +/-infinity is not a usable delivery time.
|
|
80
|
+
valid = exp.Anonymous(this="isfinite", expressions=[column.copy()])
|
|
81
|
+
latest_value = exp.Case().when(valid, column.copy())
|
|
82
|
+
else:
|
|
83
|
+
# SQLite stores timestamps as text; julianday() honours offsets and rejects malformed
|
|
84
|
+
# text, while the GLOB keeps 'now' or bare Julian numbers from counting as timestamps.
|
|
85
|
+
valid = exp.and_(
|
|
86
|
+
exp.EQ(this=exp.Typeof(this=column.copy()), expression=exp.Literal.string("text")),
|
|
87
|
+
exp.Glob(this=column.copy(), expression=exp.Literal.string(_ISO_DATE_PREFIX)),
|
|
88
|
+
)
|
|
89
|
+
latest_value = exp.Case().when(
|
|
90
|
+
valid, exp.Anonymous(this="julianday", expressions=[column.copy()])
|
|
91
|
+
)
|
|
92
|
+
invalid = (
|
|
93
|
+
exp.Case()
|
|
94
|
+
.when(
|
|
95
|
+
exp.and_(exp.not_(column.copy().is_(exp.null())), latest_value.copy().is_(exp.null())),
|
|
96
|
+
exp.Literal.number(1),
|
|
97
|
+
)
|
|
98
|
+
.else_(exp.Literal.number(0))
|
|
99
|
+
)
|
|
100
|
+
query = exp.select(count, exp.Max(this=latest_value), exp.Sum(this=invalid)).from_(table)
|
|
101
|
+
row = _single_row(rule, source, query.sql(dialect=dialect))
|
|
102
|
+
return TableAggregate(whole_number(row[0]), _latest(row[1], dialect), whole_number(row[2]))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _single_row(rule: DqRule, source: SourceProperties, sql: str) -> list[Scalar]:
|
|
106
|
+
result = execute_rule_query(rule, source, sql)
|
|
107
|
+
if len(result.rows) != 1:
|
|
108
|
+
msg = "Quality aggregate did not return exactly one row"
|
|
109
|
+
raise ExecutionError(msg)
|
|
110
|
+
return result.rows[0]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def whole_number(value: Scalar) -> int:
|
|
114
|
+
"""Read an aggregate count, treating SQL NULL as zero."""
|
|
115
|
+
return int(value) if isinstance(value, int | float) and not isinstance(value, bool) else 0
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _latest(value: Scalar, dialect: str) -> datetime | None:
|
|
119
|
+
if dialect == "sqlite":
|
|
120
|
+
if not isinstance(value, int | float) or isinstance(value, bool):
|
|
121
|
+
return None
|
|
122
|
+
# Julian-day doubles carry ~40 µs of error; SQLite itself keeps millisecond precision.
|
|
123
|
+
seconds = round((float(value) - _UNIX_EPOCH_JULIAN_DAY) * 86400, 3)
|
|
124
|
+
return datetime.fromtimestamp(seconds, UTC)
|
|
125
|
+
if not isinstance(value, str):
|
|
126
|
+
return None
|
|
127
|
+
# The driver value arrives as ISO text; naive PostgreSQL timestamps are stored as UTC.
|
|
128
|
+
try:
|
|
129
|
+
stamp = datetime.fromisoformat(value)
|
|
130
|
+
except ValueError:
|
|
131
|
+
return None
|
|
132
|
+
return stamp.replace(tzinfo=UTC) if stamp.tzinfo is None else stamp
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def validate_assertion(rule: DqRule, source: SourceProperties) -> None:
|
|
136
|
+
"""Reject unsafe assertion SQL and undeclared scan scope without opening a connection."""
|
|
137
|
+
_assertion_sql(rule, source)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _reject_unsafe_calls(parsed: exp.Select, dialect: str) -> None:
|
|
141
|
+
# Read-only transactions still allow calls such as pg_terminate_backend or query_to_xml,
|
|
142
|
+
# so assertions may only use functions sqlglot recognises plus a few pure date helpers.
|
|
143
|
+
for node in parsed.walk():
|
|
144
|
+
if isinstance(node, exp.Dot) and isinstance(node.expression, exp.Func):
|
|
145
|
+
msg = "SQL assertions cannot call schema-qualified functions"
|
|
146
|
+
raise ValidationError(msg)
|
|
147
|
+
if isinstance(node, exp.Anonymous) and node.name.lower() not in _PURE_FUNCTIONS[dialect]:
|
|
148
|
+
msg = f"SQL assertions may only call built-in read-only functions, not {node.name}"
|
|
149
|
+
raise ValidationError(msg)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _assertion_sql(rule: DqRule, source: SourceProperties) -> str:
|
|
153
|
+
sql = rule.params.sql or ""
|
|
154
|
+
parsed = validate_select(sql, source_dialect(source))
|
|
155
|
+
_reject_unsafe_calls(parsed, source_dialect(source))
|
|
156
|
+
tables = tuple(parsed.find_all(exp.Table))
|
|
157
|
+
if any(
|
|
158
|
+
table.catalog
|
|
159
|
+
or table.name != rule.target.table
|
|
160
|
+
or (table.db and table.db != rule.target.schema_name)
|
|
161
|
+
for table in tables
|
|
162
|
+
):
|
|
163
|
+
msg = "SQL assertions may read only their declared target table"
|
|
164
|
+
raise ValidationError(msg)
|
|
165
|
+
if parsed.find(exp.With) is not None:
|
|
166
|
+
msg = "SQL assertions do not permit recursive or derived CTE scans"
|
|
167
|
+
raise ValidationError(msg)
|
|
168
|
+
identity = exp.table_(rule.target.table, db=rule.target.schema_name, quoted=True).sql(
|
|
169
|
+
dialect=source_dialect(source)
|
|
170
|
+
)
|
|
171
|
+
# Rewrite only parsed identifier spans: original named binds and all other SQL stay intact.
|
|
172
|
+
spans = sorted({_table_span(table, len(sql)) for table in tables}, reverse=True)
|
|
173
|
+
for start, end in spans:
|
|
174
|
+
sql = sql[:start] + identity + sql[end + 1 :]
|
|
175
|
+
validate_select(sql, source_dialect(source))
|
|
176
|
+
return sql
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def _table_span(table: exp.Table, length: int) -> tuple[int, int]:
|
|
180
|
+
parts = table.parts
|
|
181
|
+
if not parts or any(not isinstance(part, exp.Identifier) for part in parts):
|
|
182
|
+
msg = "SQL assertions require literal target table identifiers"
|
|
183
|
+
raise ValidationError(msg)
|
|
184
|
+
start, end = parts[0].meta.get("start"), parts[-1].meta.get("end")
|
|
185
|
+
if not isinstance(start, int) or not isinstance(end, int) or not 0 <= start <= end < length:
|
|
186
|
+
msg = "SQL assertion target positions cannot be resolved safely"
|
|
187
|
+
raise ValidationError(msg)
|
|
188
|
+
return start, end
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class AssertionObservation(BoundaryModel):
|
|
192
|
+
"""Pair bounded assertion violations with the target count from the same source snapshot."""
|
|
193
|
+
|
|
194
|
+
result: QueryResult
|
|
195
|
+
rows_total: int
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def execute_assertion(rule: DqRule, source: SourceProperties) -> AssertionObservation:
|
|
199
|
+
"""Run an assertion without preflight, retaining only bounded violations and coverage."""
|
|
200
|
+
started = monotonic()
|
|
201
|
+
sql = _assertion_sql(rule, source)
|
|
202
|
+
total_sql = (
|
|
203
|
+
exp.select(exp.Count(this=exp.Star()))
|
|
204
|
+
.from_(exp.table_(rule.target.table, db=rule.target.schema_name, quoted=True))
|
|
205
|
+
.sql(dialect=source_dialect(source))
|
|
206
|
+
)
|
|
207
|
+
timeout_ms = rule.timeout_ms - int((monotonic() - started) * 1000)
|
|
208
|
+
if timeout_ms < 1:
|
|
209
|
+
msg = "Quality assertion exceeded its execution timeout"
|
|
210
|
+
raise ExecutionError(msg)
|
|
211
|
+
result, total = execute_queries(
|
|
212
|
+
source.connection_url or "",
|
|
213
|
+
(
|
|
214
|
+
compile_rule_query(rule, source, sql, rule.params.bindings),
|
|
215
|
+
compile_rule_query(rule, source, total_sql),
|
|
216
|
+
),
|
|
217
|
+
DqQueryLimits(timeout_ms=timeout_ms, max_rows=rule.max_rows),
|
|
218
|
+
)
|
|
219
|
+
if result.truncated:
|
|
220
|
+
msg = "Quality assertion result row limit exceeded"
|
|
221
|
+
raise ExecutionError(msg)
|
|
222
|
+
return AssertionObservation(result=result, rows_total=whole_number(total.rows[0][0]))
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def source_dialect(source: SourceProperties) -> str:
|
|
226
|
+
"""Normalize the registered source dialect for SQL compilation."""
|
|
227
|
+
return "postgres" if source.dialect in {"postgres", "postgresql"} else "sqlite"
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def execute_rule_query(
|
|
231
|
+
rule: DqRule, source: SourceProperties, sql: str, bindings: dict[str, Scalar] | None = None
|
|
232
|
+
) -> QueryResult:
|
|
233
|
+
"""Execute a bounded result query through the shared read-only boundary."""
|
|
234
|
+
return execute_query(
|
|
235
|
+
source.connection_url or "",
|
|
236
|
+
compile_rule_query(rule, source, sql, bindings),
|
|
237
|
+
DqQueryLimits(timeout_ms=rule.timeout_ms, max_rows=rule.max_rows),
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def compile_rule_query(
|
|
242
|
+
rule: DqRule, source: SourceProperties, sql: str, bindings: dict[str, Scalar] | None = None
|
|
243
|
+
) -> CompiledQuery:
|
|
244
|
+
"""Bind a quality query to a supported registered source and frozen rule identity."""
|
|
245
|
+
if not source.connection_url or source.dialect not in {"sqlite", "postgres", "postgresql"}:
|
|
246
|
+
msg = "Quality execution requires a supported registered business source"
|
|
247
|
+
raise ValidationError(msg)
|
|
248
|
+
return CompiledQuery(
|
|
249
|
+
metric_id=rule.id,
|
|
250
|
+
metric_version=rule.revision,
|
|
251
|
+
source_id=rule.target.source_id,
|
|
252
|
+
dialect="postgres" if source_dialect(source) == "postgres" else "sqlite",
|
|
253
|
+
sql=sql,
|
|
254
|
+
parameters=bindings or {},
|
|
255
|
+
tables=[rule.target.table],
|
|
256
|
+
columns=[rule.target.column] if rule.target.column else [],
|
|
257
|
+
)
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Constant-space column statistics, including database-sorted adaptive PSI boundaries."""
|
|
5
|
+
|
|
6
|
+
import math
|
|
7
|
+
from bisect import bisect_right
|
|
8
|
+
from collections.abc import Iterable
|
|
9
|
+
from dataclasses import dataclass, field
|
|
10
|
+
from itertools import pairwise
|
|
11
|
+
|
|
12
|
+
from sqlglot import exp
|
|
13
|
+
|
|
14
|
+
from datakeel.core.catalog_models import SourceProperties
|
|
15
|
+
from datakeel.core.dq_models import DqMetrics, DqQueryLimits, DqRule
|
|
16
|
+
from datakeel.core.errors import ExecutionError
|
|
17
|
+
from datakeel.core.metric_models import Scalar
|
|
18
|
+
from datakeel.metrics.execution import stream_query
|
|
19
|
+
from datakeel.quality.dq_evaluation import validate_distribution_values
|
|
20
|
+
from datakeel.quality.dq_source import (
|
|
21
|
+
compile_rule_query,
|
|
22
|
+
iter_rule_values,
|
|
23
|
+
source_dialect,
|
|
24
|
+
whole_number,
|
|
25
|
+
)
|
|
26
|
+
from datakeel.quality.dq_types import nulls_only
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class ColumnStatistics:
|
|
31
|
+
"""Accumulate scaled online moments and fixed histogram buckets without retaining cells."""
|
|
32
|
+
|
|
33
|
+
edges: tuple[float, ...] = ()
|
|
34
|
+
rows: int = 0
|
|
35
|
+
nulls: int = 0
|
|
36
|
+
numbers: int = 0
|
|
37
|
+
scale: float = 0
|
|
38
|
+
mean: float = 0
|
|
39
|
+
moment: float = 0
|
|
40
|
+
buckets: list[int] = field(default_factory=list[int])
|
|
41
|
+
|
|
42
|
+
def add(self, values: tuple[Scalar, ...]) -> None:
|
|
43
|
+
"""Update bounded statistics from a single batch."""
|
|
44
|
+
if not self.buckets:
|
|
45
|
+
self.buckets = [0] * (len(self.edges) + 1)
|
|
46
|
+
self.rows += len(values)
|
|
47
|
+
self.nulls += sum(value is None for value in values)
|
|
48
|
+
for value in values:
|
|
49
|
+
if (
|
|
50
|
+
isinstance(value, int | float)
|
|
51
|
+
and not isinstance(value, bool)
|
|
52
|
+
and math.isfinite(value)
|
|
53
|
+
):
|
|
54
|
+
self._number(float(value))
|
|
55
|
+
|
|
56
|
+
def _number(self, value: float) -> None:
|
|
57
|
+
if abs(value) > self.scale:
|
|
58
|
+
factor = self.scale / abs(value)
|
|
59
|
+
self.mean *= factor
|
|
60
|
+
self.moment *= factor * factor
|
|
61
|
+
self.scale = abs(value)
|
|
62
|
+
scaled = value / self.scale if self.scale else 0.0
|
|
63
|
+
self.numbers += 1
|
|
64
|
+
delta = scaled - self.mean
|
|
65
|
+
self.mean += delta / self.numbers
|
|
66
|
+
self.moment += delta * (scaled - self.mean)
|
|
67
|
+
self.buckets[bisect_right(self.edges, value)] += 1
|
|
68
|
+
|
|
69
|
+
def metrics(self, *, null_only: bool = False) -> DqMetrics:
|
|
70
|
+
"""Freeze complete, non-sensitive metrics after the stream has finished."""
|
|
71
|
+
mean = self.mean * self.scale if self.numbers and not null_only else None
|
|
72
|
+
stddev = (
|
|
73
|
+
math.sqrt(max(0, self.moment) / self.numbers) * self.scale if self.numbers else None
|
|
74
|
+
)
|
|
75
|
+
if stddev is not None and not math.isfinite(stddev):
|
|
76
|
+
msg = "Numeric quality statistics exceed finite representation"
|
|
77
|
+
raise ExecutionError(msg)
|
|
78
|
+
return DqMetrics(
|
|
79
|
+
row_count=self.rows,
|
|
80
|
+
mean=mean,
|
|
81
|
+
stddev=None if null_only else stddev,
|
|
82
|
+
null_rate=self.nulls / self.rows if self.rows else 0,
|
|
83
|
+
histogram=()
|
|
84
|
+
if null_only
|
|
85
|
+
else tuple(
|
|
86
|
+
bucket / self.numbers if self.numbers else 0 for bucket in (self.buckets or [0])
|
|
87
|
+
),
|
|
88
|
+
bin_edges=() if null_only else self.edges,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def collect_statistics(
|
|
93
|
+
rule: DqRule, batches: Iterable[tuple[Scalar, ...]], edges: tuple[float, ...] = ()
|
|
94
|
+
) -> ColumnStatistics:
|
|
95
|
+
"""Validate every batch before admitting its values into a historical observation."""
|
|
96
|
+
state = ColumnStatistics(edges=edges)
|
|
97
|
+
for values in batches:
|
|
98
|
+
validate_distribution_values(rule, values)
|
|
99
|
+
state.add(values)
|
|
100
|
+
return state
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def distribution_metrics(
|
|
104
|
+
rule: DqRule, source: SourceProperties, edges: tuple[float, ...] | None
|
|
105
|
+
) -> DqMetrics:
|
|
106
|
+
"""Stream moments and, for a cold adaptive PSI baseline, exact database-sorted deciles."""
|
|
107
|
+
if edges is None:
|
|
108
|
+
return _adaptive_metrics(rule, source)
|
|
109
|
+
state = collect_statistics(rule, iter_rule_values(rule, source), edges)
|
|
110
|
+
return state.metrics(null_only=nulls_only(rule))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _adaptive_metrics(rule: DqRule, source: SourceProperties) -> DqMetrics:
|
|
114
|
+
column = exp.column(rule.target.column or "", quoted=True)
|
|
115
|
+
query = (
|
|
116
|
+
exp.select(column, exp.Window(this=exp.Count(this=column.copy())))
|
|
117
|
+
.from_(exp.table_(rule.target.table, db=rule.target.schema_name, quoted=True))
|
|
118
|
+
.order_by(column.copy())
|
|
119
|
+
)
|
|
120
|
+
state = ColumnStatistics()
|
|
121
|
+
boundaries: dict[float, int] = {}
|
|
122
|
+
position = group_start = 0
|
|
123
|
+
previous: float | None = None
|
|
124
|
+
for batch in stream_query(
|
|
125
|
+
source.connection_url or "",
|
|
126
|
+
compile_rule_query(rule, source, query.sql(dialect=source_dialect(source))),
|
|
127
|
+
DqQueryLimits(timeout_ms=rule.timeout_ms, max_rows=rule.max_rows),
|
|
128
|
+
):
|
|
129
|
+
values = tuple(row[0] for row in batch.rows)
|
|
130
|
+
validate_distribution_values(rule, values)
|
|
131
|
+
positions = {whole_number(batch.rows[0][1]) * decile // 10 for decile in range(1, 10)}
|
|
132
|
+
for value in values:
|
|
133
|
+
if isinstance(value, int | float):
|
|
134
|
+
number = float(value)
|
|
135
|
+
if number != previous:
|
|
136
|
+
group_start = position
|
|
137
|
+
if position in positions:
|
|
138
|
+
boundaries[number] = group_start
|
|
139
|
+
position += 1
|
|
140
|
+
previous = number
|
|
141
|
+
state.add(values)
|
|
142
|
+
edges = tuple(sorted(boundaries))
|
|
143
|
+
ranks = [0, *(boundaries[edge] for edge in edges), state.numbers]
|
|
144
|
+
state.edges = edges
|
|
145
|
+
state.buckets = [end - start for start, end in pairwise(ranks)]
|
|
146
|
+
return state.metrics()
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Copyright 2026 Datakeel contributors
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Match reflected column types to the rule kinds that can evaluate their values."""
|
|
5
|
+
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from datakeel.core.dq_models import DqRule
|
|
9
|
+
from datakeel.core.errors import ValidationError
|
|
10
|
+
|
|
11
|
+
type ColumnCategory = Literal[
|
|
12
|
+
"numeric",
|
|
13
|
+
"text",
|
|
14
|
+
"uuid",
|
|
15
|
+
"boolean",
|
|
16
|
+
"temporal",
|
|
17
|
+
"time",
|
|
18
|
+
"json",
|
|
19
|
+
"array",
|
|
20
|
+
"binary",
|
|
21
|
+
"interval",
|
|
22
|
+
"other",
|
|
23
|
+
"dynamic",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
_POSTGRES_TYPES: dict[str, ColumnCategory] = {
|
|
27
|
+
**dict.fromkeys(
|
|
28
|
+
(
|
|
29
|
+
"SMALLINT",
|
|
30
|
+
"INTEGER",
|
|
31
|
+
"BIGINT",
|
|
32
|
+
"INT",
|
|
33
|
+
"INT2",
|
|
34
|
+
"INT4",
|
|
35
|
+
"INT8",
|
|
36
|
+
"NUMERIC",
|
|
37
|
+
"DECIMAL",
|
|
38
|
+
"REAL",
|
|
39
|
+
"FLOAT",
|
|
40
|
+
"FLOAT4",
|
|
41
|
+
"FLOAT8",
|
|
42
|
+
"DOUBLE PRECISION",
|
|
43
|
+
),
|
|
44
|
+
"numeric",
|
|
45
|
+
),
|
|
46
|
+
**dict.fromkeys(
|
|
47
|
+
("TEXT", "VARCHAR", "CHAR", "CHARACTER", "CHARACTER VARYING", "BPCHAR", "NAME", "CITEXT"),
|
|
48
|
+
"text",
|
|
49
|
+
),
|
|
50
|
+
**dict.fromkeys(("DATE", "TIMESTAMP", "TIMESTAMPTZ", "DATETIME"), "temporal"),
|
|
51
|
+
**dict.fromkeys(("TIME", "TIMETZ"), "time"),
|
|
52
|
+
**dict.fromkeys(("JSON", "JSONB"), "json"),
|
|
53
|
+
**dict.fromkeys(("BOOLEAN", "BOOL"), "boolean"),
|
|
54
|
+
"UUID": "uuid",
|
|
55
|
+
"BYTEA": "binary",
|
|
56
|
+
"INTERVAL": "interval",
|
|
57
|
+
"ARRAY": "array",
|
|
58
|
+
}
|
|
59
|
+
_SCALAR: frozenset[ColumnCategory] = frozenset(
|
|
60
|
+
{"numeric", "text", "uuid", "boolean", "temporal", "time", "dynamic"}
|
|
61
|
+
)
|
|
62
|
+
_REQUIREMENTS: dict[str, tuple[frozenset[ColumnCategory], str]] = {
|
|
63
|
+
"unique": (_SCALAR, "a scalar column, not JSON, array, binary or interval"),
|
|
64
|
+
"accepted_values": (
|
|
65
|
+
frozenset({"numeric", "text", "uuid", "boolean", "dynamic"}),
|
|
66
|
+
"a text, numeric, boolean or UUID column",
|
|
67
|
+
),
|
|
68
|
+
"regex": (frozenset({"text", "uuid", "dynamic"}), "a text or UUID column"),
|
|
69
|
+
"referential_integrity": (
|
|
70
|
+
frozenset({"numeric", "text", "uuid", "temporal", "dynamic"}),
|
|
71
|
+
"a text, numeric, UUID or date/timestamp column",
|
|
72
|
+
),
|
|
73
|
+
"range": (frozenset({"numeric", "dynamic"}), "a numeric column"),
|
|
74
|
+
"freshness": (frozenset({"temporal", "dynamic"}), "a DATE or TIMESTAMP column"),
|
|
75
|
+
"distribution_drift": (frozenset({"numeric", "dynamic"}), "a numeric column"),
|
|
76
|
+
}
|
|
77
|
+
# Values compare as Python scalars; UUIDs arrive as canonical text.
|
|
78
|
+
_COMPARABLE: tuple[frozenset[ColumnCategory], ...] = (
|
|
79
|
+
frozenset({"text", "uuid"}),
|
|
80
|
+
frozenset({"numeric"}),
|
|
81
|
+
frozenset({"temporal"}),
|
|
82
|
+
frozenset({"boolean"}),
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def column_category(type_name: str, dialect: str) -> ColumnCategory:
|
|
87
|
+
"""Classify a reflected type; SQLite columns stay dynamic apart from declared BLOBs."""
|
|
88
|
+
name = " ".join(type_name.upper().split())
|
|
89
|
+
base = name.split("(", 1)[0].strip()
|
|
90
|
+
if dialect not in {"postgres", "postgresql"}:
|
|
91
|
+
return "binary" if base == "BLOB" else "dynamic"
|
|
92
|
+
if name.endswith("[]"):
|
|
93
|
+
return "array"
|
|
94
|
+
return _POSTGRES_TYPES.get(base, "other")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def nulls_only(rule: DqRule) -> bool:
|
|
98
|
+
"""Identify rules that only test NULL-ness and therefore never need cell values."""
|
|
99
|
+
return rule.kind == "not_null" or (
|
|
100
|
+
rule.kind == "distribution_drift" and rule.params.statistic == "null_rate"
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def check_column_types(
|
|
105
|
+
rule: DqRule,
|
|
106
|
+
column_type: str,
|
|
107
|
+
dialect: str,
|
|
108
|
+
reference_type: str | None = None,
|
|
109
|
+
) -> None:
|
|
110
|
+
"""Reject kinds whose values the target (and reference) column types cannot provide."""
|
|
111
|
+
category = column_category(column_type, dialect)
|
|
112
|
+
allowed, description = _REQUIREMENTS.get(rule.kind, (_SCALAR, ""))
|
|
113
|
+
if not nulls_only(rule) and category not in allowed:
|
|
114
|
+
msg = (
|
|
115
|
+
f"{rule.kind} rules need {description}; column {rule.target.column} "
|
|
116
|
+
f"has type {column_type}"
|
|
117
|
+
)
|
|
118
|
+
raise ValidationError(msg)
|
|
119
|
+
if reference_type is None:
|
|
120
|
+
return
|
|
121
|
+
reference = column_category(reference_type, dialect)
|
|
122
|
+
if reference not in allowed:
|
|
123
|
+
msg = (
|
|
124
|
+
f"Reference column {rule.params.reference_column} has unsupported type {reference_type}"
|
|
125
|
+
)
|
|
126
|
+
raise ValidationError(msg)
|
|
127
|
+
if "dynamic" not in {category, reference} and not any(
|
|
128
|
+
{category, reference} <= group for group in _COMPARABLE
|
|
129
|
+
):
|
|
130
|
+
msg = (
|
|
131
|
+
f"Reference column type {reference_type} is not comparable with "
|
|
132
|
+
f"target column type {column_type}"
|
|
133
|
+
)
|
|
134
|
+
raise ValidationError(msg)
|