cognite-toolkit 0.7.22__py3-none-any.whl → 0.7.23__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.
@@ -1,19 +1,20 @@
1
- import re
2
1
  from typing import Literal
3
2
 
4
- from pydantic import Field, field_validator
3
+ from pydantic import Field
5
4
 
6
- from cognite_toolkit._cdf_tk.utils import humanize_collection
5
+ from cognite_toolkit._cdf_tk.constants import INSTANCE_EXTERNAL_ID_PATTERN
7
6
 
8
7
  from .base import ToolkitResource
9
8
  from .view_field_definitions import ViewReference
10
9
 
11
- JSON_PATH_PATTERN = re.compile(
12
- r"^([a-zA-Z_][a-zA-Z0-9_]*|\[\d+\])(\.[a-zA-Z_][a-zA-Z0-9_]*|\[\d+\]|\[\'[^\']*\'\]|\[\"[^\"]*\"\])*$"
13
- )
14
-
15
10
 
16
11
  class ResourceViewMappingYAML(ToolkitResource):
12
+ external_id: str = Field(
13
+ description="External-id of the mapping.",
14
+ min_length=1,
15
+ max_length=256,
16
+ pattern=INSTANCE_EXTERNAL_ID_PATTERN,
17
+ )
17
18
  resource_type: Literal["asset", "event", "file", "timeSeries", "sequence", "assetAnnotation", "fileAnnotation"] = (
18
19
  Field(
19
20
  description="The type of the resource to map to the view.",
@@ -25,13 +26,3 @@ class ResourceViewMappingYAML(ToolkitResource):
25
26
  property_mapping: dict[str, str] = Field(
26
27
  description="A dictionary mapping from resource property to view property.",
27
28
  )
28
-
29
- @field_validator("property_mapping")
30
- @classmethod
31
- def validate_json_paths(cls, value: dict[str, str]) -> dict[str, str]:
32
- if not isinstance(value, dict):
33
- return value
34
- not_matching_keys = [k for k in value.keys() if not re.match(JSON_PATH_PATTERN, k)]
35
- if not_matching_keys:
36
- raise ValueError(f"Invalid JSON paths: {humanize_collection(not_matching_keys)}")
37
- return value
@@ -12,7 +12,7 @@ jobs:
12
12
  environment: dev
13
13
  name: Deploy
14
14
  container:
15
- image: cognite/toolkit:0.7.22
15
+ image: cognite/toolkit:0.7.23
16
16
  env:
17
17
  CDF_CLUSTER: ${{ vars.CDF_CLUSTER }}
18
18
  CDF_PROJECT: ${{ vars.CDF_PROJECT }}
@@ -10,7 +10,7 @@ jobs:
10
10
  environment: dev
11
11
  name: Deploy Dry Run
12
12
  container:
13
- image: cognite/toolkit:0.7.22
13
+ image: cognite/toolkit:0.7.23
14
14
  env:
15
15
  CDF_CLUSTER: ${{ vars.CDF_CLUSTER }}
16
16
  CDF_PROJECT: ${{ vars.CDF_PROJECT }}
@@ -4,7 +4,7 @@ default_env = "<DEFAULT_ENV_PLACEHOLDER>"
4
4
  [modules]
5
5
  # This is the version of the modules. It should not be changed manually.
6
6
  # It will be updated by the 'cdf modules upgrade' command.
7
- version = "0.7.22"
7
+ version = "0.7.23"
8
8
 
9
9
 
10
10
  [plugins]
@@ -1 +1 @@
1
- __version__ = "0.7.22"
1
+ __version__ = "0.7.23"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite_toolkit
3
- Version: 0.7.22
3
+ Version: 0.7.23
4
4
  Summary: Official Cognite Data Fusion tool for project templates and configuration deployment
5
5
  Project-URL: Homepage, https://docs.cognite.com/cdf/deploy/cdf_toolkit/
6
6
  Project-URL: Changelog, https://github.com/cognitedata/toolkit/releases
@@ -1,6 +1,6 @@
1
1
  cognite_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  cognite_toolkit/_cdf.py,sha256=sefGD2JQuOTBZhEqSj_ECbNZ7nTRN4AwGwX1pSUhoow,5636
3
- cognite_toolkit/_version.py,sha256=05OpHzT8pDPhLRXPkdqyUUquJk9jolNT5B2C6ovgfac,23
3
+ cognite_toolkit/_version.py,sha256=JGnAqfJascCxCeW2HUmSEq-6cTv1v4JA85VtarqlsUk,23
4
4
  cognite_toolkit/config.dev.yaml,sha256=M33FiIKdS3XKif-9vXniQ444GTZ-bLXV8aFH86u9iUQ,332
5
5
  cognite_toolkit/_cdf_tk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  cognite_toolkit/_cdf_tk/cdf_toml.py,sha256=VSWV9h44HusWIaKpWgjrOMrc3hDoPTTXBXlp6-NOrIM,9079
@@ -216,7 +216,7 @@ cognite_toolkit/_cdf_tk/resource_classes/infield_v1.py,sha256=XtstgUuhYhWgsxSoQ9
216
216
  cognite_toolkit/_cdf_tk/resource_classes/instance.py,sha256=FdPCDz4LlKZ2SDBGH2-z-JiPN0V53Gg3FrxxjcjrJZc,2935
217
217
  cognite_toolkit/_cdf_tk/resource_classes/labels.py,sha256=rh4SV_MBEiS9cjpz1g4_0SAnKGwiIepThD_wR1_bMkY,649
218
218
  cognite_toolkit/_cdf_tk/resource_classes/location.py,sha256=C4vhHs_kpLa3abfQIZiotfldnKoEq8YAbU3gvG7XDMA,3221
219
- cognite_toolkit/_cdf_tk/resource_classes/migration.py,sha256=Y-NOY3NdfjwWZEJ-gfDxPZ71l3qe2Gbtd7z1vtwESjs,1316
219
+ cognite_toolkit/_cdf_tk/resource_classes/migration.py,sha256=ThMKmJSaMx9DKtqkwcY2Y_Y4hY0xk-UzyF7HC49qlnA,903
220
220
  cognite_toolkit/_cdf_tk/resource_classes/raw_database_table.py,sha256=2It1o8-zsH1YMCXTnI_KMjjnuN4bnZ_2PS3ZyBUrh0I,538
221
221
  cognite_toolkit/_cdf_tk/resource_classes/relationship.py,sha256=tZQvy_ofmxSry0e9BITKOcB-L8fNocQBl56BJjAgThc,2074
222
222
  cognite_toolkit/_cdf_tk/resource_classes/search_config.py,sha256=KhHLKs6-tljU7tYaCc2u3qyHXbNDqCXI3OmntSsKW8E,837
@@ -305,13 +305,13 @@ cognite_toolkit/_repo_files/.gitignore,sha256=ip9kf9tcC5OguF4YF4JFEApnKYw0nG0vPi
305
305
  cognite_toolkit/_repo_files/AzureDevOps/.devops/README.md,sha256=OLA0D7yCX2tACpzvkA0IfkgQ4_swSd-OlJ1tYcTBpsA,240
306
306
  cognite_toolkit/_repo_files/AzureDevOps/.devops/deploy-pipeline.yml,sha256=brULcs8joAeBC_w_aoWjDDUHs3JheLMIR9ajPUK96nc,693
307
307
  cognite_toolkit/_repo_files/AzureDevOps/.devops/dry-run-pipeline.yml,sha256=OBFDhFWK1mlT4Dc6mDUE2Es834l8sAlYG50-5RxRtHk,723
308
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=4IYuywiBl7e1weDj23sLxaod25dD28xNSdPyZAHpvVo,667
309
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=moRss4JbKJnWzdL-KLC9bfSrOIxCCU-WtnkQzyr_3_E,2430
310
- cognite_toolkit/_resources/cdf.toml,sha256=gRhan9ulqtot-f73Yh_fh0QqJ7cg8zRBwZTEwcZQTmg,475
308
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=9OAOoiEnbwN-vEuPQmI59u7_5bHwKKgJVd2b3wmXZZU,667
309
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=vVpoAsIznpwy42v_665Hg5E5N6pbI0i0Q8vQDjHCBeg,2430
310
+ cognite_toolkit/_resources/cdf.toml,sha256=rDE7YGIeaEnxBZX8qUEFV8gr-Gh8wq8YArsxlDEPjIQ,475
311
311
  cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
312
312
  cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
313
- cognite_toolkit-0.7.22.dist-info/METADATA,sha256=UstCMFrvlrg-rFKdD4X_ajXHLrHKOUGBwDYHfxiu_DM,4501
314
- cognite_toolkit-0.7.22.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
315
- cognite_toolkit-0.7.22.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
316
- cognite_toolkit-0.7.22.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
317
- cognite_toolkit-0.7.22.dist-info/RECORD,,
313
+ cognite_toolkit-0.7.23.dist-info/METADATA,sha256=nbev1eMp2ATVbkZUvRaDAlUsUOj5-KKDSdANwZ0gsK4,4501
314
+ cognite_toolkit-0.7.23.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
315
+ cognite_toolkit-0.7.23.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
316
+ cognite_toolkit-0.7.23.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
317
+ cognite_toolkit-0.7.23.dist-info/RECORD,,