Skip to content

Commit

Permalink
Release 0.3.12 (#1224)
Browse files Browse the repository at this point in the history
# Description

Please describe the change you have made.

## Checklist

- [ ] Tests added/updated.
- [ ] Run Demo Job Locally.
- [ ] Documentation updated.
- [ ] Changelogs updated in
[CHANGELOG.cdf-tk.md](https://github.com/cognitedata/toolkit/blob/main/CHANGELOG.cdf-tk.md).
- [ ] Template changelogs updated in
[CHANGELOG.templates.md](https://github.com/cognitedata/toolkit/blob/main/CHANGELOG.templates.md).
- [ ] Version bumped.

[_version.py](https://github.com/cognitedata/toolkit/blob/main/cognite/cognite_toolkit/_version.py)
and

[pyproject.toml](https://github.com/cognitedata/toolkit/blob/main/pyproject.toml)
per [semantic versioning](https://semver.org/).
  • Loading branch information
doctrino authored Nov 21, 2024
2 parents 95502dc + d5bd15d commit 1e87120
Show file tree
Hide file tree
Showing 218 changed files with 2,156 additions and 2,488 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"args": [
"deploy",
"--dry-run",
"--verbose"
],
"console": "integratedTerminal",
"justMyCode": false
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.cdf-tk.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Changes are grouped as follows:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [0.3.12] - 2024-11-21

### Added

- [Alpha feature] Support for specifying list of variables under modules in `config.[env].yaml` file.
This allows you to reuse the same module with different variables.
- [Alpha feature] GraphQL now supports the `preserveDml` parameter.

## [0.3.11] - 2024-11-19

### Fixed
Expand All @@ -23,6 +31,7 @@ Changes are grouped as follows:
- In `cdf build` when loading `config.[env].yaml` the Toolkit now correctly prefers variables deeper, more
specific, in the hierarchy over more general variables.
- [Alpha feature] `cdf build` will no longer copy content `YAML` files to the build directory.
- A bug caused the comparison with existing Tranformation Notifications to fail. This is now fixed.

### Improved

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ Changes are grouped as follows:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [0.3.12] - 2024-11-21

### Added

- Added new modules `cdf_entity_matching` in the `contextualization` package. This contains a pipeline for
doing entity matching based on the Cognite Core model.

### Fixed

- Bug in extension models in the `models` package. The `through` field was not correctly set. In addition,
simplified the `CogniteCore` and `CogniteProcessIndustries` minimum extension models further. Finally, all
containers were duplicated. This has been fixed.
- Bug in `cdf_sap_assets` causing the asset transformation to fail to a READ access error.

## [0.3.11] - 2024-11-19

No changes to templates.
Expand Down
3 changes: 2 additions & 1 deletion cdf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require-kind = true
run-workflow = true
streamlit = true
force-update = true
module-repeat = true

[plugins]
run = true
Expand All @@ -19,4 +20,4 @@ dump = true
[modules]
# This is the version of the modules. It should not be changed manually.
# It will be updated by the 'cdf module upgrade' command.
version = "0.3.11"
version = "0.3.12"
2 changes: 1 addition & 1 deletion cognite_toolkit/_builtin_modules/cdf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_env = "<DEFAULT_ENV_PLACEHOLDER>"
[modules]
# This is the version of the modules. It should not be changed manually.
# It will be updated by the 'cdf module upgrade' command.
version = "0.3.11"
version = "0.3.12"


[plugins]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ capabilities:
- {{ schemaSpace }}
- {{ schemaSpace2 }}
- cdf_cdm_units
# Needed to write CogniteAsset.parent
- cdf_cdm
- annotationsAcl:
actions:
- READ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ingestionClientSecret: ${INGESTION_CLIENT_SECRET}

assetTransformationExternalId: sap_assets_springfield_s4hana
equipmentTransformationExternalId: sap_equipment_springfield_s4hana
assetToAssetTransformationExternalId: sap_asset_to_asset_springfield_s4hana
equipmentToAssetTransformationExternalId: sap_equipment_to_asset_springfield_s4hana
timeseriesTransformationExternalId: pi_timeseries_springfield_aveva_pi
maintenanceOrderTransformationExternalId: sap_maintenance_orders_springfield_s4hana
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ workflowDefinition:
externalId: {{ equipmentTransformationExternalId }}
concurrencyPolicy: fail
onFailure: abortWorkflow
- externalId: {{ assetToAssetTransformationExternalId}}
type: transformation
parameters:
transformation:
externalId: {{ assetToAssetTransformationExternalId}}
concurrencyPolicy: fail
onFailure: abortWorkflow
dependsOn:
- externalId: {{ assetTransformationExternalId}}
- externalId: {{ equipmentToAssetTransformationExternalId}}
type: transformation
parameters:
Expand Down Expand Up @@ -86,7 +77,6 @@ workflowDefinition:
- externalId: {{ assetTransformationExternalId }}
- externalId: {{ maintenanceOrderTransformationExternalId }}
- externalId: {{ operationTransformationExternalId }}
- externalId: {{ assetToAssetTransformationExternalId }}
- externalId: {{ operationToMaintenanceOrderTransformationExternalId }}
- externalId: {{ activityToEquipmentTransformationExternalId }}
type: transformation
Expand Down Expand Up @@ -123,7 +113,6 @@ workflowDefinition:
dependsOn:
- externalId: {{ timeseriesTransformationExternalId }}
- externalId: {{ assetTransformationExternalId }}
- externalId: {{ assetToAssetTransformationExternalId }}
- externalId: {{ timeSeriesToEquipmentTransformationExternalId }}
type: transformation
parameters:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: gp_workflow_{{ contextualizationId }}
sourceId: {{ groupSourceId }}
metadata:
origin: cognite-toolkit
capabilities:
# minimum runtime capabilities
- projectsAcl:
actions:
- READ
- LIST
scope:
all: {}
- groupsAcl:
actions:
- LIST
scope:
all: {}
- sessionsAcl:
actions:
- CREATE
scope:
all: {}
# query-specific capabilities
- dataModelInstancesAcl:
actions:
- READ
- WRITE
- WRITE_PROPERTIES
scope:
spaceIdScope:
spaceIds:
{{ instanceSpaces }}
- dataModelsAcl:
actions:
- READ
scope:
spaceIdScope:
spaceIds:
- {{ schemaSpace }}
- annotationsAcl:
actions:
- READ
- WRITE
- SUGGEST
- REVIEW
scope:
all: {}
- entitymatchingAcl:
actions:
- READ
- WRITE
scope:
all: {}
- extractionConfigsAcl:
actions:
- READ
scope:
datasetScope:
ids:
- {{ dataset }}
- extractionRunsAcl:
actions:
- READ
- WRITE
scope:
datasetScope:
ids:
- {{ dataset }}
- rawAcl:
actions:
- READ
- WRITE
scope:
tableScope:
dbsToTables:
{{ rawStateDatabase }}: {}
# Needed to call functions
- functionsAcl:
actions:
- READ
- WRITE
scope:
all: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
space: {{ annotationSpace }}
description: 'Space for storing annotations'
name: '{{ annotationSpace }}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
space: {{ annotationSpace }}
externalId: "entity.match"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
space: {{ annotationSpace }}
externalId: {{ contextualizationId }}
sources:
- source:
type: view
space: cdf_cdm
externalId: CogniteSourceSystem
version: v1
properties:
name: '{{ contextualizationName }}'
description: 'Creates Entity Matching annotations which are used to connect nodes.'
version: "v1"
manufacturer: "Cognite"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: {{ contextualizationName }}
externalId: {{ dataset }}
description: {{ contextualizationName }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
contextualizationId: entity_matcher
contextualizationName: Entity Matcher
annotatorJob: ctx_entity_matching
directRelationJob: ctx_files_direct_relation_write
dataset: ingestion
rawStateDatabase: contextualizationState
rawStateTable: entityMatching
schemaSpace: cdf_cdm
annotationSpace: springfield_instances
instanceSpaces:
- springfield_instances

groupSourceId: <not set>
workflow: entity_matching
workflowClientId: ${IDP_WF_CLIENT_ID}
workflowClientSecret: ${IDP_WF_CLIENT_SECRET}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
externalId: '{{ directRelationJob }}'
name: 'Direct Relation Writer'
dataSetExternalId: {{ dataset }}
description: Writes direct relations based on annotations.
documentation: >
# Direct Relation Writer
This extraction pipeline is responsible for writing the direct relations into
a data model based on annotations.
## Annotations
Annotations are found based on three criteria:
1. It has to have data in the (`cdf_cdm", "CogniteAnnotation`, `v1`) view.
2. It is stored in the space configured in the `annotationSpace`.
3. It has to have a `sourceContext` that contains the views of the start and end nodes of the relations.
```json
{"start" : {
"space": "cdf_cdm",
"externalId": "CogniteFile",
"version": "v1"
},
"end" : {
"space": "cdf_cdm",
"externalId": "CogniteAsset",
"version": "v1"
}}
```
## Configuration
The configuration of the direct relation writer:
```yaml
state: # The Annotation writer uses the instances/sync endpoint to fetch annotations.
# The state stores the last cursor.
rawDatabase: <>
rawTable: <>
data:
annotationSpace: <> # The space the edges for the annotations are stored.
directRelationMapping: # How to go from Annotation to DirectRelation
- startNodeView: # The view of the start node.
space: <> .
externalId: <>
version: <>
directRelationProperty: <> # The property that contains the direct relation.
# Must be set either on the start or end node.
endNodeView: # The view of the end node.
space: <>
externalId: <>
version: <>
# directRelationProperty: <> # Must be set either on the start or end node.
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
externalId: '{{ directRelationJob }}'
config:
state:
rawDatabase: {{ rawStateDatabase }}
rawTable: {{ rawStateTable }}
data:
annotationSpace: '{{ annotationSpace }}'
directRelationMappings:
- startNodeView:
space: {{ schemaSpace }}
externalId: CogniteTimeSeries
version: v1
directRelationProperty: equipment
endNodeView:
space: {{ schemaSpace }}
externalId: CogniteEquipment
version: v1
- startNodeView:
space: {{ schemaSpace }}
externalId: CogniteTimeSeries
version: v1
directRelationProperty: assets
endNodeView:
space: {{ schemaSpace }}
externalId: CogniteAsset
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
externalId: '{{ annotatorJob }}'
name: 'Entity Matcher'
dataSetExternalId: {{ dataset }}
description: "Matches entities based on their properties"
documentation: >
# Entity Matcher
This extraction pipeline is responsible for matching entities based on their properties.
This means it looks for, for example, how to match time series to assets, or time series
to equipment, based on the properties of these. This is useful when you have data from different
sources and you only have partially the same information.
## Configuration
```yaml
parameters:
autoApprovalThreshold: # Automatically set the annotation as approved if the confidence is above this threshold
autoRejectThreshold: # Automatically reject the annotation if the confidence is below this threshold
featureType: "bigram" # The type of features to use for the matching.
# "simple" "insensitive" "bigram" "frequencyweightedbigram" "bigramextratokenizers" "bigramcombo"
sourceSystem: # The source system of the annotations written by this pipeline
space: <>
externalId: <>
state: # The entity matcher uses the instances/sync endpoint to fetch sources entities,i.e, ensuring they are only used once.
rawDatabase: <>
rawTable: <>
data:
annotationSpace: # The space to write the annotations to
instanceSpaces:
- # The space to fetch entities such as Assets, Equipment, etc. from
- # Another space to fetch entities from
matchingJobs:
jobName:
sourceView:
space: <>
externalId: <>
version: <>
properties: # The properties to use for the matching
- propertyA
- propertyB
targetViews:
- space: <>
externalId: <>
version: <>
properties: # The properties to use for the matching
- propertyA
- propertyB
```
Loading

0 comments on commit 1e87120

Please sign in to comment.