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 uniqueness cron trigger per view where SHACL declares uniqueness constraints. View-specific instance sync configuration is passed via DMS sync trigger input (created by the historic orchestrator) 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 workflows only (no DMS sync triggers). The historic orchestrator creates per-view DMS sync triggers in no_backfill mode after timestamp collection. On DataProduct/ruleset version change, data_product_sync also enqueues per-view historic jobs via HistoricJobQueue; historic_queue_manager processes them sequentially. For ad-hoc re-runs, use deploy_validation_pipeline().
Consolidated deploy is always on in dataproduct mode. Per-view legacy workflows are not deployed.
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,
)
When settings.external_dataproducts is configured, the return value includes external_dataproduct_workflows: one entry per referenced DataProduct. Each entry keeps the integer views count and adds view_deployments, a per-view list for CI and automation:
status |
Meaning |
|---|---|
created |
First time this view is deployed by DQ (no ViewConfigState node existed before deploy). |
updated |
View was already deployed; configuration or rules changed in this run. |
skipped |
View was already deployed and unchanged, even if the parent DataProduct workflow was redeployed. |
Each item is {"space": "<view schema space>", "externalId": "<view external id>", "status": "created"|"updated"|"skipped"}. The same list appears on each consolidated workflow under workflows[].view_deployments. Use created (plus your own checks) to trigger first-time historic validation instead of inferring from missing per-view workflows. Always key consumers on (space, externalId) — the same external id in two schema spaces is two distinct views.
updated vs skipped compares the current per-view config hash to deployed_config_hash stored on the ViewConfigState DMS node after each external DataProduct deploy (covers SHACL/rules changes). Nodes created before this field existed fall back to comparing stored operational settings until the next deploy writes a hash.
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, ...
# historic_mode="enqueue" returns dict with mode, total_enqueued, total_skipped, warnings, ...
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 matching RuleSet externalId when SHACL targets the view class (fallback: view externalId) and the RuleSet reference version from ruleset_references 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
AtlasRuleAuthoringSettings
Bases: BaseModel
Optional Atlas AI rule-authoring agent/skill deploy (package wheel definitions).
Source code in cognite_data_quality/deploy.py
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 |
allow_existing_schema_space |
bool
|
When |
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['dataproduct']
|
Must be |
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
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 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | |
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.
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 |
stream_type |
str
|
CDF Records API stream template name used when creating
the stream (e.g. |
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
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | |
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. |
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
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 | |
deploy_functions(*, client, settings, force=False, dry_run=False, debug_save_zip=None, secrets=None, bundle_local_wheel=False)
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
|
bundle_local_wheel
|
bool
|
Build |
False
|
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
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 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 | |
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
2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 | |
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, bundle_local_wheel=False, deploy_data_product_sync=True, data_product_sync_cron='0 * * * *', historic_queue_manager_cron='*/5 * * * *', deploy_atlas_rule_authoring=None)
Deploy functions, workflows, and triggers using embedded function code.
View configs are loaded from views/*.yaml files in the settings
directory. SHACL .ttl files are published to the RuleSet API and view
configs are published to the DataProduct API (or consumed via
external_dataproducts). Instance workflow deployment is deferred to
data_product_sync or handled immediately for external_dataproducts.
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
|
bundle_local_wheel
|
bool
|
Bundle a wheel built from the local checkout in
the function zip (see :func: |
False
|
deploy_data_product_sync
|
bool
|
Deploy a scheduled workflow that discovers all DataProducts with quality rules and auto-deploys validation workflows for them. |
True
|
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 * * * *'
|
deploy_atlas_rule_authoring
|
bool | None
|
When |
None
|
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
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 2281 2282 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 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 | |
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.