cognite-toolkit 0.7.63__py3-none-any.whl → 0.7.65__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.
@@ -21,6 +21,7 @@ from collections import defaultdict
21
21
  from dataclasses import dataclass
22
22
  from pathlib import Path
23
23
  from time import sleep
24
+ from typing import Literal
24
25
 
25
26
  import questionary
26
27
  from cognite.client.data_classes.capabilities import (
@@ -160,7 +161,10 @@ class AuthCommand(ToolkitCommand):
160
161
  if not user_groups:
161
162
  raise AuthorizationError("The current user is not member of any groups in the CDF project.")
162
163
 
163
- loader_capabilities, loaders_by_capability_tuple = self._get_capabilities_by_loader(client)
164
+ data_modeling_status = client.project.status().this_project.data_modeling_status
165
+ loader_capabilities, loaders_by_capability_tuple = self._get_capabilities_by_loader(
166
+ client, data_modeling_status
167
+ )
164
168
  toolkit_group = self._create_toolkit_group(loader_capabilities, demo_principal)
165
169
 
166
170
  if not is_demo:
@@ -200,7 +204,7 @@ class AuthCommand(ToolkitCommand):
200
204
  and questionary.confirm("Do you want to update the group with the missing capabilities?").unsafe_ask()
201
205
  ) or is_demo:
202
206
  has_added_capabilities = self._update_missing_capabilities(
203
- client, cdf_toolkit_group, missing_capabilities, dry_run
207
+ client, cdf_toolkit_group, missing_capabilities, dry_run, data_modeling_status
204
208
  )
205
209
  elif is_toolkit_group_existing: # and not is_user_in_toolkit_group
206
210
  self.warn(MediumSeverityWarning(f"The current client is not member of the {toolkit_group.name!r} group."))
@@ -215,7 +219,9 @@ class AuthCommand(ToolkitCommand):
215
219
  and missing_capabilities
216
220
  and questionary.confirm("Do you want to update the group with the missing capabilities?").unsafe_ask()
217
221
  ):
218
- self._update_missing_capabilities(client, cdf_toolkit_group, missing_capabilities, dry_run)
222
+ self._update_missing_capabilities(
223
+ client, cdf_toolkit_group, missing_capabilities, dry_run, data_modeling_status
224
+ )
219
225
  elif is_demo:
220
226
  # We create the group for the demo user
221
227
  cdf_toolkit_group = self._create_toolkit_group_in_cdf(client, toolkit_group)
@@ -360,6 +366,7 @@ class AuthCommand(ToolkitCommand):
360
366
  existing_group: Group,
361
367
  missing_capabilities: list[Capability],
362
368
  dry_run: bool,
369
+ data_modeling_status: Literal["HYBRID", "DATA_MODELING_ONLY"],
363
370
  ) -> bool:
364
371
  """Updates the missing capabilities. This assumes interactive mode."""
365
372
  updated_toolkit_group = GroupWrite.load(existing_group.dump())
@@ -368,6 +375,24 @@ class AuthCommand(ToolkitCommand):
368
375
  else:
369
376
  updated_toolkit_group.capabilities.extend(missing_capabilities)
370
377
 
378
+ if data_modeling_status == "DATA_MODELING_ONLY":
379
+ # Remove any AssetsAcl and RelationshipsAcl capabilities as these
380
+ # are not allowed in DATA_MODELING_ONLY projects.
381
+ filtered_capabilities: list[Capability] = []
382
+ removed: list[str] = []
383
+ for cap in updated_toolkit_group.capabilities:
384
+ if isinstance(cap, AssetsAcl | RelationshipsAcl):
385
+ removed.append(str(cap))
386
+ else:
387
+ filtered_capabilities.append(cap)
388
+ if removed:
389
+ self.console(
390
+ f"Removing {humanize_collection(removed)} as the project is in DATA_MODELING_ONLY mode."
391
+ f"These capabilities are not allowed in DATA_MODELING_ONLY projects.",
392
+ prefix=" [bold yellow]INFO[/] - ",
393
+ )
394
+ updated_toolkit_group.capabilities = filtered_capabilities
395
+
371
396
  with warnings.catch_warnings():
372
397
  # If the user has unknown capabilities, we don't want the user to see the warning:
373
398
  # "UserWarning: Unknown capability '<unknown warning>' will be ignored in comparison"
@@ -424,11 +449,10 @@ class AuthCommand(ToolkitCommand):
424
449
 
425
450
  @staticmethod
426
451
  def _get_capabilities_by_loader(
427
- client: ToolkitClient,
452
+ client: ToolkitClient, data_modeling_status: Literal["HYBRID", "DATA_MODELING_ONLY"]
428
453
  ) -> tuple[list[Capability], dict[tuple, list[str]]]:
429
454
  loaders_by_capability_tuple: dict[tuple, list[str]] = defaultdict(list)
430
455
  capability_by_id: dict[frozenset[tuple], Capability] = {}
431
- project_type = client.project.status().this_project.data_modeling_status
432
456
  for crud_cls in cruds.RESOURCE_CRUD_LIST:
433
457
  crud = crud_cls.create_loader(client)
434
458
  if crud.prerequisite_warning() is not None:
@@ -451,7 +475,7 @@ class AuthCommand(ToolkitCommand):
451
475
  capability = crud_cls.get_required_capability(None, read_only=False)
452
476
  capabilities = capability if isinstance(capability, list) else [capability]
453
477
  for cap in capabilities:
454
- if project_type == "DATA_MODELING_ONLY" and isinstance(cap, AssetsAcl | RelationshipsAcl):
478
+ if data_modeling_status == "DATA_MODELING_ONLY" and isinstance(cap, AssetsAcl | RelationshipsAcl):
455
479
  continue
456
480
  id_ = frozenset(cap.as_tuples())
457
481
  if id_ not in capability_by_id:
@@ -193,6 +193,10 @@ class TextProperty(ListablePropertyTypeDefinition):
193
193
  default=None,
194
194
  description="he set of language specific rules - used when sorting text fields.",
195
195
  )
196
+ max_text_size: int | None = Field(
197
+ default=None,
198
+ description="Specifies the maximum size in bytes of the text property, when encoded with utf-8",
199
+ )
196
200
 
197
201
 
198
202
  class FloatPrimitiveProperty(ListablePropertyTypeDefinition):
@@ -42,7 +42,7 @@ class ContainerYAML(ToolkitResource):
42
42
  description="Description of the container.",
43
43
  max_length=1024,
44
44
  )
45
- used_for: Literal["node", "edge", "all"] | None = Field(
45
+ used_for: Literal["node", "edge", "record", "all"] | None = Field(
46
46
  default=None,
47
47
  description="Should this operation apply to nodes, edges or both.",
48
48
  )
@@ -6,7 +6,6 @@ from .base import (
6
6
  catch_warnings,
7
7
  )
8
8
  from .fileread import (
9
- CaseTypoWarning,
10
9
  DataSetMissingWarning,
11
10
  DuplicatedItemWarning,
12
11
  EnvironmentVariableMissingWarning,
@@ -46,7 +45,6 @@ from .other import (
46
45
  )
47
46
 
48
47
  __all__ = [
49
- "CaseTypoWarning",
50
48
  "DataSetMissingWarning",
51
49
  "DuplicatedItemWarning",
52
50
  "EnvironmentVariableMissingWarning",
@@ -167,14 +167,6 @@ class NamespacingConventionWarning(NamingConventionWarning):
167
167
  return f"of using {self.namespace!r} as separator."
168
168
 
169
169
 
170
- @dataclass(frozen=True)
171
- class CaseTypoWarning(UnusedParameterWarning):
172
- expected: str
173
-
174
- def get_message(self) -> str:
175
- return f"{type(self).__name__}: Got {self.actual!r}. Did you mean {self.expected!r}?{self._location}."
176
-
177
-
178
170
  @dataclass(frozen=True)
179
171
  class MissingRequiredParameterWarning(YAMLFileWithElementWarning):
180
172
  severity: ClassVar[SeverityLevel] = SeverityLevel.HIGH
@@ -12,7 +12,7 @@ jobs:
12
12
  environment: dev
13
13
  name: Deploy
14
14
  container:
15
- image: cognite/toolkit:0.7.63
15
+ image: cognite/toolkit:0.7.65
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.63
13
+ image: cognite/toolkit:0.7.65
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.63"
7
+ version = "0.7.65"
8
8
 
9
9
 
10
10
  [plugins]
@@ -1 +1 @@
1
- __version__ = "0.7.63"
1
+ __version__ = "0.7.65"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite_toolkit
3
- Version: 0.7.63
3
+ Version: 0.7.65
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>
@@ -241,7 +241,7 @@ cognite_toolkit/_cdf_tk/commands/_upload.py,sha256=h4Ct02_7zyGr_SfQ2hOQAkDEcbjak
241
241
  cognite_toolkit/_cdf_tk/commands/_utils.py,sha256=UxMJW5QYKts4om5n6x2Tq2ihvfO9gWjhQKeqZNFTlKg,402
242
242
  cognite_toolkit/_cdf_tk/commands/_virtual_env.py,sha256=GFAid4hplixmj9_HkcXqU5yCLj-fTXm4cloGD6U2swY,2180
243
243
  cognite_toolkit/_cdf_tk/commands/about.py,sha256=pEXNdCeJYONOalH8x-7QRsKLgj-9gdIqN16pPxA3bhg,9395
244
- cognite_toolkit/_cdf_tk/commands/auth.py,sha256=dDw6zi7vQKHKD6soumvngTg16H2FKvg7G79PQMrnrrU,32542
244
+ cognite_toolkit/_cdf_tk/commands/auth.py,sha256=l_WW_tDgkpN_e0Aoc_3EYql_omYZTg5PBtMFCSbJ_b8,33780
245
245
  cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=e9BwCdfc_QyEJLC5jxmmD_Tbvy7oL-fC6HBoaMyQbjU,29145
246
246
  cognite_toolkit/_cdf_tk/commands/build_v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
247
247
  cognite_toolkit/_cdf_tk/commands/build_v2/_module_parser.py,sha256=B_Ddt8oB3tWto0Ocja9kvWaoIZyt8Oa-ukuoptQBYww,5916
@@ -318,8 +318,8 @@ cognite_toolkit/_cdf_tk/resource_classes/authentication.py,sha256=RTLjFXWhpg2tLo
318
318
  cognite_toolkit/_cdf_tk/resource_classes/base.py,sha256=nbAWSBkV-GL0co5UNMXvYMIw_-qhJ8uoXy9wz6KmI-w,723
319
319
  cognite_toolkit/_cdf_tk/resource_classes/capabilities.py,sha256=c50B8apsEiJ55bf-nWYfhy4uV9uMhZ-mRnXslZ80030,14898
320
320
  cognite_toolkit/_cdf_tk/resource_classes/cognitefile.py,sha256=nsLBw6CxwrmfxliO0vsGSc4vfaDONPsNHPFT6ckvudk,2800
321
- cognite_toolkit/_cdf_tk/resource_classes/container_field_definitions.py,sha256=grjzoW8AwujPJV70QyKBmhJ0m99kED9KMttoongnpL4,11428
322
- cognite_toolkit/_cdf_tk/resource_classes/containers.py,sha256=cWLB6CTvBkdwrMg4bw1S72s7IZo7O_pYNNTTUwNqXpY,3701
321
+ cognite_toolkit/_cdf_tk/resource_classes/container_field_definitions.py,sha256=s4M2SAEWbV1TPszldzS_gY9AY77-_il08HDmflvqTgs,11600
322
+ cognite_toolkit/_cdf_tk/resource_classes/containers.py,sha256=SE7I_VyPqV3J5n_REfGuxPv6Jzc4dQYsFYkVRBrkhZE,3711
323
323
  cognite_toolkit/_cdf_tk/resource_classes/data_model.py,sha256=kETO_C--w1EFmaZmPxeiZ0W5xRgVswUmVjc0dSKTTdQ,1471
324
324
  cognite_toolkit/_cdf_tk/resource_classes/datapoint_subscription.py,sha256=41sK5cpNRCmMwqqK_zYVq8GonqFCpIde357osqNKOAk,2787
325
325
  cognite_toolkit/_cdf_tk/resource_classes/dataset.py,sha256=kCEQUswgTgtb8fdd9mMg50MuY34zjDmdh4ZUmxu2A74,816
@@ -389,9 +389,9 @@ cognite_toolkit/_cdf_tk/storageio/selectors/_file_content.py,sha256=e7riknOinuhJ
389
389
  cognite_toolkit/_cdf_tk/storageio/selectors/_instances.py,sha256=NCFSJrAw52bNX6UTfOali8PvNjlqHnvxzL0hYBr7ZmA,4934
390
390
  cognite_toolkit/_cdf_tk/storageio/selectors/_raw.py,sha256=sZq9C4G9DMe3S46_usKet0FphQ6ow7cWM_PfXrEAakk,503
391
391
  cognite_toolkit/_cdf_tk/storageio/selectors/_three_d.py,sha256=0dT1vVG6EIyo0OJK3t_vwtE63i0dZvH8nZT7ebl1Ku0,924
392
- cognite_toolkit/_cdf_tk/tk_warnings/__init__.py,sha256=4vSQJE7ZCzfoJv3TmVYZl9R2Ubf6Mf-Te7ex_gcsDaY,2404
392
+ cognite_toolkit/_cdf_tk/tk_warnings/__init__.py,sha256=9ARP8aWrnRieqsK34-Bg17L9MTaHomvbJMgtrmpd3xg,2360
393
393
  cognite_toolkit/_cdf_tk/tk_warnings/base.py,sha256=cX8TCmb56gqx3lc7dankXuqpm5HGASJ4wTb07-MCJWs,4401
394
- cognite_toolkit/_cdf_tk/tk_warnings/fileread.py,sha256=QXs3g-WubOlO-HXvM_RzDVRyr-ZqELSev7XWiRjY2CM,9716
394
+ cognite_toolkit/_cdf_tk/tk_warnings/fileread.py,sha256=ChcimOe8hTpAPtbpRvdAcjuW8WFfndyKl3mMPCeAfIc,9479
395
395
  cognite_toolkit/_cdf_tk/tk_warnings/other.py,sha256=D8EubXyW4qigscBEiedQJuT5c6yYoFIEhBPa1DggD3I,5808
396
396
  cognite_toolkit/_cdf_tk/tracker.py,sha256=jhxzI8LOSZw3zDBPsTLW3zC2YcQK2abp_aVtRKcUIwE,5913
397
397
  cognite_toolkit/_cdf_tk/utils/__init__.py,sha256=DGuPTiY3fRhPuR_r-bCT_bDKl46nvF3q2ZY-yt2okT8,1640
@@ -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=SirbUy0Kcvvbva0BeT1O4fZ4QWa6Chk8eR_GkoAtgwg,667
436
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=JQekh5r35a9AgCpXYwzT1QwzyqRHsTVR7pcxTOe2zOQ,2430
437
- cognite_toolkit/_resources/cdf.toml,sha256=SOsS5JgHNeMYgeV_UWRXczssd6x0jutfuJCQjxJ8sAw,475
438
- cognite_toolkit/_version.py,sha256=oQs5nDLBiJV3A-cTJuhMbabRY2LIGf9C4v6xF17N4gs,23
435
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=pj1SKKdnFTuMldcuQzmIldJmmCYPnvCzXhBigQHM964,667
436
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=ltkZRh4cTxk7wIoteM7q5mWkTo_XGQZ9lbI4Iso4Erw,2430
437
+ cognite_toolkit/_resources/cdf.toml,sha256=emYi7rsbTlocjPTaqSOTB-18gvMktXk25iHuDRTf-4Y,475
438
+ cognite_toolkit/_version.py,sha256=sfCL-G27Jd4PewT4t9p1rAKnVr6KpnFv-mE259TcpVo,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.63.dist-info/WHEEL,sha256=e_m4S054HL0hyR3CpOk-b7Q7fDX6BuFkgL5OjAExXas,80
442
- cognite_toolkit-0.7.63.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
443
- cognite_toolkit-0.7.63.dist-info/METADATA,sha256=DKhf2nuKq7ucWOMAqd3VPWoSqw3Dr2xdqPK2Y_uqpNM,5026
444
- cognite_toolkit-0.7.63.dist-info/RECORD,,
441
+ cognite_toolkit-0.7.65.dist-info/WHEEL,sha256=fAguSjoiATBe7TNBkJwOjyL1Tt4wwiaQGtNtjRPNMQA,80
442
+ cognite_toolkit-0.7.65.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
443
+ cognite_toolkit-0.7.65.dist-info/METADATA,sha256=cbuwqU3adyVYczckvZzP8j4-1w-MAZ3KU7yUnv9voB0,5026
444
+ cognite_toolkit-0.7.65.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.27
2
+ Generator: uv 0.9.28
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any