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.
- cognite_toolkit/_cdf_tk/client/api/legacy/canvas.py +12 -3
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py +13 -1
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml +1 -1
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml +1 -1
- cognite_toolkit/_resources/cdf.toml +1 -1
- cognite_toolkit/_version.py +1 -1
- {cognite_toolkit-0.7.37.dist-info → cognite_toolkit-0.7.38.dist-info}/METADATA +1 -1
- {cognite_toolkit-0.7.37.dist-info → cognite_toolkit-0.7.38.dist-info}/RECORD +10 -10
- {cognite_toolkit-0.7.37.dist-info → cognite_toolkit-0.7.38.dist-info}/WHEEL +0 -0
- {cognite_toolkit-0.7.37.dist-info → cognite_toolkit-0.7.38.dist-info}/entry_points.txt +0 -0
|
@@ -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.
|
|
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(
|
cognite_toolkit/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.7.
|
|
1
|
+
__version__ = "0.7.38"
|
|
@@ -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=
|
|
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=
|
|
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=
|
|
313
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=
|
|
314
|
-
cognite_toolkit/_resources/cdf.toml,sha256=
|
|
315
|
-
cognite_toolkit/_version.py,sha256=
|
|
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.
|
|
320
|
-
cognite_toolkit-0.7.
|
|
321
|
-
cognite_toolkit-0.7.
|
|
322
|
-
cognite_toolkit-0.7.
|
|
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,,
|
|
File without changes
|
|
File without changes
|