cognite-toolkit 0.7.51__py3-none-any.whl → 0.7.53__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.
@@ -735,13 +735,17 @@ class PurgeCommand(ToolkitCommand):
735
735
  node_ids = [instance for instance in instances if isinstance(instance, NodeId)]
736
736
  if node_ids:
737
737
  timeseries = client.time_series.retrieve_multiple(instance_ids=node_ids, ignore_unknown_ids=True)
738
+ migrated_timeseries_ids = [
739
+ ts.id
740
+ for ts in timeseries
741
+ if ts.instance_id and ts.pending_instance_id # type: ignore[attr-defined]
742
+ ]
738
743
  if not dry_run and timeseries:
739
- migrated_timeseries_ids = [ts.id for ts in timeseries if ts.instance_id and ts.pending_instance_id] # type: ignore[attr-defined]
740
744
  client.time_series.unlink_instance_ids(id=migrated_timeseries_ids)
741
745
  if verbose:
742
746
  console.print(f"Unlinked {len(migrated_timeseries_ids)} timeseries from datapoints.")
743
747
  elif verbose and timeseries:
744
- console.print(f"Would have unlinked {len(timeseries)} timeseries from datapoints.")
748
+ console.print(f"Would have unlinked {len(migrated_timeseries_ids)} timeseries from datapoints.")
745
749
  return instances
746
750
 
747
751
  @staticmethod
@@ -751,15 +755,15 @@ class PurgeCommand(ToolkitCommand):
751
755
  file_ids = [instance for instance in instances if isinstance(instance, NodeId)]
752
756
  if file_ids:
753
757
  files = client.files.retrieve_multiple(instance_ids=file_ids, ignore_unknown_ids=True)
758
+ migrated_file_ids = [
759
+ file.id
760
+ for file in files
761
+ if file.instance_id and file.pending_instance_id and file.id is not None # type: ignore[attr-defined]
762
+ ]
754
763
  if not dry_run and files:
755
- migrated_file_ids = [
756
- file.id
757
- for file in files
758
- if file.instance_id and file.pending_instance_id and file.id is not None # type: ignore[attr-defined]
759
- ]
760
764
  client.files.unlink_instance_ids(id=migrated_file_ids)
761
765
  if verbose:
762
766
  console.print(f"Unlinked {len(migrated_file_ids)} files from nodes.")
763
767
  elif verbose and files:
764
- console.print(f"Would have unlinked {len(files)} files from their blob content.")
768
+ console.print(f"Would have unlinked {len(migrated_file_ids)} files from their blob content.")
765
769
  return instances
@@ -540,13 +540,14 @@ class BuildCommand(ToolkitCommand):
540
540
  continue
541
541
  elif client and self._check_resource_exists_in_cdf(client, loader_cls, id_):
542
542
  continue
543
- elif loader_cls.resource_cls is RawDatabase:
544
- # Raw Databases are automatically created when a Raw Table is created.
545
- continue
546
- required_by = {
547
- (required, path.relative_to(project_config_dir))
548
- for required, path in self._dependencies_by_required[(loader_cls, id_)]
549
- }
543
+ required_by: set[tuple[Hashable, Path]] = set()
544
+ for required, path in self._dependencies_by_required[(loader_cls, id_)]:
545
+ if path.name.endswith(RawTableCRUD.kind) and loader_cls is RawDatabaseCRUD:
546
+ # RAW Databases are automatically created when a Raw Table is created.
547
+ continue
548
+ relative_path = path.relative_to(project_config_dir)
549
+
550
+ required_by.add((required, relative_path))
550
551
  has_checked_cdf = client is not None
551
552
  self.warn(MissingDependencyWarning(loader_cls.resource_cls.__name__, id_, required_by, has_checked_cdf))
552
553
 
@@ -12,7 +12,7 @@ jobs:
12
12
  environment: dev
13
13
  name: Deploy
14
14
  container:
15
- image: cognite/toolkit:0.7.51
15
+ image: cognite/toolkit:0.7.53
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.51
13
+ image: cognite/toolkit:0.7.53
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.51"
7
+ version = "0.7.53"
8
8
 
9
9
 
10
10
  [plugins]
@@ -1 +1 @@
1
- __version__ = "0.7.51"
1
+ __version__ = "0.7.53"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite_toolkit
3
- Version: 0.7.51
3
+ Version: 0.7.53
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>
@@ -235,14 +235,14 @@ cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py,sha256=ZrmI_jx6sf7G027
235
235
  cognite_toolkit/_cdf_tk/commands/_migrate/prepare.py,sha256=RfqaNoso5CyBwc-p6ckwcYqBfZXKhdJgdGIyd0TATaI,2635
236
236
  cognite_toolkit/_cdf_tk/commands/_migrate/selectors.py,sha256=N1H_-rBpPUD6pbrlcofn1uEK1bA694EUXEe1zIXeqyo,2489
237
237
  cognite_toolkit/_cdf_tk/commands/_profile.py,sha256=c42Na8r1Xcd1zSIJtU8eZMQTFBTzNmxtTIBLKBePzyA,43131
238
- cognite_toolkit/_cdf_tk/commands/_purge.py,sha256=PsvKupMX5xdCgZ0qbVqWuHemZuNHjwr6sp1aqpKq4vM,32769
238
+ cognite_toolkit/_cdf_tk/commands/_purge.py,sha256=5r5zgzalGvzd4NYGY-rKFvpzn9JdsLeKJpPbjkBKc2U,32832
239
239
  cognite_toolkit/_cdf_tk/commands/_questionary_style.py,sha256=h-w7fZKkGls3TrzIGBKjsZSGoXJJIYchgD1StfA40r8,806
240
240
  cognite_toolkit/_cdf_tk/commands/_upload.py,sha256=ncI1XIKRsqLzCPFS6twsKwKdpcrS6QKwzQpC8-uv0X4,13041
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
244
  cognite_toolkit/_cdf_tk/commands/auth.py,sha256=TX_8YuVCjMVIQjEdfBE66bSDrojJhCnxf_jcT3-9wM8,32550
245
- cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=vpEEf9plCeY1OJnvm4P38wsqVLLSVH00TMjpwAHw-IY,28970
245
+ cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=NuHbOj0xMbyuESlP716GHZuD1IY-OMoSaTtx0NUnVmk,29092
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
248
248
  cognite_toolkit/_cdf_tk/commands/build_v2/_modules_parser.py,sha256=se9IhfwtbvWusqNeN2BzDnUEK3j97sN4Yugoh5xlc5U,6782
@@ -432,14 +432,14 @@ 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=3K9DCSzOO1xqbQxhpfVfpvA9dYUEjseeK6DuLkVvdpQ,667
436
- cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=tID_WryVZoCumE5DAOXx-qG_5_i8qd-SFsBNStBeock,2430
437
- cognite_toolkit/_resources/cdf.toml,sha256=LM6zJL52mkI_lBm3_JL4Dy5xXI5Z7VvtxcBspa6qjDA,475
438
- cognite_toolkit/_version.py,sha256=I4qtlZ6cCOsrtFWWncRAhM8aa4fioEzk6cvfsMrrTmg,23
435
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=sxXXSoM8YzyWhrMxweR-qD1x68m_mqXamz6koBYLQlI,667
436
+ cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=z9CsKojSJ6j5uBGEj-Swo5j3EqqIbGw9deWIp4zutlI,2430
437
+ cognite_toolkit/_resources/cdf.toml,sha256=Gvh7jHce3fx-TBX41R0ou7YSaxgvGkNVRJlJeH-6k7w,475
438
+ cognite_toolkit/_version.py,sha256=JP9RKOpQyDoUb8AfOg0ujLNcQLJPJfFX7VENgDRl3XU,23
439
439
  cognite_toolkit/config.dev.yaml,sha256=M33FiIKdS3XKif-9vXniQ444GTZ-bLXV8aFH86u9iUQ,332
440
440
  cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
441
441
  cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
442
- cognite_toolkit-0.7.51.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
443
- cognite_toolkit-0.7.51.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
444
- cognite_toolkit-0.7.51.dist-info/METADATA,sha256=wdWMHXbcZj6VOVK4fLVwcpyN0wyG81Q9XPT0iEuAWP0,5026
445
- cognite_toolkit-0.7.51.dist-info/RECORD,,
442
+ cognite_toolkit-0.7.53.dist-info/WHEEL,sha256=e_m4S054HL0hyR3CpOk-b7Q7fDX6BuFkgL5OjAExXas,80
443
+ cognite_toolkit-0.7.53.dist-info/entry_points.txt,sha256=EtZ17K2mUjh-AY0QNU1CPIB_aDSSOdmtNI_4Fj967mA,84
444
+ cognite_toolkit-0.7.53.dist-info/METADATA,sha256=jmWwjMBPQ8lUs6fueggE0guDcY7Q1dmYJG8v0KcaPn8,5026
445
+ cognite_toolkit-0.7.53.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.9.26
2
+ Generator: uv 0.9.27
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any