cognite-toolkit 0.7.62__py3-none-any.whl → 0.7.63__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/commands/_migrate/creators.py +9 -0
- 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.62.dist-info → cognite_toolkit-0.7.63.dist-info}/METADATA +1 -1
- {cognite_toolkit-0.7.62.dist-info → cognite_toolkit-0.7.63.dist-info}/RECORD +9 -9
- {cognite_toolkit-0.7.62.dist-info → cognite_toolkit-0.7.63.dist-info}/WHEEL +0 -0
- {cognite_toolkit-0.7.62.dist-info → cognite_toolkit-0.7.63.dist-info}/entry_points.txt +0 -0
|
@@ -20,6 +20,7 @@ from cognite.client.data_classes.documents import SourceFileProperty
|
|
|
20
20
|
from cognite.client.data_classes.events import EventProperty
|
|
21
21
|
|
|
22
22
|
from cognite_toolkit._cdf_tk.client import ToolkitClient
|
|
23
|
+
from cognite_toolkit._cdf_tk.client.resource_classes.data_modeling import NodeReference
|
|
23
24
|
from cognite_toolkit._cdf_tk.client.resource_classes.legacy.apm_config_v1 import APMConfig, APMConfigList
|
|
24
25
|
from cognite_toolkit._cdf_tk.cruds import NodeCRUD, ResourceCRUD, SpaceCRUD
|
|
25
26
|
from cognite_toolkit._cdf_tk.exceptions import ToolkitMissingResourceError, ToolkitRequiredValueError
|
|
@@ -146,6 +147,7 @@ class SourceSystemCreator(MigrationCreator[NodeApplyList]):
|
|
|
146
147
|
self.hierarchy = hierarchy
|
|
147
148
|
|
|
148
149
|
def create_resources(self) -> NodeApplyList:
|
|
150
|
+
existing_resources = self._get_existing_source_systems()
|
|
149
151
|
seen: set[str] = set()
|
|
150
152
|
nodes = NodeApplyList([])
|
|
151
153
|
for source in self._lookup_sources():
|
|
@@ -153,6 +155,9 @@ class SourceSystemCreator(MigrationCreator[NodeApplyList]):
|
|
|
153
155
|
if not isinstance(source_str, str) or source_str in seen:
|
|
154
156
|
continue
|
|
155
157
|
seen.add(source_str)
|
|
158
|
+
if existing_id := existing_resources.get(source_str):
|
|
159
|
+
self.client.console.print(f"Skipping {source_str} as it already exists in {existing_id!r}.")
|
|
160
|
+
continue
|
|
156
161
|
nodes.append(
|
|
157
162
|
NodeApply(
|
|
158
163
|
space=self._instance_space,
|
|
@@ -165,6 +170,10 @@ class SourceSystemCreator(MigrationCreator[NodeApplyList]):
|
|
|
165
170
|
)
|
|
166
171
|
return nodes
|
|
167
172
|
|
|
173
|
+
def _get_existing_source_systems(self) -> dict[str, NodeReference]:
|
|
174
|
+
all_existing = self.client.migration.created_source_system.list(limit=-1)
|
|
175
|
+
return {node.source: NodeReference(space=node.space, external_id=node.external_id) for node in all_existing}
|
|
176
|
+
|
|
168
177
|
def resource_configs(self, resources: NodeApplyList) -> list[ResourceConfig]:
|
|
169
178
|
output: list[ResourceConfig] = []
|
|
170
179
|
for node in resources:
|
cognite_toolkit/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.7.
|
|
1
|
+
__version__ = "0.7.63"
|
|
@@ -225,7 +225,7 @@ cognite_toolkit/_cdf_tk/commands/_import_cmd.py,sha256=_qUF8xdJFoXDbtDYGCVC6kz9k
|
|
|
225
225
|
cognite_toolkit/_cdf_tk/commands/_migrate/__init__.py,sha256=8ki04tJGH1dHdF2NtVF4HyhaC0XDDS7onrH_nvd9KtE,153
|
|
226
226
|
cognite_toolkit/_cdf_tk/commands/_migrate/command.py,sha256=meyp2cFcq5Wtq4FvELSqdwHRA45o9FMWFL_5AnXALvc,13587
|
|
227
227
|
cognite_toolkit/_cdf_tk/commands/_migrate/conversion.py,sha256=-LTIQUalqlRZxK0rfKWqljHLVh8VIH7yq_P-timfQDw,18318
|
|
228
|
-
cognite_toolkit/_cdf_tk/commands/_migrate/creators.py,sha256
|
|
228
|
+
cognite_toolkit/_cdf_tk/commands/_migrate/creators.py,sha256=-1dIhKKSbyfH9Wcc1BVP_WTOMhW4CvRFQ5gBBGquXIE,10241
|
|
229
229
|
cognite_toolkit/_cdf_tk/commands/_migrate/data_classes.py,sha256=_b2hXpTUI2_t-WKHzYXw1iSGb3w4pcIb53CTi9rbJ7k,13667
|
|
230
230
|
cognite_toolkit/_cdf_tk/commands/_migrate/data_mapper.py,sha256=qHYeFCBBGPejbgC_g_uHNM8fJLBkxWBBNKLFILkPaTI,28097
|
|
231
231
|
cognite_toolkit/_cdf_tk/commands/_migrate/data_model.py,sha256=0lRyDRJ8zo00OngwWagQgHQIaemK4eufW9kbWwZ9Yo0,7901
|
|
@@ -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=
|
|
436
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=
|
|
437
|
-
cognite_toolkit/_resources/cdf.toml,sha256=
|
|
438
|
-
cognite_toolkit/_version.py,sha256
|
|
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
|
|
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.
|
|
442
|
-
cognite_toolkit-0.7.
|
|
443
|
-
cognite_toolkit-0.7.
|
|
444
|
-
cognite_toolkit-0.7.
|
|
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,,
|
|
File without changes
|
|
File without changes
|