cognite-toolkit 0.7.37__py3-none-any.whl → 0.7.38__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.
@@ -133,6 +133,9 @@ class IndustrialCanvasAPI:
133
133
 
134
134
  @classmethod
135
135
  def _retrieve_query(cls, external_id: str) -> query.Query:
136
+ # The limit for canvas components must be high enough to cover all annotations/references in a canvas.
137
+ # Using 1000 as a safe upper bound (same as _APPLY_LIMIT).
138
+ query_limit = 1000
136
139
  return query.Query(
137
140
  with_={
138
141
  "canvas": query.NodeResultSetExpression(
@@ -142,18 +145,21 @@ class IndustrialCanvasAPI:
142
145
  "solutionTags": query.NodeResultSetExpression(
143
146
  from_="canvas",
144
147
  through=Canvas.get_source().as_property_ref("solutionTags"),
148
+ limit=query_limit,
145
149
  ),
146
150
  "annotationEdges": query.EdgeResultSetExpression(
147
151
  from_="canvas",
148
152
  filter=filters.Equals(["edge", "type"], ANNOTATION_EDGE_TYPE.dump()),
149
153
  node_filter=filters.HasData(views=[CanvasAnnotation.get_source()]),
150
154
  direction="outwards",
155
+ limit=query_limit,
151
156
  ),
152
157
  "containerReferenceEdges": query.EdgeResultSetExpression(
153
158
  from_="canvas",
154
159
  filter=filters.Equals(["edge", "type"], CONTAINER_REFERENCE_EDGE_TYPE.dump()),
155
160
  node_filter=filters.HasData(views=[ContainerReference.get_source()]),
156
161
  direction="outwards",
162
+ limit=query_limit,
157
163
  ),
158
164
  "fdmInstanceContainerReferenceEdges": query.EdgeResultSetExpression(
159
165
  from_="canvas",
@@ -163,11 +169,14 @@ class IndustrialCanvasAPI:
163
169
  ),
164
170
  node_filter=filters.HasData(views=[FdmInstanceContainerReference.get_source()]),
165
171
  direction="outwards",
172
+ limit=query_limit,
173
+ ),
174
+ "annotations": query.NodeResultSetExpression(from_="annotationEdges", limit=query_limit),
175
+ "containerReferences": query.NodeResultSetExpression(
176
+ from_="containerReferenceEdges", limit=query_limit
166
177
  ),
167
- "annotations": query.NodeResultSetExpression(from_="annotationEdges"),
168
- "containerReferences": query.NodeResultSetExpression(from_="containerReferenceEdges"),
169
178
  "fdmInstanceContainerReferences": query.NodeResultSetExpression(
170
- from_="fdmInstanceContainerReferenceEdges"
179
+ from_="fdmInstanceContainerReferenceEdges", limit=query_limit
171
180
  ),
172
181
  },
173
182
  select={
@@ -22,6 +22,7 @@ from cognite.client.data_classes.capabilities import (
22
22
  FunctionsAcl,
23
23
  SessionsAcl,
24
24
  )
25
+ from cognite.client.data_classes.data_modeling import NodeId
25
26
  from cognite.client.data_classes.data_modeling.cdm.v1 import CogniteFileApply
26
27
  from cognite.client.data_classes.functions import HANDLER_FILE_NAME
27
28
  from cognite.client.exceptions import CogniteAPIError
@@ -406,7 +407,18 @@ class FunctionCRUD(ResourceCRUD[str, FunctionWrite, Function]):
406
407
 
407
408
  self.client.functions.delete_with_429_retry(external_id=ids, ignore_unknown_ids=True)
408
409
  file_ids = {func.file_id for func in functions if func.file_id}
409
- self.client.files.delete(id=list(file_ids), ignore_unknown_ids=True)
410
+ files = self.client.files.retrieve_multiple(list(file_ids), ignore_unknown_ids=True)
411
+ dm_file_nodes: set[NodeId] = set()
412
+ classic_file_ids: set[int] = set()
413
+ for file in files:
414
+ if file.instance_id is not None:
415
+ dm_file_nodes.add(file.instance_id)
416
+ else:
417
+ classic_file_ids.add(file.id)
418
+ if classic_file_ids:
419
+ self.client.files.delete(id=list(classic_file_ids), ignore_unknown_ids=True)
420
+ if dm_file_nodes:
421
+ self.client.data_modeling.instances.delete(list(dm_file_nodes))
410
422
  return len(ids)
411
423
 
412
424
  def _iterate(
@@ -12,7 +12,7 @@ jobs:
12
12
  environment: dev
13
13
  name: Deploy
14
14
  container:
15
- image: cognite/toolkit:0.7.37
15
+ image: cognite/toolkit:0.7.38
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.37
13
+ image: cognite/toolkit:0.7.38
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.37"
7
+ version = "0.7.38"
8
8
 
9
9
 
10
10
  [plugins]
@@ -1 +1 @@
1
- __version__ = "0.7.37"
1
+ __version__ = "0.7.38"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite_toolkit
3
- Version: 0.7.37
3
+ Version: 0.7.38
4
4
  Summary: Official Cognite Data Fusion tool for project templates and configuration deployment
5
5
  Author: Cognite AS
6
6
  Author-email: Cognite AS <support@cognite.com>
@@ -33,7 +33,7 @@ cognite_toolkit/_cdf_tk/client/_toolkit_client.py,sha256=S2D0N3Cea39Bhl2NIu8jbQy
33
33
  cognite_toolkit/_cdf_tk/client/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  cognite_toolkit/_cdf_tk/client/api/infield.py,sha256=B7sydnhE1cKhp9OJxkjmTAfRREWZTaD8EuSvscZoE8w,11039
35
35
  cognite_toolkit/_cdf_tk/client/api/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- cognite_toolkit/_cdf_tk/client/api/legacy/canvas.py,sha256=2TVKPlgtXviPxW9tOX_tv7I06K-SnYovg5c9sxBE3f4,8843
36
+ cognite_toolkit/_cdf_tk/client/api/legacy/canvas.py,sha256=t5TNNtoCyOHwQbbYetT27Xh5eSwNIZVnBBCIh7y8KC4,9299
37
37
  cognite_toolkit/_cdf_tk/client/api/legacy/charts.py,sha256=YZ2jjHoKinRiqOBzosq6abvzStA4B6VezI1wSy3_U2k,4960
38
38
  cognite_toolkit/_cdf_tk/client/api/legacy/dml.py,sha256=8b1lo86JdvfEsz9mP2rx0Mp9fyWsU6mbXHqLBtvSidU,3546
39
39
  cognite_toolkit/_cdf_tk/client/api/legacy/extended_data_modeling.py,sha256=yrMDViyvEboVrUr6lm0EHm_9mVBxVCLGBLMLY0-QBGw,12974
@@ -151,7 +151,7 @@ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py,sha256=4uTr3Mx89yaPsr
151
151
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/extraction_pipeline.py,sha256=nvMIDeAksJ_0iWvorK8k1BemSrTAUhll_JgCMNiUjZ4,17708
152
152
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/fieldops.py,sha256=4DL6koP_wwBqfgRveSAYbTVkcTJfjvrj0s2JXJ_p8yQ,20750
153
153
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py,sha256=YGsrp0_yLcpyUvVc_-EW7Rb6LTl_cKtWNmuJDbxbqhs,14862
154
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py,sha256=QHihJsyCc9EJImPQSIZDQsxDewCglBc6iSHXjLeutMs,28402
154
+ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py,sha256=nSIZKLAC19PVh-Lf0BehfEO1d6kRZFCzEj72cA5Ksj0,28973
155
155
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/group_scoped.py,sha256=WEg8-CxMP64WfE_XXIlH114zM51K0uLaYa4atd992zI,1690
156
156
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/hosted_extractors.py,sha256=P0hlXK0_FmO86U-gDHMHz8N0vpDtPoKupiQfhNP5KLE,14619
157
157
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/industrial_tool.py,sha256=5KMKhUCdtiOJpqSjC5YRkZ_ssodvPrzUoIi-pSIYri8,7863
@@ -309,14 +309,14 @@ cognite_toolkit/_repo_files/.gitignore,sha256=ip9kf9tcC5OguF4YF4JFEApnKYw0nG0vPi
309
309
  cognite_toolkit/_repo_files/AzureDevOps/.devops/README.md,sha256=OLA0D7yCX2tACpzvkA0IfkgQ4_swSd-OlJ1tYcTBpsA,240
310
310
  cognite_toolkit/_repo_files/AzureDevOps/.devops/deploy-pipeline.yml,sha256=brULcs8joAeBC_w_aoWjDDUHs3JheLMIR9ajPUK96nc,693
311
311
  cognite_toolkit/_repo_files/AzureDevOps/.devops/dry-run-pipeline.yml,sha256=OBFDhFWK1mlT4Dc6mDUE2Es834l8sAlYG50-5RxRtHk,723
312
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=gR79ZiFB7x_quDn8S-igX6EbQCfZ4IYAn45cMDXwTJk,667
313
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=uz0GAeWtszko22mn51Lfhfr06eCyNKQ1mR7khL8vf_I,2430
314
- cognite_toolkit/_resources/cdf.toml,sha256=_J325j9yHa-mVFBqQG92BilrJF0G1pch62_QF8xV6lw,475
315
- cognite_toolkit/_version.py,sha256=mPIDHZlXNkUSLVUQoS8PGMfQqLTaNHZjGCBlyAgA8IA,23
312
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=slEyMNTmrTPtEgXE0doIjIaQ9gbSN_YwMLWCRaEpbvc,667
313
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=TA55MiwpfFuQE5SM1O2niT-SZBq2nE1mGgio4uVo2U4,2430
314
+ cognite_toolkit/_resources/cdf.toml,sha256=Tm7hhHJxd3bWEJmFz6O_v7Pq18mpOetVExdrUUnaufY,475
315
+ cognite_toolkit/_version.py,sha256=bmWrV8MUOLbHKnFCEpSH0OI-m3Rwe5OkY4oMckUViBE,23
316
316
  cognite_toolkit/config.dev.yaml,sha256=M33FiIKdS3XKif-9vXniQ444GTZ-bLXV8aFH86u9iUQ,332
317
317
  cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
318
318
  cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
319
- cognite_toolkit-0.7.37.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
320
- cognite_toolkit-0.7.37.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
321
- cognite_toolkit-0.7.37.dist-info/METADATA,sha256=DqjU2cAuZCfxXxrfZNG3HvR2C2JZaV3QY5f6kTdowQw,4507
322
- cognite_toolkit-0.7.37.dist-info/RECORD,,
319
+ cognite_toolkit-0.7.38.dist-info/WHEEL,sha256=ZyFSCYkV2BrxH6-HRVRg3R9Fo7MALzer9KiPYqNxSbo,79
320
+ cognite_toolkit-0.7.38.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
321
+ cognite_toolkit-0.7.38.dist-info/METADATA,sha256=obcR-ekvY-B8F-lQNmx78NLJfTsrRtPZnYGWjidg56A,4507
322
+ cognite_toolkit-0.7.38.dist-info/RECORD,,