Deployment API
The cognite_data_quality.deploy module provides a unified API for deploying data quality validation infrastructure to CDF. Function handler code is embedded in the package; no separate function/ directory or function_source_root is required.
Overview
deploy_validation_infrastructure()– Ensures Records and state containers (OrchestrationState, FunctionValidationState, RuleEngineResult), deploys the monitoring data model and views, the unified validation function, instance and (optionally) time series workflows and triggers.deploy_validation_pipeline()– Runs the full validation pipeline for a view (historic partitions, sync trigger, monitor schedule). Call after infrastructure is deployed.deploy_incremental()– Deploys function and workflow for a single view config (alternative to full infrastructure deploy).- Component helpers:
deploy_functions(),deploy_instance_workflows(),deploy_timeseries_workflows(),deploy_data_models().
When SHACL/RuleSet contains dqs:uniquenessConstraint or dqs:unique for a view, deploy_instance_workflows() also creates a scheduled dq-{view}-uniqueness workflow. See Uniqueness.
DataProduct mode (0.4.0+): consolidated workflows
When config_source: dataproduct (default), deployment uses one instance workflow and one uniqueness workflow per DataProduct, with a DMS trigger per view. View-specific configuration is passed via trigger input and resolved in the workflow task as ${workflow.input.*}.
Manual cutover from per-view workflows (no auto-migration):
- Delete legacy per-view workflows (
dq-shacl-{view},dq-shacl-{view}-uniqueness) and their associated triggers. - Deploy package 0.4.0 (function + settings).
- Run
deploy_validation_infrastructure()or wait fordata_product_syncto deploy consolidated workflows.
Consolidated deploy creates DMS triggers in no_backfill mode and does not enqueue historic jobs. Existing static data is only validated if you run the historic orchestrator manually per view.
Set workflow.consolidate_per_dataproduct: false to keep legacy per-view workflow deployment in dataproduct mode.
Main Functions
deploy_validation_infrastructure()
Unified deployment of all validation infrastructure (recommended). Uses settings_path and views_dir; function code is taken from the package.
from pathlib import Path
from cognite_data_quality import deploy_validation_infrastructure, load_cognite_client_from_toml
client = load_cognite_client_from_toml("config.toml")
settings_path = Path("config/environments/my_env/settings.yaml")
views_dir = Path("config/environments/my_env/views")
deploy_validation_infrastructure(
client=client,
settings_path=settings_path,
views_dir=views_dir,
function_secrets={"client-id": "...", "client-secret": "..."}, # optional but required for orchestrator triggers
force=False,
dry_run=False,
)
deploy_validation_pipeline()
Deploy and run the full validation pipeline for a view (historic data, sync trigger, monitor schedule):
from cognite_data_quality import deploy_validation_pipeline
result = deploy_validation_pipeline(
client,
settings_path="config/environments/my_env/settings.yaml",
view_external_id="MyView",
wait=True,
)
# result: orchestration_id, partitions_triggered, sync_trigger_external_id, monitor_schedule_name, distribution, ...
deploy_incremental()
Deploy function and workflow for a single view config (takes view config path and optional config_env):
from cognite_data_quality import deploy_incremental
deploy_incremental(
view_config_path="config/environments/my_env/views/my_view.yaml",
client=client,
force=False,
dry_run=False,
)
Component-Specific Functions
For fine-grained control, you can deploy individual components:
deploy_functions()
Deploy Cognite Functions:
from cognite_data_quality import deploy_functions, load_settings
settings = load_settings("config/environments/my_env/settings.yaml")
deploy_functions(
client=client,
settings=settings,
env_name="my_env",
force=False,
)
deploy_instance_workflows()
Deploy instance validation workflows:
from cognite_data_quality import deploy_instance_workflows, load_view_configs
view_configs = load_view_configs("config/environments/my_env/views")
deploy_instance_workflows(
client=client,
view_configs=view_configs,
settings=settings,
env_name="my_env",
skip_trigger=False,
)
deploy_timeseries_workflows()
Deploy time series validation workflows (scheduled WorkflowScheduledTriggerRule per config schedule.cron):
from cognite_data_quality import deploy_timeseries_workflows, load_timeseries_configs
ts_configs = load_timeseries_configs("config/environments/my_env/timeseries")
deploy_timeseries_workflows(
client=client,
settings=settings,
configs=ts_configs,
shacl_dir=Path("config/environments/my_env/shacl_rules"), # None in Data Product mode
dp_version="1.0.0", # optional; written as [dp:{version}] workflow tag
)
When configs use shacl_rules.ruleset_references, the task payload passes RuleSet refs to the handler (no CDF File upload). rule_set_id / rule_set_version in records_config default to the RuleSet external ID and Data Product semver when driven by Data Product context.
In Data Product mode, publish is idempotent and may reuse an existing version when payload is unchanged. Always treat the returned/resolved RuleSet/DataProduct version as source of truth for downstream references.
deploy_data_models()
Deploy data models (optional):
from cognite_data_quality import deploy_data_models, DataModelId
data_models = [
DataModelId(space="my_space", external_id="MyDataModel", version="v1"),
]
deploy_data_models(
client=client,
data_models=data_models,
source_dir="data_models",
)
Configuration Loaders
load_settings()
Load environment settings from YAML:
from cognite_data_quality import load_settings, DeploymentSettings
settings: DeploymentSettings = load_settings("config/environments/my_env/settings.yaml")
load_view_configs()
Load instance validation configurations:
from cognite_data_quality import load_view_configs
configs = load_view_configs("config/environments/my_env/views")
# Returns: dict[str, ViewConfig]
load_timeseries_configs()
Load time series validation configurations:
from cognite_data_quality import load_timeseries_configs
configs = load_timeseries_configs("config/environments/my_env/timeseries")
# Returns: list[TimeseriesConfig] — supports dataproducts: and ruleset_references
load_views_from_cdf()
Load views directly from CDF DMS:
from cognite_data_quality import load_views_from_cdf
views = load_views_from_cdf(
client=client,
space="my_space",
data_model_external_id="MyDataModel",
version="v1",
)
Data Classes
DeploymentSettings
Environment-specific deployment settings loaded from settings.yaml.
DataModelId
Identifier for a CDF data model:
from cognite_data_quality import DataModelId
dm_id = DataModelId(
space="my_space",
external_id="MyDataModel",
version="v1",
)
Module Reference
cognite_data_quality.deploy
CredentialConfig
DataProductRef
Bases: BaseModel
Reference to a CDF DataProduct + version that a view belongs to.
Used inside :attr:ViewConfig.dataproducts to declare which DataProducts
should include this view when config_source: "dataproduct" is active.
Attributes:
| Name | Type | Description |
|---|---|---|
external_id |
str
|
External ID of the DataProduct. |
version |
str
|
Semantic version string of the DataProduct version to publish.
Default: |
schema_space |
str | None
|
DMS space for the DataProduct's |
datamodel_external_id |
str | None
|
Deprecated — the DataProducts API no longer
uses a |
Source code in cognite_data_quality/deploy.py
DeploymentSettings
Bases: BaseModel
Top-level deployment settings loaded from settings.yaml.
Attributes:
| Name | Type | Description |
|---|---|---|
function |
FunctionSettings | None
|
Cognite Function settings. Auto-populated with defaults if omitted from the YAML file. |
workflow |
WorkflowSettings
|
Workflow settings for instance validation workflows. |
timeseries_workflow |
WorkflowSettings | None
|
Separate workflow settings for time series
workflows. Falls back to workflow when |
trigger |
TriggerSettings
|
Data-change trigger settings for instance validation. |
records |
RecordsSettings
|
Default Records API coordinates (space, container, stream). |
shacl_rules |
ShaclRulesSettings | None
|
Location settings for SHACL rule files. |
timeseries |
TimeSeriesSettings | None
|
Time series config directory settings. |
rule_engine_result_sync |
RuleEngineResultSyncSettings | None
|
RuleEngineResult listener config directory
settings. |
partition_retries |
int
|
Maximum partition retry attempts managed by the orchestrator function (no CDF API limit). Default: 3. |
function_code_dataset_external_id |
str | None
|
Dataset for function code zip uploads. Required when CDF enforces dataset-scoped file access. |
config_source |
Literal['yaml', 'dataproduct']
|
Where view configs are sourced from. |
external_dataproducts |
list[ExternalDataProductRef]
|
Pre-existing DataProducts in CDF (created by others) to deploy validation workflows for. No local view configs or TTL files are needed — the deploy function fetches the DataProduct from CDF and deploys workflows directly. |
config_space |
str | None
|
DMS space for state and settings containers
( |
Source code in cognite_data_quality/deploy.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | |
effective_config_space
property
Space for state/settings containers. Falls back to records.space if config_space is unset.
model_post_init(__context)
Ensure function settings are populated with defaults if not provided.
Source code in cognite_data_quality/deploy.py
ExternalDataProductRef
Bases: BaseModel
Reference to a pre-existing DataProduct in CDF to deploy workflows for.
Used inside :attr:DeploymentSettings.external_dataproducts to declare
DataProducts that are owned by others (already published to the DataProduct
and RuleSet APIs). The deploy function fetches the DataProduct from CDF,
builds :class:ViewConfig objects from it, and deploys instance validation
workflows — no local YAML view configs or TTL files are required.
Attributes:
| Name | Type | Description |
|---|---|---|
external_id |
str
|
External ID of the DataProduct. |
version |
str
|
Semantic version string, or |
Source code in cognite_data_quality/deploy.py
FunctionSettings
Bases: BaseModel
Cognite Function settings.
Attributes:
| Name | Type | Description |
|---|---|---|
external_id |
str
|
CDF external ID for the function. Default: |
name |
str
|
Display name shown in CDF Console. Default: |
description |
str
|
Short description stored on the function resource. |
runtime |
str
|
Python runtime version string (e.g. |
source_dir |
str
|
Local directory name used as the function root inside the zip archive. |
include_files |
list[str]
|
List of paths (relative to source_dir) to bundle. |
Source code in cognite_data_quality/deploy.py
RawTableConfig
Bases: BaseModel
Full configuration for one RAW table validation deployment.
Attributes:
| Name | Type | Description |
|---|---|---|
table |
RawTableRef
|
Reference to the CDF RAW database and table. |
shacl_rules |
ShaclRulesRef
|
SHACL rules file reference. |
validation |
ValidationSettings
|
Validation behaviour settings. |
records |
RecordsOverrides
|
Per-table Records API overrides. |
partition_count |
int
|
Number of partitions for historic cursor-based validation. Default: 5. |
Source code in cognite_data_quality/deploy.py
RawTableRef
Bases: BaseModel
Reference to a CDF RAW table.
Attributes:
| Name | Type | Description |
|---|---|---|
database |
str
|
CDF RAW database name. |
name |
str
|
CDF RAW table name within the database. |
Source code in cognite_data_quality/deploy.py
RecordsOverrides
Bases: BaseModel
Per-view overrides for Records API coordinates.
All fields are optional; unset fields inherit the global
:class:RecordsSettings values.
Attributes:
| Name | Type | Description |
|---|---|---|
rule_set_id |
str | None
|
Override the rule set ID written to each record. |
rule_set_version |
str | None
|
Override the rule set version written to each record. |
data_domain_external_id |
str | None
|
External ID of the data domain attached to each record. |
use_instance_space |
bool
|
If |
records_space |
str | None
|
Explicit destination space for records. Only used
when use_instance_space is |
Source code in cognite_data_quality/deploy.py
RecordsSettings
Bases: BaseModel
Default Records API coordinates used by all deployed workflows.
The rule engine output container co-locates with the validation container in space — there is intentionally no separate space field.
Attributes:
| Name | Type | Description |
|---|---|---|
space |
str
|
CDF DMS space that hosts BOTH the validation records
container and the rule engine results container.
Default: |
container |
str
|
External ID of the DMS container that stores validation
records. Default: |
stream_id |
str
|
External ID of the Records API stream for ingestion.
Default: |
rule_engine_container |
str
|
External ID of the DMS container that stores
SHACL-AF rule engine output records (JSON inference payloads).
Default: |
rule_engine_stream_id |
str | None
|
Optional separate Records API stream for rule
engine outputs. When |
Source code in cognite_data_quality/deploy.py
RuleEngineResultSyncConfig
Bases: BaseModel
Configuration for one RuleEngineResult incremental listener workflow.
Source code in cognite_data_quality/deploy.py
RuleEngineResultSyncFilter
Bases: BaseModel
Filter contract for incremental RuleEngineResult consumption.
Source code in cognite_data_quality/deploy.py
RuleEngineResultSyncSettings
RuntimeCredentialsSettings
Bases: BaseModel
Optional credential groups for runtime resources.
Source code in cognite_data_quality/deploy.py
ScheduleConfig
Bases: BaseModel
Cron-based schedule for time series validation workflows.
Attributes:
| Name | Type | Description |
|---|---|---|
cron |
str
|
Cron expression controlling when the workflow runs.
Default: |
Source code in cognite_data_quality/deploy.py
ShaclRulesRef
Bases: BaseModel
Reference to SHACL rules -- either a local file or RuleSet API references.
Attributes:
| Name | Type | Description |
|---|---|---|
file |
str | None
|
Filename (relative to the SHACL source directory) of the
|
external_id |
str | None
|
CDF Files external ID under which the rules file is uploaded and later retrieved by the validation function. Required when using file-based rules. |
ruleset_references |
list[dict] | None
|
List of |
Source code in cognite_data_quality/deploy.py
ShaclRulesSettings
Bases: BaseModel
Location settings for SHACL .ttl rule files.
Attributes:
| Name | Type | Description |
|---|---|---|
source_dir |
str
|
Path (relative to |
mime_type |
str
|
MIME type used when uploading rule files to CDF Files.
Default: |
dataset_external_id |
str | None
|
External ID of the CDF dataset to associate
uploaded rule files with. |
Source code in cognite_data_quality/deploy.py
TimeSeriesSettings
TimeseriesConfig
Bases: BaseModel
Full configuration for one time series validation workflow.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Unique name for this configuration; used as the workflow external ID suffix and display name. |
description |
str | None
|
Optional human-readable description stored on the workflow resource. |
filter |
TimeseriesFilter | None
|
Server-side DMS filter for selecting time series instances. Mutually exclusive with instance_ids. |
instance_ids |
list[TimeseriesInstanceId] | None
|
Explicit list of time series instances to validate. Mutually exclusive with filter. |
shacl_rules |
ShaclRulesRef
|
SHACL rules file reference. |
datamodel |
ViewRef
|
Data model containing the time series view definition. |
validation |
ValidationSettings
|
Validation behaviour settings. |
records |
RecordsOverrides
|
Per-config Records API overrides. |
schedule: Cron schedule for the validation trigger (WorkflowScheduledTriggerRule,
same pattern as other scheduled DQ workflows).
backfill: Optional backfill configuration dict with keys
enabled, start_time, end_time, and
window_minutes.
dataproducts: DataProducts this timeseries config belongs to when
config_source: "dataproduct" is active.
Source code in cognite_data_quality/deploy.py
TimeseriesFilter
Bases: BaseModel
Server-side filter for selecting time series instances to validate.
Attributes:
| Name | Type | Description |
|---|---|---|
space |
str | None
|
Restrict to instances in this CDF space. |
external_id_prefix |
str | None
|
Restrict to instances whose external ID starts with this prefix. |
Source code in cognite_data_quality/deploy.py
TimeseriesInstanceId
Bases: BaseModel
Explicit instance reference for a single time series to validate.
Attributes:
| Name | Type | Description |
|---|---|---|
space |
str
|
CDF space containing the instance. |
external_id |
str
|
External ID of the time series instance. |
Source code in cognite_data_quality/deploy.py
TriggerSettings
Bases: BaseModel
Settings for data-change triggers on instance validation workflows.
Attributes:
| Name | Type | Description |
|---|---|---|
external_id_prefix |
str
|
Prefix used when constructing per-view trigger external IDs. |
batch_size |
int
|
Maximum number of instances per trigger payload. Default: 10. |
batch_timeout |
int
|
Seconds to wait before flushing a partial batch. Default: 60. |
Source code in cognite_data_quality/deploy.py
ValidationLockSettings
Bases: BaseModel
Per-view sync execution lease tuning (escape hatch via enabled=False).
Source code in cognite_data_quality/deploy.py
ValidationSettings
Bases: BaseModel
Per-view validation behaviour settings.
Attributes:
| Name | Type | Description |
|---|---|---|
auto_load_depth |
int
|
Number of levels of referenced instances to auto-load before validation (0-3). Higher values increase coverage but reduce speed. Default: 2. |
verbose |
bool
|
Enable verbose logging inside the validation function.
Default: |
Source code in cognite_data_quality/deploy.py
ViewConfig
Bases: BaseModel
Full configuration for one instance-validation view.
Attributes:
| Name | Type | Description |
|---|---|---|
view |
ViewRef
|
Reference to the CDF view whose instances are validated. |
instance_spaces |
list[str]
|
CDF spaces that contain the instances to validate. Accepts a single string (coerced to a list) or a list. |
shacl_rules |
ShaclRulesRef | None
|
SHACL rules file reference. |
validation |
ValidationSettings
|
Validation behaviour settings (depth, verbosity). |
records |
RecordsOverrides
|
Per-view Records API overrides. |
workflow_external_id |
str | None
|
Explicit CDF workflow external ID. If |
trigger_external_id |
str | None
|
Explicit trigger external ID. Auto-derived
when |
partition_count |
int
|
Number of partitions for batch historic validation. Default: 10. |
partition_field |
str
|
DMS property used to range-partition instances
(e.g. |
chunk_size |
int
|
Instances validated per function invocation. Default: 200. |
sync_batch_size |
int | None
|
Overrides :attr: |
use_sync_cursor_mode |
bool
|
Use cursor-based sync instead of passing
instances in the trigger payload. Requires
|
max_concurrent_executions |
int | None
|
Maximum simultaneous CDF workflow executions. Default: 10. |
historic_reprocess_on_update |
bool
|
Controls whether this view is
auto-enqueued for historic processing when DataProduct/ruleset
versions are updated by |
Source code in cognite_data_quality/deploy.py
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | |
coerce_to_list(v)
classmethod
Coerce a bare string to a single-element list.
Source code in cognite_data_quality/deploy.py
normalise_instance_space(data)
classmethod
Accept both instance_space (str) and instance_spaces (list) from YAML.
Source code in cognite_data_quality/deploy.py
ViewRef
Bases: BaseModel
Reference to a CDF Data Model view.
Attributes:
| Name | Type | Description |
|---|---|---|
space |
str
|
CDF space that contains the view. |
external_id |
str
|
External ID of the view. |
version |
str
|
Version string of the view. |
Source code in cognite_data_quality/deploy.py
WorkflowSettings
Bases: BaseModel
Top-level settings for a CDF Workflow resource.
Attributes:
| Name | Type | Description |
|---|---|---|
external_id_prefix |
str
|
Prefix used when constructing per-view workflow
external IDs (e.g. |
version |
str
|
Workflow version string. Default: |
task |
WorkflowTaskSettings
|
Per-task retry/timeout settings. |
consolidate_per_dataproduct |
bool
|
When True, deploy one instance workflow per DataProduct (dataproduct mode only). |
Source code in cognite_data_quality/deploy.py
WorkflowTaskSettings
Bases: BaseModel
Retry and timeout settings applied to each CDF workflow task.
Attributes:
| Name | Type | Description |
|---|---|---|
retries |
int
|
Number of task-level retries (CDF API limit: 0-10). Default: 3. |
timeout |
int
|
Task timeout in seconds. Default: 600. |
on_failure |
str
|
Behaviour on unrecoverable failure — |
Source code in cognite_data_quality/deploy.py
deploy_data_models(*, client, space='dataQuality', containers=None, data_model_id='DataQualityMonitoring', data_model_version='1', dry_run=False)
Deploy data models with auto-generated views from containers.
Creates views from existing DMS containers, making container data accessible through the CDF Data Modeling UI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
CogniteClient
|
CogniteClient instance |
required |
space
|
str
|
Space containing containers (default: "dataQuality") |
'dataQuality'
|
containers
|
list[str] | None
|
List of container IDs to create views for (default: ["OrchestrationState", "FunctionValidationState"]) |
None
|
data_model_id
|
str
|
External ID for the data model |
'DataQualityMonitoring'
|
data_model_version
|
str
|
Version string |
'1'
|
dry_run
|
bool
|
Preview without deploying |
False
|
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
dict with deployment results (datamodel, views, status) |
Example
from cognite_data_quality import deploy_data_models from cognite.client import CogniteClient client = CogniteClient() result = deploy_data_models(client=client, dry_run=False) print(f"Created {len(result['views'])} views")
Source code in cognite_data_quality/deploy.py
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 | |
deploy_functions(*, client, settings, force=False, dry_run=False, debug_save_zip=None, secrets=None)
Deploy the unified SHACL validation function using embedded code.
Uses content hashing to skip redeployment when the function code is unchanged (hash stored in function metadata).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
CogniteClient
|
Cognite client for CDF API access. |
required |
settings
|
DeploymentSettings
|
Deployment settings containing function external ID, runtime, and file list. |
required |
force
|
bool
|
Force redeployment even if the function code hash matches the currently deployed function. |
False
|
dry_run
|
bool
|
Preview changes without deploying. |
False
|
debug_save_zip
|
Path | str | None
|
Directory path to save the function zip archive
for inspection (e.g. |
None
|
secrets
|
dict[str, str] | None
|
Function secrets passed at creation time, e.g.
|
None
|
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, str]]
|
dict with key |
dict[str, dict[str, str]]
|
containing |
dict[str, dict[str, str]]
|
(one of |
Source code in cognite_data_quality/deploy.py
deploy_incremental(*, view_config_path, config_env=None, force=False, dry_run=False, client=None)
Deploy function, workflow, and trigger for a single view config.
Loads deployment settings from the repository's scripts/ directory
via shared.load_settings and deploys the validation pipeline for
one view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
view_config_path
|
Path | str
|
Path to the view YAML config file. |
required |
config_env
|
str | None
|
Environment name (e.g. |
None
|
force
|
bool
|
Force redeployment even if content hashes are unchanged. |
False
|
dry_run
|
bool
|
Preview without making any CDF API calls. |
False
|
client
|
CogniteClient | None
|
Cognite client. Created from environment variables if
|
None
|
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
dict with keys |
Source code in cognite_data_quality/deploy.py
2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 | |
deploy_raw_table_shacl(*, client, settings, tables, shacl_dir, dry_run=False)
Deploy SHACL rules for RAW table validation.
For RAW tables, we only upload SHACL files - no workflows or triggers are created. RAW validation is triggered explicitly via function calls.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
CogniteClient
|
CogniteClient instance |
required |
settings
|
DeploymentSettings
|
Deployment settings with records configuration |
required |
tables
|
list[RawTableConfig]
|
List of RAW table configs |
required |
shacl_dir
|
Path
|
Directory containing SHACL rule files |
required |
dry_run
|
bool
|
Preview without uploading |
False
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
list of deployment results for each table |
Source code in cognite_data_quality/deploy.py
deploy_rule_engine_result_sync_workflows(*, client, settings, configs, force=False, dry_run=False, config_filter=None, secrets=None)
Deploy scheduled workflows for incremental RuleEngineResult listeners.
Source code in cognite_data_quality/deploy.py
deploy_timeseries_workflows(*, client, settings, configs, shacl_dir, force=False, dry_run=False, config_filter=None, skip_unchanged=True, dp_version=None, secrets=None)
Deploy scheduled workflows and triggers for time series validation.
Source code in cognite_data_quality/deploy.py
deploy_validation_infrastructure(*, client, settings_path, views_dir=None, filter_views_by_shacl_rules=False, timeseries_dir=None, rule_engine_result_sync_dir=None, shacl_rules_dir=None, function_external_id=None, function_secrets=None, force=False, force_function=False, force_workflows=False, dry_run=False, debug_save_zip=None, deploy_data_product_sync=False, data_product_sync_cron='0 * * * *', historic_queue_manager_cron='*/5 * * * *')
Deploy functions, workflows, and triggers using embedded function code.
View configs are loaded from views/*.yaml files in the settings
directory. When settings.config_source is "dataproduct", the
SHACL .ttl files are published to the RuleSet API and view configs
are published to the DataProduct API instead of being uploaded as CDF
Files. When config_source is "yaml" (default), SHACL and view
configs are uploaded as CDF Files as usual.
When filter_views_by_shacl_rules is True, only views referenced
via sh:targetClass in their SHACL rules are deployed.
This function also ensures all required DMS containers exist in CDF before deploying.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
CogniteClient
|
Cognite client for CDF API access. |
required |
settings_path
|
Path | str
|
Path to the |
required |
views_dir
|
Path | str | None
|
Directory containing view YAML configs. Defaults to
|
None
|
filter_views_by_shacl_rules
|
bool
|
If |
False
|
timeseries_dir
|
Path | str | None
|
Directory containing time series validation YAML
configs. Defaults to |
None
|
rule_engine_result_sync_dir
|
Path | str | None
|
Directory containing incremental
RuleEngineResult listener YAML configs. Defaults to
|
None
|
shacl_rules_dir
|
Path | str | None
|
Directory containing SHACL |
None
|
function_external_id
|
str | None
|
Override for the deployed function external ID.
Defaults to |
None
|
function_secrets
|
dict[str, str] | None
|
Secrets to inject into the function at creation
time, e.g. |
None
|
force
|
bool
|
Force redeployment of both functions and workflows even when content hashes are unchanged. |
False
|
force_function
|
bool
|
Force redeployment of the function only; workflows are still skipped if their hashes are unchanged. |
False
|
force_workflows
|
bool
|
Force redeployment of workflows only; the function is still skipped if its hash is unchanged. |
False
|
dry_run
|
bool
|
Preview all changes without making any CDF API calls. |
False
|
debug_save_zip
|
Path | str | None
|
Directory path to save each function zip archive for
inspection (e.g. |
None
|
deploy_data_product_sync
|
bool
|
Deploy a scheduled workflow that discovers all DataProducts with quality rules and auto-deploys validation workflows for them. |
False
|
data_product_sync_cron
|
str
|
Cron expression for the data product
sync trigger. Default: |
'0 * * * *'
|
historic_queue_manager_cron
|
str
|
Cron expression for the historic
queue manager trigger. Default: |
'*/5 * * * *'
|
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
dict with keys |
dict[str, object]
|
|
dict[str, object]
|
|
dict[str, object]
|
containing a list of per-item deployment result dicts with at |
dict[str, object]
|
minimum |
dict[str, object]
|
( |
Source code in cognite_data_quality/deploy.py
1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 | |
load_rule_engine_result_sync_configs(path)
Load RuleEngineResult sync listener configs from a directory.
Source code in cognite_data_quality/deploy.py
load_settings(path)
Load deployment settings from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Path to the |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Parsed |
DeploymentSettings
|
class: |
Source code in cognite_data_quality/deploy.py
load_table_configs(path)
Load RAW table validation configs from a directory.
Reads all *.yaml files in path and parses them as
:class:RawTableConfig objects. Returns an empty list if the
directory does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Directory containing RAW table YAML config files. |
required |
Returns:
| Type | Description |
|---|---|
list[RawTableConfig]
|
List of :class: |
list[RawTableConfig]
|
Empty list if path does not exist. |
Source code in cognite_data_quality/deploy.py
load_timeseries_configs(path)
Load time series validation configs from a directory.
Reads all *.yaml files in path and parses them as
:class:TimeseriesConfig objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Directory containing time series YAML config files. |
required |
Returns:
| Type | Description |
|---|---|
list[TimeseriesConfig]
|
List of :class: |
Source code in cognite_data_quality/deploy.py
load_view_configs(path)
Load instance validation view configs from a directory.
Reads all *.yaml files in path and parses them as
:class:ViewConfig objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Directory containing view YAML config files. |
required |
Returns:
| Type | Description |
|---|---|
list[ViewConfig]
|
List of :class: |
Source code in cognite_data_quality/deploy.py
validate_per_view_sync_cursor_concurrency(view_config)
Enforce max_concurrent_executions=1 for YAML per-view sync-cursor deploy.