cognite-toolkit 0.7.19__py3-none-any.whl → 0.7.20__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.
@@ -219,9 +219,16 @@ class UploadableAssetCentricIO(
219
219
  security_category_names.add(security_category_external_id)
220
220
  self.client.lookup.security_categories.id(list(security_category_names))
221
221
 
222
- def row_to_resource(
223
- self, source_id: str, row: dict[str, JsonVal], selector: AssetCentricSelector | None = None
224
- ) -> T_ResourceRequest:
222
+ def rows_to_data(
223
+ self, rows: list[tuple[str, dict[str, JsonVal]]], selector: AssetCentricSelector | None = None
224
+ ) -> Sequence[UploadItem[T_ResourceRequest]]:
225
+ # We need to populate caches for any external IDs used in the rows before converting to resources.
226
+ # Thus, we override this method instead of row_to_resource, and reuse the json_to_resource method that
227
+ # does the cache population.
228
+ return self.json_chunk_to_data([(source_id, self.row_to_json(row)) for source_id, row in rows])
229
+
230
+ @classmethod
231
+ def row_to_json(cls, row: dict[str, JsonVal]) -> dict[str, JsonVal]:
225
232
  metadata: dict[str, JsonVal] = {}
226
233
  cleaned_row: dict[str, JsonVal] = {}
227
234
  for key, value in row.items():
@@ -232,7 +239,14 @@ class UploadableAssetCentricIO(
232
239
  cleaned_row[key] = value
233
240
  if metadata:
234
241
  cleaned_row["metadata"] = metadata
235
- return self.json_to_resource(cleaned_row)
242
+ return cleaned_row
243
+
244
+ def row_to_resource(
245
+ self, source_id: str, row: dict[str, JsonVal], selector: AssetCentricSelector | None = None
246
+ ) -> T_ResourceRequest:
247
+ raise NotImplementedError(
248
+ f"This method should not be called. {type(self).__name__} overrides rows_to_data instead."
249
+ )
236
250
 
237
251
 
238
252
  class AssetIO(UploadableAssetCentricIO[Asset, AssetWrite]):
@@ -12,7 +12,7 @@ jobs:
12
12
  environment: dev
13
13
  name: Deploy
14
14
  container:
15
- image: cognite/toolkit:0.7.19
15
+ image: cognite/toolkit:0.7.20
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.19
13
+ image: cognite/toolkit:0.7.20
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.19"
7
+ version = "0.7.20"
8
8
 
9
9
 
10
10
  [plugins]
@@ -1 +1 @@
1
- __version__ = "0.7.19"
1
+ __version__ = "0.7.20"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite_toolkit
3
- Version: 0.7.19
3
+ Version: 0.7.20
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=-_OxJPv2D0J4Tap1QJZo4Z4XyBYoG9M_2-0CsJ35W-I,23
3
+ cognite_toolkit/_version.py,sha256=k_NYgI0xLUB_dPJL4N6BdDmPFD0V9fwqtEqrNG-_EGQ,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
@@ -245,7 +245,7 @@ cognite_toolkit/_cdf_tk/resource_classes/robotics/map.py,sha256=j77z7CzCMiMj8r94
245
245
  cognite_toolkit/_cdf_tk/storageio/__init__.py,sha256=h5Wr4i7zNIgsslrsRJxmp7ls4bNRKl0uZzQ7GLRMP7g,1920
246
246
  cognite_toolkit/_cdf_tk/storageio/_annotations.py,sha256=JI_g18_Y9S7pbc9gm6dZMyo3Z-bCndJXF9C2lOva0bQ,4848
247
247
  cognite_toolkit/_cdf_tk/storageio/_applications.py,sha256=VlTRHqp8jVu16SW7LtrN05BNYZHSPtJ_wf9EsBAAsvE,16419
248
- cognite_toolkit/_cdf_tk/storageio/_asset_centric.py,sha256=59m4vhhCjUEsECtdsEWY7hyFaW1eLj6AoaFBqD00Zjk,31713
248
+ cognite_toolkit/_cdf_tk/storageio/_asset_centric.py,sha256=TirKLSNPoLqKjczsw0djWAsR0VvopwmU23aUxrBOJN8,32464
249
249
  cognite_toolkit/_cdf_tk/storageio/_base.py,sha256=ElvqhIEBnhcz0yY1Ds164wVN0_7CFNK-uT0-z7LcR9U,13067
250
250
  cognite_toolkit/_cdf_tk/storageio/_data_classes.py,sha256=s3TH04BJ1q7rXndRhEbVMEnoOXjxrGg4n-w9Z5uUL-o,3480
251
251
  cognite_toolkit/_cdf_tk/storageio/_datapoints.py,sha256=xE1YgoP98-mJjIeF5536KwChzhVY90KYl-bW5sRVhFQ,20206
@@ -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=ooLfuTmEtRjoSVSfA0I-Tf82Yis1Sa6C6nYRKYzkHq0,667
309
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=mXV7t80OIGPp0MHXaKYxMI_RyvXJF8g9i3qGBMdcTHk,2430
310
- cognite_toolkit/_resources/cdf.toml,sha256=lUpjLpGkcB6bnDTxUDaNdaunOrWY66j11kbnqJa3mFE,475
308
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=sVWo0P7uvKyz1D1mrYhdiRak7DOy0o8GxTNtAR3tNrg,667
309
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=nLRRf5K6lur4MsjQPl3wSLMTFb4vAf8MBeAmq8bFBok,2430
310
+ cognite_toolkit/_resources/cdf.toml,sha256=V0xczqShauGTujzM49gbP9aLYGTWf4SWo7ZDWDWkxEM,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.19.dist-info/METADATA,sha256=YYMs-Mr4NmKnKYEFsH1Uj6aI8LRyIqSiunnpRs12WwQ,4501
314
- cognite_toolkit-0.7.19.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
315
- cognite_toolkit-0.7.19.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
316
- cognite_toolkit-0.7.19.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
317
- cognite_toolkit-0.7.19.dist-info/RECORD,,
313
+ cognite_toolkit-0.7.20.dist-info/METADATA,sha256=ouWrKIy9SwM_KVNSweTz9FxFNOmODdelIly77qGRhy0,4501
314
+ cognite_toolkit-0.7.20.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
315
+ cognite_toolkit-0.7.20.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
316
+ cognite_toolkit-0.7.20.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
317
+ cognite_toolkit-0.7.20.dist-info/RECORD,,