cognite-toolkit 0.7.68__py3-none-any.whl → 0.7.70__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.
@@ -146,7 +146,7 @@ class LocationFilterCore(WriteableCogniteResource["LocationFilterWrite"], ABC):
146
146
  scene: LocationFilterScene | None = None,
147
147
  asset_centric: AssetCentricFilter | None = None,
148
148
  views: list[LocationFilterView] | None = None,
149
- data_modeling_type: Literal["HYBRID", "DATA_MODELING_ONLY"] | None = None,
149
+ data_modeling_type: Literal["HYBRID", "DATA_MODELING_ONLY", "ASSET_CENTRIC_ONLY"] | None = None,
150
150
  _parent_external_id: str | None = None,
151
151
  ) -> None:
152
152
  self.external_id = external_id
@@ -250,7 +250,7 @@ class LocationFilter(LocationFilterCore):
250
250
  scene: LocationFilterScene | None = None,
251
251
  asset_centric: AssetCentricFilter | None = None,
252
252
  views: list[LocationFilterView] | None = None,
253
- data_modeling_type: Literal["HYBRID", "DATA_MODELING_ONLY"] | None = None,
253
+ data_modeling_type: Literal["HYBRID", "DATA_MODELING_ONLY", "ASSET_CENTRIC_ONLY"] | None = None,
254
254
  locations: "LocationFilterList | None" = None,
255
255
  ) -> None:
256
256
  super().__init__(
@@ -486,6 +486,10 @@ class FunctionScheduleCRUD(ResourceCRUD[FunctionScheduleID, FunctionScheduleWrit
486
486
  raise ToolkitRequiredValueError("FunctionSchedule must have functionExternalId and Name set.")
487
487
  return FunctionScheduleID(item.function_external_id, item.name)
488
488
 
489
+ @classmethod
490
+ def as_str(cls, id: FunctionScheduleID) -> str:
491
+ return sanitize_filename(f"{id.function_external_id}-{id.name}")
492
+
489
493
  @classmethod
490
494
  def get_dependent_items(cls, item: dict) -> Iterable[tuple[type[ResourceCRUD], Hashable]]:
491
495
  if "functionExternalId" in item:
@@ -624,10 +628,17 @@ class FunctionScheduleCRUD(ResourceCRUD[FunctionScheduleID, FunctionScheduleWrit
624
628
  if parent_ids is None:
625
629
  yield from self.client.functions.schedules
626
630
  else:
627
- for parent_id in parent_ids:
628
- if not isinstance(parent_id, str):
629
- continue
630
- yield from self.client.functions.schedules(function_external_id=parent_id)
631
+ external_ids = [external_id for external_id in parent_ids if isinstance(external_id, str)]
632
+ if not external_ids:
633
+ return
634
+ internal_ids = self.client.lookup.functions.id(external_ids)
635
+ for func_id in internal_ids:
636
+ funct_external_id = self.client.lookup.functions.external_id(func_id)
637
+ for schedule in self.client.functions.schedules(function_id=func_id):
638
+ # FunctionExternalId is not set in the schedule object returned from the API,
639
+ # so we need to set it here.
640
+ schedule.function_external_id = funct_external_id
641
+ yield schedule
631
642
 
632
643
  def sensitive_strings(self, item: FunctionScheduleWrite) -> Iterable[str]:
633
644
  id_ = self.get_id(item)
@@ -126,10 +126,9 @@ class LocationFilterCRUD(ResourceCRUD[str, LocationFilterWrite, LocationFilter])
126
126
 
127
127
  def dump_resource(self, resource: LocationFilter, local: dict[str, Any] | None = None) -> dict[str, Any]:
128
128
  dumped = resource.as_write().dump()
129
- local = local or {}
130
129
  if parent_id := dumped.pop("parentId", None):
131
130
  dumped["parentExternalId"] = self.client.lookup.location_filters.external_id(parent_id)
132
- if "dataModelingType" in dumped and "dataModelingType" not in local:
131
+ if dumped.get("dataModelingType") == "HYBRID" and local is not None and "dataModelingType" not in local:
133
132
  # Default set on server side
134
133
  dumped.pop("dataModelingType")
135
134
  if "assetCentric" not in dumped:
@@ -12,7 +12,7 @@ jobs:
12
12
  environment: dev
13
13
  name: Deploy
14
14
  container:
15
- image: cognite/toolkit:0.7.68
15
+ image: cognite/toolkit:0.7.70
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.68
13
+ image: cognite/toolkit:0.7.70
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.68"
7
+ version = "0.7.70"
8
8
 
9
9
 
10
10
  [plugins]
@@ -1 +1 @@
1
- __version__ = "0.7.68"
1
+ __version__ = "0.7.70"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite_toolkit
3
- Version: 0.7.68
3
+ Version: 0.7.70
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>
@@ -177,7 +177,7 @@ cognite_toolkit/_cdf_tk/client/resource_classes/legacy/extended_timeseries.py,sh
177
177
  cognite_toolkit/_cdf_tk/client/resource_classes/legacy/functions.py,sha256=r9vhkS7sJ-wCiwvtD9CDKKthAktDMS6FJWDsLzq6iJ8,378
178
178
  cognite_toolkit/_cdf_tk/client/resource_classes/legacy/graphql_data_models.py,sha256=N_1dfXSdsLlhw5uXreNfmSCo5bA4XeiZneMdnHWDgJI,4313
179
179
  cognite_toolkit/_cdf_tk/client/resource_classes/legacy/instances.py,sha256=aGV3XtBGwG1ELks3kqFkScO-MGC5zvcSZtYXOVWL2BE,2501
180
- cognite_toolkit/_cdf_tk/client/resource_classes/legacy/location_filters.py,sha256=IgHU7Hto0Zz3Bk_QW17JC3vUw0yN1oaTeJ3ZPKOGFAE,12112
180
+ cognite_toolkit/_cdf_tk/client/resource_classes/legacy/location_filters.py,sha256=At-Olj-daQcR239fVpUZuezbKkOY7jsIx-n1wxlWleQ,12156
181
181
  cognite_toolkit/_cdf_tk/client/resource_classes/legacy/migration.py,sha256=AoYgqwSoYn1ok_ksG9Lljb270J4zPF_qyJSu5ZHtD_Q,18632
182
182
  cognite_toolkit/_cdf_tk/client/resource_classes/legacy/pending_instances_ids.py,sha256=W99jhHMLzW_0TvZoaeeaeWXljN9GjuXPoFO-SRjsd-s,1888
183
183
  cognite_toolkit/_cdf_tk/client/resource_classes/legacy/project.py,sha256=y0rcIZvoTf5b3LPgz9ufUU2UTkDTyzz-HmNgH6cXRNA,1226
@@ -274,11 +274,11 @@ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py,sha256=Deyx0iAxiGmw3j
274
274
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/extraction_pipeline.py,sha256=yzRGAp1h7G0LN1ix81ZXpq-QZw0qHAjlW8aNaI0ehT8,17712
275
275
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/fieldops.py,sha256=WEFfSnkzKSUrDamAEDxzJvrJlmK1nnu6Mc_2feqic4Q,21007
276
276
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py,sha256=LvlukwvRIQm8cX-YWfTGVjO74ZnPMDGv3m5Cd7pfgx8,14977
277
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py,sha256=HwKu-RtBOIkKB32EcrjsMBoLYDXqNnoelb_VzCRDQ70,28977
277
+ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/function.py,sha256=OSJlIiqyBqbSiEf4w7EGflMAk9Yvc96J3VFkYZlk3zw,29605
278
278
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/group_scoped.py,sha256=WEg8-CxMP64WfE_XXIlH114zM51K0uLaYa4atd992zI,1690
279
279
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/hosted_extractors.py,sha256=pRyClYj2-NwDJOr7jo2-yaduLirf1Uts_IrLKb5-nR0,17764
280
280
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/industrial_tool.py,sha256=iZJGzo02cVjs_9zcVobe84mkBe5HcTzFEZU7HAA1RZ0,7867
281
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/location.py,sha256=juUiQAvBouBlzuXSdLSJpOiXGltU6Nknmmnc6LYPv90,12218
281
+ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/location.py,sha256=sOZunu027t-2ocuICqc2WgRYOMVYxc7n2fVgXmIfkmo,12226
282
282
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/migration.py,sha256=8-7QgL4g-DMJHwBbOFAg4QscMNA1RMCqHfZYQlSNKU4,4467
283
283
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/raw.py,sha256=T_j0vJp8URJGsKeTi_bYvnNtdte_Axw5htmsu0CfG88,12104
284
284
  cognite_toolkit/_cdf_tk/cruds/_resource_cruds/relationship.py,sha256=TO2Y6TZJEGxyKv7EMOtyyALz3Wyigp0mwBSQVTL-D5A,6330
@@ -432,13 +432,13 @@ cognite_toolkit/_repo_files/.gitignore,sha256=ip9kf9tcC5OguF4YF4JFEApnKYw0nG0vPi
432
432
  cognite_toolkit/_repo_files/AzureDevOps/.devops/README.md,sha256=OLA0D7yCX2tACpzvkA0IfkgQ4_swSd-OlJ1tYcTBpsA,240
433
433
  cognite_toolkit/_repo_files/AzureDevOps/.devops/deploy-pipeline.yml,sha256=brULcs8joAeBC_w_aoWjDDUHs3JheLMIR9ajPUK96nc,693
434
434
  cognite_toolkit/_repo_files/AzureDevOps/.devops/dry-run-pipeline.yml,sha256=OBFDhFWK1mlT4Dc6mDUE2Es834l8sAlYG50-5RxRtHk,723
435
- cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=Iwq43lowmWSYOF2Go1ve0GZLw6IauZRKh_ZQkcpimQ0,667
436
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=cOOyMF6XnD2ejFfMgBsW-cwCow4uzfUhnbR_vHOlUKc,2430
437
- cognite_toolkit/_resources/cdf.toml,sha256=Ichf1svtm1IvjxRIrKaJZSxcGsMXiLg_fj9RjM3i7MQ,475
438
- cognite_toolkit/_version.py,sha256=_6QHdVtUxX6ebdvBnyY3uH22dCrqQAiBIRPdDfFUz0A,23
435
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=qQ_xDd8t-BoDn8jQH0myosDup607lUlFP0XyFYjNyvI,667
436
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=RfOWvAlbfEX2AN-p778iZ1-BQKh3CkrsZ20regQHgZU,2430
437
+ cognite_toolkit/_resources/cdf.toml,sha256=_eXFo5nNSYSt5pSGNJy_XryxMBGOe-Y3T6ZmAxgoBII,475
438
+ cognite_toolkit/_version.py,sha256=ZfQz5T6Qc8giGJV4KwdZES652C1RbgB-gyM_Mb-p5AE,23
439
439
  cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
440
440
  cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
441
- cognite_toolkit-0.7.68.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
442
- cognite_toolkit-0.7.68.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
443
- cognite_toolkit-0.7.68.dist-info/METADATA,sha256=0cyiw6FtLVnRRN7FU7Bh0dIQ02aDbexz5LVwAGnnnGI,5026
444
- cognite_toolkit-0.7.68.dist-info/RECORD,,
441
+ cognite_toolkit-0.7.70.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
442
+ cognite_toolkit-0.7.70.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
443
+ cognite_toolkit-0.7.70.dist-info/METADATA,sha256=dJLGdBD0b3wIoIPt1gb6IinqJ-39kikvePgaS98EVpE,5026
444
+ cognite_toolkit-0.7.70.dist-info/RECORD,,