cognite-toolkit 0.6.112__py3-none-any.whl → 0.6.114__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.py +0 -2
- cognite_toolkit/_cdf_tk/apps/_download_app.py +82 -0
- cognite_toolkit/_cdf_tk/apps/_run.py +13 -0
- cognite_toolkit/_cdf_tk/client/data_classes/canvas.py +46 -3
- cognite_toolkit/_cdf_tk/commands/build_cmd.py +11 -0
- cognite_toolkit/_cdf_tk/commands/init.py +16 -12
- cognite_toolkit/_cdf_tk/commands/modules.py +1 -0
- cognite_toolkit/_cdf_tk/cruds/__init__.py +5 -1
- cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py +7 -7
- cognite_toolkit/_cdf_tk/feature_flags.py +4 -0
- cognite_toolkit/_cdf_tk/storageio/_applications.py +179 -7
- cognite_toolkit/_cdf_tk/storageio/selectors/__init__.py +3 -1
- cognite_toolkit/_cdf_tk/storageio/selectors/_canvas.py +14 -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.6.112.dist-info → cognite_toolkit-0.6.114.dist-info}/METADATA +1 -1
- {cognite_toolkit-0.6.112.dist-info → cognite_toolkit-0.6.114.dist-info}/RECORD +22 -22
- {cognite_toolkit-0.6.112.dist-info → cognite_toolkit-0.6.114.dist-info}/WHEEL +0 -0
- {cognite_toolkit-0.6.112.dist-info → cognite_toolkit-0.6.114.dist-info}/entry_points.txt +0 -0
- {cognite_toolkit-0.6.112.dist-info → cognite_toolkit-0.6.114.dist-info}/licenses/LICENSE +0 -0
cognite_toolkit/_cdf.py
CHANGED
|
@@ -94,8 +94,6 @@ _app.add_typer(RepoApp(**default_typer_kws), name="repo")
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
if Plugins.run.value.is_enabled():
|
|
97
|
-
if Flags.v07.is_enabled():
|
|
98
|
-
print("The run plugin is deprecated and will be replaced by the dev plugin in v0.8.0.")
|
|
99
97
|
_app.add_typer(RunApp(**default_typer_kws), name="run")
|
|
100
98
|
|
|
101
99
|
if Plugins.dump.value.is_enabled():
|
|
@@ -12,6 +12,7 @@ from cognite_toolkit._cdf_tk.commands import DownloadCommand
|
|
|
12
12
|
from cognite_toolkit._cdf_tk.constants import DATA_DEFAULT_DIR
|
|
13
13
|
from cognite_toolkit._cdf_tk.storageio import (
|
|
14
14
|
AssetIO,
|
|
15
|
+
CanvasIO,
|
|
15
16
|
ChartIO,
|
|
16
17
|
EventIO,
|
|
17
18
|
FileMetadataIO,
|
|
@@ -22,6 +23,8 @@ from cognite_toolkit._cdf_tk.storageio import (
|
|
|
22
23
|
)
|
|
23
24
|
from cognite_toolkit._cdf_tk.storageio.selectors import (
|
|
24
25
|
AssetSubtreeSelector,
|
|
26
|
+
CanvasExternalIdSelector,
|
|
27
|
+
CanvasSelector,
|
|
25
28
|
ChartExternalIdSelector,
|
|
26
29
|
ChartSelector,
|
|
27
30
|
DataSetSelector,
|
|
@@ -37,6 +40,7 @@ from cognite_toolkit._cdf_tk.utils.interactive_select import (
|
|
|
37
40
|
DataModelingSelect,
|
|
38
41
|
EventInteractiveSelect,
|
|
39
42
|
FileMetadataInteractiveSelect,
|
|
43
|
+
InteractiveCanvasSelect,
|
|
40
44
|
InteractiveChartSelect,
|
|
41
45
|
RawTableInteractiveSelect,
|
|
42
46
|
TimeSeriesInteractiveSelect,
|
|
@@ -67,6 +71,10 @@ class ChartFormats(str, Enum):
|
|
|
67
71
|
ndjson = "ndjson"
|
|
68
72
|
|
|
69
73
|
|
|
74
|
+
class CanvasFormats(str, Enum):
|
|
75
|
+
ndjson = "ndjson"
|
|
76
|
+
|
|
77
|
+
|
|
70
78
|
class InstanceTypes(str, Enum):
|
|
71
79
|
node = "node"
|
|
72
80
|
edge = "edge"
|
|
@@ -92,6 +100,7 @@ class DownloadApp(typer.Typer):
|
|
|
92
100
|
self.command("hierarchy")(self.download_hierarchy_cmd)
|
|
93
101
|
self.command("instances")(self.download_instances_cmd)
|
|
94
102
|
self.command("charts")(self.download_charts_cmd)
|
|
103
|
+
self.command("canvas")(self.download_canvas_cmd)
|
|
95
104
|
|
|
96
105
|
@staticmethod
|
|
97
106
|
def download_main(ctx: typer.Context) -> None:
|
|
@@ -840,3 +849,76 @@ class DownloadApp(typer.Typer):
|
|
|
840
849
|
verbose=verbose,
|
|
841
850
|
)
|
|
842
851
|
)
|
|
852
|
+
|
|
853
|
+
@staticmethod
|
|
854
|
+
def download_canvas_cmd(
|
|
855
|
+
ctx: typer.Context,
|
|
856
|
+
external_ids: Annotated[
|
|
857
|
+
list[str] | None,
|
|
858
|
+
typer.Argument(
|
|
859
|
+
help="List of canvas external IDs to download. If not provided, an interactive selection will be made.",
|
|
860
|
+
),
|
|
861
|
+
] = None,
|
|
862
|
+
file_format: Annotated[
|
|
863
|
+
CanvasFormats,
|
|
864
|
+
typer.Option(
|
|
865
|
+
"--format",
|
|
866
|
+
"-f",
|
|
867
|
+
help="Format for downloading the canvas.",
|
|
868
|
+
),
|
|
869
|
+
] = CanvasFormats.ndjson,
|
|
870
|
+
compression: Annotated[
|
|
871
|
+
CompressionFormat,
|
|
872
|
+
typer.Option(
|
|
873
|
+
"--compression",
|
|
874
|
+
"-z",
|
|
875
|
+
help="Compression format to use when downloading the canvas.",
|
|
876
|
+
),
|
|
877
|
+
] = CompressionFormat.none,
|
|
878
|
+
output_dir: Annotated[
|
|
879
|
+
Path,
|
|
880
|
+
typer.Option(
|
|
881
|
+
"--output-dir",
|
|
882
|
+
"-o",
|
|
883
|
+
help="Where to download the canvas.",
|
|
884
|
+
allow_dash=True,
|
|
885
|
+
),
|
|
886
|
+
] = DEFAULT_DOWNLOAD_DIR,
|
|
887
|
+
limit: Annotated[
|
|
888
|
+
int,
|
|
889
|
+
typer.Option(
|
|
890
|
+
"--limit",
|
|
891
|
+
"-l",
|
|
892
|
+
help="The maximum number of canvas to download. Use -1 to download all canvas.",
|
|
893
|
+
),
|
|
894
|
+
] = 1000,
|
|
895
|
+
verbose: Annotated[
|
|
896
|
+
bool,
|
|
897
|
+
typer.Option(
|
|
898
|
+
"--verbose",
|
|
899
|
+
"-v",
|
|
900
|
+
help="Turn on to get more verbose output when running the command",
|
|
901
|
+
),
|
|
902
|
+
] = False,
|
|
903
|
+
) -> None:
|
|
904
|
+
"""This command will download Canvas from CDF into a temporary directory."""
|
|
905
|
+
cmd = DownloadCommand()
|
|
906
|
+
client = EnvironmentVariables.create_from_environment().get_client()
|
|
907
|
+
selector: CanvasSelector
|
|
908
|
+
if external_ids is None:
|
|
909
|
+
selected_external_ids = InteractiveCanvasSelect(client).select_external_ids()
|
|
910
|
+
selector = CanvasExternalIdSelector(external_ids=tuple(selected_external_ids))
|
|
911
|
+
else:
|
|
912
|
+
selector = CanvasExternalIdSelector(external_ids=tuple(external_ids))
|
|
913
|
+
|
|
914
|
+
cmd.run(
|
|
915
|
+
lambda: cmd.download(
|
|
916
|
+
selectors=[selector],
|
|
917
|
+
io=CanvasIO(client),
|
|
918
|
+
output_dir=output_dir,
|
|
919
|
+
file_format=f".{file_format.value}",
|
|
920
|
+
compression=compression.value,
|
|
921
|
+
limit=limit if limit != -1 else None,
|
|
922
|
+
verbose=verbose,
|
|
923
|
+
)
|
|
924
|
+
)
|
|
@@ -10,6 +10,7 @@ from cognite_toolkit._cdf_tk.commands import (
|
|
|
10
10
|
RunTransformationCommand,
|
|
11
11
|
RunWorkflowCommand,
|
|
12
12
|
)
|
|
13
|
+
from cognite_toolkit._cdf_tk.feature_flags import Flags
|
|
13
14
|
from cognite_toolkit._cdf_tk.utils.auth import EnvironmentVariables
|
|
14
15
|
|
|
15
16
|
CDF_TOML = CDFToml.load(Path.cwd())
|
|
@@ -23,9 +24,16 @@ class RunApp(typer.Typer):
|
|
|
23
24
|
self.command("workflow")(self.run_workflow)
|
|
24
25
|
self.add_typer(RunFunctionApp(*args, **kwargs), name="function")
|
|
25
26
|
|
|
27
|
+
@staticmethod
|
|
28
|
+
def _print_deprecation_warning() -> None:
|
|
29
|
+
"""Print deprecation warning for the run plugin."""
|
|
30
|
+
if Flags.v07.is_enabled():
|
|
31
|
+
print("The run plugin is deprecated and will be replaced by the dev plugin in v0.8.0.")
|
|
32
|
+
|
|
26
33
|
@staticmethod
|
|
27
34
|
def main(ctx: typer.Context) -> None:
|
|
28
35
|
"""Commands to execute processes in CDF."""
|
|
36
|
+
RunApp._print_deprecation_warning()
|
|
29
37
|
if ctx.invoked_subcommand is None:
|
|
30
38
|
print("Use [bold yellow]cdf run --help[/] for more information.")
|
|
31
39
|
|
|
@@ -51,6 +59,7 @@ class RunApp(typer.Typer):
|
|
|
51
59
|
] = False,
|
|
52
60
|
) -> None:
|
|
53
61
|
"""This command will run the specified transformation using a one-time session."""
|
|
62
|
+
RunApp._print_deprecation_warning()
|
|
54
63
|
cmd = RunTransformationCommand()
|
|
55
64
|
client = EnvironmentVariables.create_from_environment().get_client()
|
|
56
65
|
cmd.run(lambda: cmd.run_transformation(client, external_id))
|
|
@@ -108,6 +117,7 @@ class RunApp(typer.Typer):
|
|
|
108
117
|
] = False,
|
|
109
118
|
) -> None:
|
|
110
119
|
"""This command will run the specified workflow."""
|
|
120
|
+
RunApp._print_deprecation_warning()
|
|
111
121
|
cmd = RunWorkflowCommand()
|
|
112
122
|
env_vars = EnvironmentVariables.create_from_environment()
|
|
113
123
|
cmd.run(lambda: cmd.run_workflow(env_vars, organization_dir, env_name, external_id, version, wait))
|
|
@@ -123,6 +133,7 @@ class RunFunctionApp(typer.Typer):
|
|
|
123
133
|
@staticmethod
|
|
124
134
|
def main(ctx: typer.Context) -> None:
|
|
125
135
|
"""Commands to execute function."""
|
|
136
|
+
RunApp._print_deprecation_warning()
|
|
126
137
|
if ctx.invoked_subcommand is None:
|
|
127
138
|
print("Use [bold yellow]cdf run function --help[/] for more information.")
|
|
128
139
|
|
|
@@ -178,6 +189,7 @@ class RunFunctionApp(typer.Typer):
|
|
|
178
189
|
] = False,
|
|
179
190
|
) -> None:
|
|
180
191
|
"""This command will run the specified function locally."""
|
|
192
|
+
RunApp._print_deprecation_warning()
|
|
181
193
|
cmd = RunFunctionCommand()
|
|
182
194
|
env_vars = EnvironmentVariables.create_from_environment()
|
|
183
195
|
cmd.run(
|
|
@@ -243,6 +255,7 @@ class RunFunctionApp(typer.Typer):
|
|
|
243
255
|
] = False,
|
|
244
256
|
) -> None:
|
|
245
257
|
"""This command will run the specified function (assuming it is deployed) in CDF."""
|
|
258
|
+
RunApp._print_deprecation_warning()
|
|
246
259
|
cmd = RunFunctionCommand()
|
|
247
260
|
env_vars = EnvironmentVariables.create_from_environment()
|
|
248
261
|
cmd.run(lambda: cmd.run_cdf(env_vars, organization_dir, env_name, external_id, schedule, wait))
|
|
@@ -2,7 +2,7 @@ import sys
|
|
|
2
2
|
from abc import ABC
|
|
3
3
|
from collections.abc import Sequence
|
|
4
4
|
from datetime import datetime, timezone
|
|
5
|
-
from typing import Any
|
|
5
|
+
from typing import Any, TypeVar
|
|
6
6
|
from uuid import uuid4
|
|
7
7
|
|
|
8
8
|
from cognite.client import CogniteClient
|
|
@@ -31,6 +31,7 @@ from cognite.client.data_classes.data_modeling.instances import (
|
|
|
31
31
|
)
|
|
32
32
|
|
|
33
33
|
from cognite_toolkit._cdf_tk.client.data_classes.migration import AssetCentricId
|
|
34
|
+
from cognite_toolkit._cdf_tk.utils.useful_types import JsonVal
|
|
34
35
|
|
|
35
36
|
if sys.version_info >= (3, 11):
|
|
36
37
|
from typing import Self
|
|
@@ -68,6 +69,9 @@ class ExtendedTypedNodeApply(TypedNodeApply, ABC):
|
|
|
68
69
|
return output
|
|
69
70
|
|
|
70
71
|
|
|
72
|
+
T_ExtendedTypedNodeApply = TypeVar("T_ExtendedTypedNodeApply", bound=ExtendedTypedNodeApply)
|
|
73
|
+
|
|
74
|
+
|
|
71
75
|
class _CanvasProperties:
|
|
72
76
|
created_by = PropertyOptions("createdBy")
|
|
73
77
|
updated_at = PropertyOptions("updatedAt")
|
|
@@ -901,7 +905,7 @@ class IndustrialCanvasApply(CogniteResource):
|
|
|
901
905
|
raise TypeError(f"Unexpected instance type: {type(instance)}")
|
|
902
906
|
return ids
|
|
903
907
|
|
|
904
|
-
def dump(self, keep_existing_version: bool = True) -> dict[str,
|
|
908
|
+
def dump(self, keep_existing_version: bool = True) -> dict[str, JsonVal]:
|
|
905
909
|
"""Dump the IndustrialCanvasApply to a dictionary."""
|
|
906
910
|
return {
|
|
907
911
|
"canvas": self.canvas.dump(keep_existing_version=keep_existing_version),
|
|
@@ -953,7 +957,46 @@ class IndustrialCanvasApply(CogniteResource):
|
|
|
953
957
|
@classmethod
|
|
954
958
|
def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = None) -> Self:
|
|
955
959
|
"""Load an IndustrialCanvasApply instance from a resource dictionary."""
|
|
956
|
-
|
|
960
|
+
if "canvas" not in resource:
|
|
961
|
+
raise ValueError("Resource does not contain a canvas node.")
|
|
962
|
+
canvas_resource = resource["canvas"]
|
|
963
|
+
if isinstance(canvas_resource, dict):
|
|
964
|
+
canvas = CanvasApply._load(canvas_resource)
|
|
965
|
+
elif isinstance(canvas_resource, CanvasApply):
|
|
966
|
+
canvas = canvas_resource
|
|
967
|
+
elif isinstance(canvas_resource, NodeApply):
|
|
968
|
+
canvas = CanvasApply._load(canvas_resource.dump())
|
|
969
|
+
else:
|
|
970
|
+
raise TypeError(f"Canvas resource {type(canvas_resource)} is not supported.")
|
|
971
|
+
return cls(
|
|
972
|
+
canvas=canvas,
|
|
973
|
+
annotations=cls._load_apply_items(resource.get("annotations"), CanvasAnnotationApply),
|
|
974
|
+
container_references=cls._load_apply_items(resource.get("containerReferences"), ContainerReferenceApply),
|
|
975
|
+
fdm_instance_container_references=cls._load_apply_items(
|
|
976
|
+
resource.get("fdmInstanceContainerReferences"), FdmInstanceContainerReferenceApply
|
|
977
|
+
),
|
|
978
|
+
solution_tags=cls._load_apply_items(resource.get("solutionTags"), CogniteSolutionTagApply),
|
|
979
|
+
)
|
|
980
|
+
|
|
981
|
+
@classmethod
|
|
982
|
+
def _load_apply_items(
|
|
983
|
+
cls, items: object | None, node_cls: type[T_ExtendedTypedNodeApply]
|
|
984
|
+
) -> list[T_ExtendedTypedNodeApply]:
|
|
985
|
+
if items is None:
|
|
986
|
+
return []
|
|
987
|
+
elif isinstance(items, Sequence):
|
|
988
|
+
nodes: list[T_ExtendedTypedNodeApply] = []
|
|
989
|
+
for node in items:
|
|
990
|
+
if isinstance(node, dict):
|
|
991
|
+
nodes.append(node_cls._load(node))
|
|
992
|
+
elif isinstance(node, node_cls):
|
|
993
|
+
nodes.append(node)
|
|
994
|
+
elif isinstance(node, NodeApply):
|
|
995
|
+
nodes.append(node_cls._load(node.dump()))
|
|
996
|
+
else:
|
|
997
|
+
raise TypeError(f"Expected a sequence of {node_cls.__name__}, got {type(node).__name__}")
|
|
998
|
+
return nodes
|
|
999
|
+
raise TypeError(f"Expected a sequence of {node_cls.__name__}, got {type(items).__name__}")
|
|
957
1000
|
|
|
958
1001
|
|
|
959
1002
|
class IndustrialCanvas(WriteableCogniteResource[IndustrialCanvasApply]):
|
|
@@ -65,6 +65,7 @@ from cognite_toolkit._cdf_tk.exceptions import (
|
|
|
65
65
|
ToolkitMissingModuleError,
|
|
66
66
|
ToolkitYAMLFormatError,
|
|
67
67
|
)
|
|
68
|
+
from cognite_toolkit._cdf_tk.feature_flags import Flags
|
|
68
69
|
from cognite_toolkit._cdf_tk.hints import Hint, ModuleDefinition, verify_module_directory
|
|
69
70
|
from cognite_toolkit._cdf_tk.tk_warnings import (
|
|
70
71
|
DuplicatedItemWarning,
|
|
@@ -358,6 +359,16 @@ class BuildCommand(ToolkitCommand):
|
|
|
358
359
|
for resource_name, resource_files in module.source_paths_by_resource_folder.items():
|
|
359
360
|
source_files = self._replace_variables(resource_files, module_variables, resource_name, module.dir, verbose)
|
|
360
361
|
|
|
362
|
+
if resource_name == "data_models":
|
|
363
|
+
resource_name = "data_modeling"
|
|
364
|
+
if Flags.v07:
|
|
365
|
+
self.warn(
|
|
366
|
+
MediumSeverityWarning(
|
|
367
|
+
"The resource folder 'data_models' is deprecated and will be removed in v1.0. "
|
|
368
|
+
"Please rename the folder to 'data_modeling'."
|
|
369
|
+
)
|
|
370
|
+
)
|
|
371
|
+
|
|
361
372
|
builder = self._get_builder(build_dir, resource_name)
|
|
362
373
|
|
|
363
374
|
built_resources = BuiltResourceList[Hashable]()
|
|
@@ -19,7 +19,7 @@ from cognite_toolkit._cdf_tk.commands.collect import CollectCommand
|
|
|
19
19
|
from cognite_toolkit._cdf_tk.commands.modules import ModulesCommand
|
|
20
20
|
from cognite_toolkit._cdf_tk.commands.repo import RepoCommand
|
|
21
21
|
from cognite_toolkit._cdf_tk.exceptions import ToolkitError
|
|
22
|
-
from cognite_toolkit._cdf_tk.feature_flags import Flags
|
|
22
|
+
from cognite_toolkit._cdf_tk.feature_flags import FeatureFlag, Flags
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class InitItemStatus(Enum):
|
|
@@ -32,8 +32,6 @@ class InitItemStatus(Enum):
|
|
|
32
32
|
|
|
33
33
|
@dataclass
|
|
34
34
|
class InitChecklistItem:
|
|
35
|
-
"""Represents an item in the init checklist"""
|
|
36
|
-
|
|
37
35
|
name: str
|
|
38
36
|
description: str
|
|
39
37
|
function: Callable[[], None]
|
|
@@ -41,7 +39,6 @@ class InitChecklistItem:
|
|
|
41
39
|
mandatory: bool = False
|
|
42
40
|
|
|
43
41
|
def get_status_display(self) -> str:
|
|
44
|
-
"""Get a display string for the status"""
|
|
45
42
|
if self.status == InitItemStatus.SUCCESSFUL:
|
|
46
43
|
return "✓"
|
|
47
44
|
elif self.status == InitItemStatus.FAILED:
|
|
@@ -50,12 +47,17 @@ class InitChecklistItem:
|
|
|
50
47
|
return "○"
|
|
51
48
|
|
|
52
49
|
def get_choice_title(self) -> str:
|
|
53
|
-
"""Get the title for the questionary choice"""
|
|
54
50
|
status_icon = self.get_status_display()
|
|
55
51
|
return f"{status_icon} {self.description} (required)" if self.mandatory else f"{status_icon} {self.description}"
|
|
56
52
|
|
|
57
53
|
|
|
58
54
|
class InitCommand(ToolkitCommand):
|
|
55
|
+
organization_dir: Path | None
|
|
56
|
+
|
|
57
|
+
def __init__(self, print_warning: bool = True, skip_tracking: bool = False, silent: bool = False) -> None:
|
|
58
|
+
super().__init__(print_warning, skip_tracking, silent)
|
|
59
|
+
self.organization_dir = None
|
|
60
|
+
|
|
59
61
|
def execute(self, dry_run: bool = False, emulate_dot_seven: bool = False) -> None:
|
|
60
62
|
if not Flags.v07.is_enabled() and not emulate_dot_seven:
|
|
61
63
|
print("This command is deprecated. Use 'cdf modules init' instead.")
|
|
@@ -140,7 +142,6 @@ class InitCommand(ToolkitCommand):
|
|
|
140
142
|
if selected == "__exit__":
|
|
141
143
|
if all_mandatory_complete:
|
|
142
144
|
print("Setup complete!")
|
|
143
|
-
print("You can now start using the Cognite Toolkit.")
|
|
144
145
|
break
|
|
145
146
|
else:
|
|
146
147
|
incomplete_mandatory = [
|
|
@@ -168,7 +169,6 @@ class InitCommand(ToolkitCommand):
|
|
|
168
169
|
if not confirm:
|
|
169
170
|
continue
|
|
170
171
|
|
|
171
|
-
# Run the function
|
|
172
172
|
try:
|
|
173
173
|
selected_item.function()
|
|
174
174
|
selected_item.status = InitItemStatus.SUCCESSFUL
|
|
@@ -188,12 +188,14 @@ class InitCommand(ToolkitCommand):
|
|
|
188
188
|
print(f"Unexpected error occurred. Full traceback:\n{traceback.format_exc()}")
|
|
189
189
|
|
|
190
190
|
def _init_toml(self, dry_run: bool = False) -> None:
|
|
191
|
-
organization_dir
|
|
191
|
+
if self.organization_dir is None:
|
|
192
|
+
self.organization_dir = ModulesCommand._prompt_organization_dir()
|
|
192
193
|
if dry_run:
|
|
193
194
|
print("Would initialize cdf.toml configuration file")
|
|
194
195
|
return
|
|
195
|
-
CDFToml.write(organization_dir, "dev")
|
|
196
|
-
|
|
196
|
+
CDFToml.write(self.organization_dir, "dev")
|
|
197
|
+
FeatureFlag.flush()
|
|
198
|
+
print(f"cdf.toml configuration file initialized in {self.organization_dir}")
|
|
197
199
|
|
|
198
200
|
def _init_auth(self, dry_run: bool = False) -> None:
|
|
199
201
|
auth_command = AuthCommand()
|
|
@@ -201,12 +203,14 @@ class InitCommand(ToolkitCommand):
|
|
|
201
203
|
|
|
202
204
|
def _init_modules(self, dry_run: bool = False) -> None:
|
|
203
205
|
with ModulesCommand() as modules_command:
|
|
206
|
+
if self.organization_dir is None:
|
|
207
|
+
self.organization_dir = ModulesCommand._prompt_organization_dir()
|
|
204
208
|
if dry_run:
|
|
205
209
|
organization_dir = Path(tempfile.mkdtemp(prefix="init_modules_", suffix=".tmp", dir=Path.cwd()))
|
|
206
210
|
modules_command.run(lambda: modules_command.init(organization_dir=organization_dir))
|
|
207
211
|
shutil.rmtree(organization_dir)
|
|
208
212
|
else:
|
|
209
|
-
modules_command.run(lambda: modules_command.init())
|
|
213
|
+
modules_command.run(lambda: modules_command.init(organization_dir=self.organization_dir))
|
|
210
214
|
|
|
211
215
|
def _init_repo(self, dry_run: bool = False) -> None:
|
|
212
216
|
repo_command = RepoCommand()
|
|
@@ -216,7 +220,7 @@ class InitCommand(ToolkitCommand):
|
|
|
216
220
|
"""Opt in to collect usage statistics"""
|
|
217
221
|
|
|
218
222
|
opt_in = questionary.confirm(
|
|
219
|
-
"Do you want to opt in to collect usage statistics?",
|
|
223
|
+
"Do you want to opt in to collect usage statistics? This will help us improve the Toolkit.",
|
|
220
224
|
default=True,
|
|
221
225
|
).ask()
|
|
222
226
|
if dry_run:
|
|
@@ -756,6 +756,7 @@ class ModulesCommand(ToolkitCommand):
|
|
|
756
756
|
"""
|
|
757
757
|
|
|
758
758
|
cdf_toml = CDFToml.load()
|
|
759
|
+
|
|
759
760
|
if (Flags.EXTERNAL_LIBRARIES.is_enabled() or user_library) and self._module_source_dir is None:
|
|
760
761
|
libraries = {"userdefined": user_library} if user_library else cdf_toml.libraries
|
|
761
762
|
|
|
@@ -106,6 +106,9 @@ for _loader in itertools.chain(
|
|
|
106
106
|
CRUDS_BY_FOLDER_NAME[_loader.folder_name].append(_loader) # type: ignore[arg-type, attr-defined]
|
|
107
107
|
del _loader # cleanup module namespace
|
|
108
108
|
|
|
109
|
+
# For backwards compatibility
|
|
110
|
+
CRUDS_BY_FOLDER_NAME["data_models"] = CRUDS_BY_FOLDER_NAME["data_modeling"] # Todo: Remove in v1.0
|
|
111
|
+
|
|
109
112
|
CRUD_LIST = list(itertools.chain.from_iterable(CRUDS_BY_FOLDER_NAME.values()))
|
|
110
113
|
RESOURCE_CRUD_LIST = [loader for loader in CRUD_LIST if issubclass(loader, ResourceCRUD)]
|
|
111
114
|
RESOURCE_CRUD_CONTAINER_LIST = [loader for loader in CRUD_LIST if issubclass(loader, ResourceContainerCRUD)]
|
|
@@ -123,7 +126,8 @@ ResourceTypes: TypeAlias = Literal[
|
|
|
123
126
|
"auth",
|
|
124
127
|
"cdf_applications",
|
|
125
128
|
"classic",
|
|
126
|
-
"
|
|
129
|
+
"data_modeling",
|
|
130
|
+
"data_models", # Todo: Remove in v1.0
|
|
127
131
|
"data_sets",
|
|
128
132
|
"hosted_extractors",
|
|
129
133
|
"locations",
|
|
@@ -120,7 +120,7 @@ from .auth import GroupAllScopedCRUD
|
|
|
120
120
|
@final
|
|
121
121
|
class SpaceCRUD(ResourceContainerCRUD[str, SpaceApply, Space, SpaceApplyList, SpaceList]):
|
|
122
122
|
item_name = "nodes and edges"
|
|
123
|
-
folder_name = "
|
|
123
|
+
folder_name = "data_modeling"
|
|
124
124
|
filename_pattern = r"^.*space$"
|
|
125
125
|
resource_cls = Space
|
|
126
126
|
resource_write_cls = SpaceApply
|
|
@@ -252,7 +252,7 @@ class SpaceCRUD(ResourceContainerCRUD[str, SpaceApply, Space, SpaceApplyList, Sp
|
|
|
252
252
|
|
|
253
253
|
class ContainerCRUD(ResourceContainerCRUD[ContainerId, ContainerApply, Container, ContainerApplyList, ContainerList]):
|
|
254
254
|
item_name = "nodes and edges"
|
|
255
|
-
folder_name = "
|
|
255
|
+
folder_name = "data_modeling"
|
|
256
256
|
filename_pattern = r"^.*container$"
|
|
257
257
|
resource_cls = Container
|
|
258
258
|
resource_write_cls = ContainerApply
|
|
@@ -516,7 +516,7 @@ class ContainerCRUD(ResourceContainerCRUD[ContainerId, ContainerApply, Container
|
|
|
516
516
|
|
|
517
517
|
|
|
518
518
|
class ViewCRUD(ResourceCRUD[ViewId, ViewApply, View, ViewApplyList, ViewList]):
|
|
519
|
-
folder_name = "
|
|
519
|
+
folder_name = "data_modeling"
|
|
520
520
|
filename_pattern = r"^.*view$"
|
|
521
521
|
resource_cls = View
|
|
522
522
|
resource_write_cls = ViewApply
|
|
@@ -857,7 +857,7 @@ class ViewCRUD(ResourceCRUD[ViewId, ViewApply, View, ViewApplyList, ViewList]):
|
|
|
857
857
|
|
|
858
858
|
@final
|
|
859
859
|
class DataModelCRUD(ResourceCRUD[DataModelId, DataModelApply, DataModel, DataModelApplyList, DataModelList]):
|
|
860
|
-
folder_name = "
|
|
860
|
+
folder_name = "data_modeling"
|
|
861
861
|
filename_pattern = r"^.*datamodel$"
|
|
862
862
|
resource_cls = DataModel
|
|
863
863
|
resource_write_cls = DataModelApply
|
|
@@ -991,7 +991,7 @@ class DataModelCRUD(ResourceCRUD[DataModelId, DataModelApply, DataModel, DataMod
|
|
|
991
991
|
@final
|
|
992
992
|
class NodeCRUD(ResourceContainerCRUD[NodeId, NodeApply, Node, NodeApplyList, NodeList]):
|
|
993
993
|
item_name = "nodes"
|
|
994
|
-
folder_name = "
|
|
994
|
+
folder_name = "data_modeling"
|
|
995
995
|
filename_pattern = r"^.*node$"
|
|
996
996
|
resource_cls = Node
|
|
997
997
|
resource_write_cls = NodeApply
|
|
@@ -1150,7 +1150,7 @@ class GraphQLCRUD(
|
|
|
1150
1150
|
DataModelId, GraphQLDataModelWrite, GraphQLDataModel, GraphQLDataModelWriteList, GraphQLDataModelList
|
|
1151
1151
|
]
|
|
1152
1152
|
):
|
|
1153
|
-
folder_name = "
|
|
1153
|
+
folder_name = "data_modeling"
|
|
1154
1154
|
filename_pattern = r"^.*GraphQLSchema"
|
|
1155
1155
|
resource_cls = GraphQLDataModel
|
|
1156
1156
|
resource_write_cls = GraphQLDataModelWrite
|
|
@@ -1350,7 +1350,7 @@ class GraphQLCRUD(
|
|
|
1350
1350
|
@final
|
|
1351
1351
|
class EdgeCRUD(ResourceContainerCRUD[EdgeId, EdgeApply, Edge, EdgeApplyList, EdgeList]):
|
|
1352
1352
|
item_name = "edges"
|
|
1353
|
-
folder_name = "
|
|
1353
|
+
folder_name = "data_modeling"
|
|
1354
1354
|
filename_pattern = r"^.*edge"
|
|
1355
1355
|
resource_cls = Edge
|
|
1356
1356
|
resource_write_cls = EdgeApply
|
|
@@ -6,11 +6,19 @@ from cognite_toolkit._cdf_tk.client.data_classes.canvas import (
|
|
|
6
6
|
)
|
|
7
7
|
from cognite_toolkit._cdf_tk.client.data_classes.charts import Chart, ChartList, ChartWrite
|
|
8
8
|
from cognite_toolkit._cdf_tk.exceptions import ToolkitNotImplementedError
|
|
9
|
+
from cognite_toolkit._cdf_tk.tk_warnings import MediumSeverityWarning
|
|
9
10
|
from cognite_toolkit._cdf_tk.utils.collection import chunker_sequence
|
|
10
11
|
from cognite_toolkit._cdf_tk.utils.useful_types import JsonVal
|
|
11
12
|
|
|
12
13
|
from ._base import Page, UploadableStorageIO, UploadItem
|
|
13
|
-
from .selectors import
|
|
14
|
+
from .selectors import (
|
|
15
|
+
AllChartsSelector,
|
|
16
|
+
CanvasExternalIdSelector,
|
|
17
|
+
CanvasSelector,
|
|
18
|
+
ChartExternalIdSelector,
|
|
19
|
+
ChartOwnerSelector,
|
|
20
|
+
ChartSelector,
|
|
21
|
+
)
|
|
14
22
|
|
|
15
23
|
|
|
16
24
|
class ChartIO(UploadableStorageIO[ChartSelector, Chart, ChartWrite]):
|
|
@@ -128,17 +136,181 @@ class CanvasIO(UploadableStorageIO[CanvasSelector, IndustrialCanvas, IndustrialC
|
|
|
128
136
|
return item.as_id()
|
|
129
137
|
|
|
130
138
|
def stream_data(self, selector: CanvasSelector, limit: int | None = None) -> Iterable[Page]:
|
|
131
|
-
|
|
139
|
+
if not isinstance(selector, CanvasExternalIdSelector):
|
|
140
|
+
raise ToolkitNotImplementedError(f"Unsupported selector type {type(selector).__name__!r} for CanvasIO")
|
|
141
|
+
canvas_ids = selector.external_ids
|
|
142
|
+
if limit is not None and len(canvas_ids) > limit:
|
|
143
|
+
canvas_ids = canvas_ids[:limit]
|
|
144
|
+
|
|
145
|
+
for chunk in chunker_sequence(canvas_ids, self.CHUNK_SIZE):
|
|
146
|
+
items: list[IndustrialCanvas] = []
|
|
147
|
+
for canvas_id in chunk:
|
|
148
|
+
canvas = self.client.canvas.industrial.retrieve(canvas_id)
|
|
149
|
+
if canvas is not None:
|
|
150
|
+
items.append(canvas)
|
|
151
|
+
else:
|
|
152
|
+
MediumSeverityWarning("Canvas with external ID {canvas_id!r} not found. Skipping.").print_warning(
|
|
153
|
+
console=self.client.console
|
|
154
|
+
)
|
|
155
|
+
yield Page(worker_id="main", items=items)
|
|
132
156
|
|
|
133
157
|
def count(self, selector: CanvasSelector) -> int | None:
|
|
134
|
-
|
|
158
|
+
if not isinstance(selector, CanvasExternalIdSelector):
|
|
159
|
+
raise ToolkitNotImplementedError(f"Unsupported selector type {type(selector).__name__!r} for CanvasIO")
|
|
160
|
+
return len(selector.external_ids)
|
|
135
161
|
|
|
136
162
|
def data_to_json_chunk(
|
|
137
163
|
self, data_chunk: Sequence[IndustrialCanvas], selector: CanvasSelector | None = None
|
|
138
164
|
) -> list[dict[str, JsonVal]]:
|
|
139
|
-
|
|
140
|
-
|
|
165
|
+
self._populate_id_cache(data_chunk)
|
|
166
|
+
return [self._dump_resource(canvas) for canvas in data_chunk]
|
|
167
|
+
|
|
168
|
+
def _populate_id_cache(self, data_chunk: Sequence[IndustrialCanvas]) -> None:
|
|
169
|
+
"""Populate the client's lookup cache with all referenced resources in the canvases."""
|
|
170
|
+
asset_ids: set[int] = set()
|
|
171
|
+
time_series_ids: set[int] = set()
|
|
172
|
+
event_ids: set[int] = set()
|
|
173
|
+
file_ids: set[int] = set()
|
|
174
|
+
for canvas in data_chunk:
|
|
175
|
+
for container_ref in canvas.container_references:
|
|
176
|
+
if container_ref.container_reference_type == "asset":
|
|
177
|
+
asset_ids.add(container_ref.resource_id)
|
|
178
|
+
elif container_ref.container_reference_type == "timeseries":
|
|
179
|
+
time_series_ids.add(container_ref.resource_id)
|
|
180
|
+
elif container_ref.container_reference_type == "event":
|
|
181
|
+
event_ids.add(container_ref.resource_id)
|
|
182
|
+
elif container_ref.container_reference_type == "file":
|
|
183
|
+
file_ids.add(container_ref.resource_id)
|
|
184
|
+
if asset_ids:
|
|
185
|
+
self.client.lookup.assets.external_id(list(asset_ids))
|
|
186
|
+
if time_series_ids:
|
|
187
|
+
self.client.lookup.time_series.external_id(list(time_series_ids))
|
|
188
|
+
if event_ids:
|
|
189
|
+
self.client.lookup.events.external_id(list(event_ids))
|
|
190
|
+
if file_ids:
|
|
191
|
+
self.client.lookup.files.external_id(list(file_ids))
|
|
192
|
+
|
|
193
|
+
def _dump_resource(self, canvas: IndustrialCanvas) -> dict[str, JsonVal]:
|
|
194
|
+
dumped = canvas.as_write().dump()
|
|
195
|
+
references = dumped.get("containerReferences", [])
|
|
196
|
+
if not isinstance(references, list):
|
|
197
|
+
return dumped
|
|
198
|
+
for container_ref in references:
|
|
199
|
+
if not isinstance(container_ref, dict):
|
|
200
|
+
continue
|
|
201
|
+
sources = container_ref.get("sources", [])
|
|
202
|
+
if not isinstance(sources, list) or len(sources) == 0:
|
|
203
|
+
continue
|
|
204
|
+
source = sources[0]
|
|
205
|
+
if not isinstance(source, dict) or "properties" not in source:
|
|
206
|
+
continue
|
|
207
|
+
properties = source["properties"]
|
|
208
|
+
if not isinstance(properties, dict):
|
|
209
|
+
continue
|
|
210
|
+
resource_id = properties.pop("resourceId", None)
|
|
211
|
+
if not isinstance(resource_id, int):
|
|
212
|
+
continue
|
|
213
|
+
reference_type = properties.get("containerReferenceType")
|
|
214
|
+
if reference_type == "asset":
|
|
215
|
+
external_id = self.client.lookup.assets.external_id(resource_id)
|
|
216
|
+
elif reference_type == "timeseries":
|
|
217
|
+
external_id = self.client.lookup.time_series.external_id(resource_id)
|
|
218
|
+
elif reference_type == "event":
|
|
219
|
+
external_id = self.client.lookup.events.external_id(resource_id)
|
|
220
|
+
elif reference_type == "file":
|
|
221
|
+
external_id = self.client.lookup.files.external_id(resource_id)
|
|
222
|
+
else:
|
|
223
|
+
continue
|
|
224
|
+
if external_id is not None:
|
|
225
|
+
properties["resourceExternalId"] = external_id
|
|
226
|
+
return dumped
|
|
227
|
+
|
|
228
|
+
def json_chunk_to_data(
|
|
229
|
+
self, data_chunk: list[tuple[str, dict[str, JsonVal]]]
|
|
230
|
+
) -> Sequence[UploadItem[IndustrialCanvasApply]]:
|
|
231
|
+
self._populate_external_id_cache([item_json for _, item_json in data_chunk])
|
|
232
|
+
return super().json_chunk_to_data(data_chunk)
|
|
233
|
+
|
|
234
|
+
def _populate_external_id_cache(self, item_jsons: Sequence[dict[str, JsonVal]]) -> None:
|
|
235
|
+
"""Populate the client's lookup cache with all referenced resources in the canvases."""
|
|
236
|
+
asset_external_ids: set[str] = set()
|
|
237
|
+
time_series_external_ids: set[str] = set()
|
|
238
|
+
event_external_ids: set[str] = set()
|
|
239
|
+
file_external_ids: set[str] = set()
|
|
240
|
+
for item_json in item_jsons:
|
|
241
|
+
references = item_json.get("containerReferences", [])
|
|
242
|
+
if not isinstance(references, list):
|
|
243
|
+
continue
|
|
244
|
+
for container_ref in references:
|
|
245
|
+
if not isinstance(container_ref, dict):
|
|
246
|
+
continue
|
|
247
|
+
sources = container_ref.get("sources", [])
|
|
248
|
+
if not isinstance(sources, list) or len(sources) == 0:
|
|
249
|
+
continue
|
|
250
|
+
source = sources[0]
|
|
251
|
+
if not isinstance(source, dict) or "properties" not in source:
|
|
252
|
+
continue
|
|
253
|
+
properties = source["properties"]
|
|
254
|
+
if not isinstance(properties, dict):
|
|
255
|
+
continue
|
|
256
|
+
|
|
257
|
+
resource_external_id = properties.get("resourceExternalId")
|
|
258
|
+
if not isinstance(resource_external_id, str):
|
|
259
|
+
continue
|
|
260
|
+
|
|
261
|
+
reference_type = properties.get("containerReferenceType")
|
|
262
|
+
if reference_type == "asset":
|
|
263
|
+
asset_external_ids.add(resource_external_id)
|
|
264
|
+
elif reference_type == "timeseries":
|
|
265
|
+
time_series_external_ids.add(resource_external_id)
|
|
266
|
+
elif reference_type == "event":
|
|
267
|
+
event_external_ids.add(resource_external_id)
|
|
268
|
+
elif reference_type == "file":
|
|
269
|
+
file_external_ids.add(resource_external_id)
|
|
270
|
+
|
|
271
|
+
if asset_external_ids:
|
|
272
|
+
self.client.lookup.assets.id(list(asset_external_ids))
|
|
273
|
+
if time_series_external_ids:
|
|
274
|
+
self.client.lookup.time_series.id(list(time_series_external_ids))
|
|
275
|
+
if event_external_ids:
|
|
276
|
+
self.client.lookup.events.id(list(event_external_ids))
|
|
277
|
+
if file_external_ids:
|
|
278
|
+
self.client.lookup.files.id(list(file_external_ids))
|
|
141
279
|
|
|
142
280
|
def json_to_resource(self, item_json: dict[str, JsonVal]) -> IndustrialCanvasApply:
|
|
143
|
-
|
|
144
|
-
|
|
281
|
+
return self._load_resource(item_json)
|
|
282
|
+
|
|
283
|
+
def _load_resource(self, item_json: dict[str, JsonVal]) -> IndustrialCanvasApply:
|
|
284
|
+
references = item_json.get("containerReferences", [])
|
|
285
|
+
if not isinstance(references, list):
|
|
286
|
+
return IndustrialCanvasApply._load(item_json)
|
|
287
|
+
for container_ref in references:
|
|
288
|
+
if not isinstance(container_ref, dict):
|
|
289
|
+
continue
|
|
290
|
+
sources = container_ref.get("sources", [])
|
|
291
|
+
if not isinstance(sources, list) or len(sources) == 0:
|
|
292
|
+
continue
|
|
293
|
+
source = sources[0]
|
|
294
|
+
if not isinstance(source, dict) or "properties" not in source:
|
|
295
|
+
continue
|
|
296
|
+
properties = source["properties"]
|
|
297
|
+
if not isinstance(properties, dict):
|
|
298
|
+
continue
|
|
299
|
+
resource_external_id = properties.pop("resourceExternalId", None)
|
|
300
|
+
if not isinstance(resource_external_id, str):
|
|
301
|
+
continue
|
|
302
|
+
reference_type = properties.get("containerReferenceType")
|
|
303
|
+
if reference_type == "asset":
|
|
304
|
+
resource_id = self.client.lookup.assets.id(resource_external_id)
|
|
305
|
+
elif reference_type == "timeseries":
|
|
306
|
+
resource_id = self.client.lookup.time_series.id(resource_external_id)
|
|
307
|
+
elif reference_type == "event":
|
|
308
|
+
resource_id = self.client.lookup.events.id(resource_external_id)
|
|
309
|
+
elif reference_type == "file":
|
|
310
|
+
resource_id = self.client.lookup.files.id(resource_external_id)
|
|
311
|
+
else:
|
|
312
|
+
continue
|
|
313
|
+
if resource_id is not None:
|
|
314
|
+
properties["resourceId"] = resource_id
|
|
315
|
+
|
|
316
|
+
return IndustrialCanvasApply._load(item_json)
|
|
@@ -4,7 +4,7 @@ from pydantic import Field, TypeAdapter
|
|
|
4
4
|
|
|
5
5
|
from ._asset_centric import AssetCentricFileSelector, AssetCentricSelector, AssetSubtreeSelector, DataSetSelector
|
|
6
6
|
from ._base import DataSelector
|
|
7
|
-
from ._canvas import CanvasSelector
|
|
7
|
+
from ._canvas import CanvasExternalIdSelector, CanvasSelector
|
|
8
8
|
from ._charts import AllChartsSelector, ChartExternalIdSelector, ChartOwnerSelector, ChartSelector
|
|
9
9
|
from ._datapoints import (
|
|
10
10
|
DataPointsFileSelector,
|
|
@@ -40,6 +40,7 @@ Selector = Annotated[
|
|
|
40
40
|
| DataSetSelector
|
|
41
41
|
| DataPointsFileSelector
|
|
42
42
|
| ChartExternalIdSelector
|
|
43
|
+
| CanvasExternalIdSelector
|
|
43
44
|
| FileMetadataTemplateSelector
|
|
44
45
|
| FileDataModelingTemplateSelector,
|
|
45
46
|
Field(discriminator="type"),
|
|
@@ -53,6 +54,7 @@ __all__ = [
|
|
|
53
54
|
"AssetCentricFileSelector",
|
|
54
55
|
"AssetCentricSelector",
|
|
55
56
|
"AssetSubtreeSelector",
|
|
57
|
+
"CanvasExternalIdSelector",
|
|
56
58
|
"CanvasSelector",
|
|
57
59
|
"ChartExternalIdSelector",
|
|
58
60
|
"ChartOwnerSelector",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import hashlib
|
|
1
2
|
from abc import ABC
|
|
2
3
|
from typing import Literal
|
|
3
4
|
|
|
@@ -6,3 +7,16 @@ from ._base import DataSelector
|
|
|
6
7
|
|
|
7
8
|
class CanvasSelector(DataSelector, ABC):
|
|
8
9
|
kind: Literal["IndustrialCanvas"] = "IndustrialCanvas"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CanvasExternalIdSelector(CanvasSelector):
|
|
13
|
+
type: Literal["canvasExternalId"] = "canvasExternalId"
|
|
14
|
+
external_ids: tuple[str, ...]
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def group(self) -> str:
|
|
18
|
+
return "Canvas"
|
|
19
|
+
|
|
20
|
+
def __str__(self) -> str:
|
|
21
|
+
hash_ = hashlib.md5(",".join(sorted(self.external_ids)).encode()).hexdigest()[:8]
|
|
22
|
+
return f"canvas_count_{len(self.external_ids)}_hash_{hash_}"
|
|
@@ -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.6.
|
|
7
|
+
version = "0.6.114"
|
|
8
8
|
|
|
9
9
|
[alpha_flags]
|
|
10
10
|
external-libraries = true
|
cognite_toolkit/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.6.
|
|
1
|
+
__version__ = "0.6.114"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite_toolkit
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.114
|
|
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,11 +1,11 @@
|
|
|
1
1
|
cognite_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
cognite_toolkit/_cdf.py,sha256=
|
|
3
|
-
cognite_toolkit/_version.py,sha256=
|
|
2
|
+
cognite_toolkit/_cdf.py,sha256=qr31QC3AhJukM-9rBeWHBTLuNU01XIXAtV5dzqOU3iA,5958
|
|
3
|
+
cognite_toolkit/_version.py,sha256=WpAvqBLX070lSyBy5k8WgKpdDgI8mm3_fsS28HTJsWg,24
|
|
4
4
|
cognite_toolkit/_cdf_tk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cognite_toolkit/_cdf_tk/cdf_toml.py,sha256=VSWV9h44HusWIaKpWgjrOMrc3hDoPTTXBXlp6-NOrIM,9079
|
|
6
6
|
cognite_toolkit/_cdf_tk/constants.py,sha256=aFcJkY03sYOJ92YfvcVpau-waj6akOAb4KgyIwKI-bs,7135
|
|
7
7
|
cognite_toolkit/_cdf_tk/exceptions.py,sha256=xG0jMwi5A20nvPvyo6sCyz_cyKycynPyIzpYiGR4gcU,6064
|
|
8
|
-
cognite_toolkit/_cdf_tk/feature_flags.py,sha256=
|
|
8
|
+
cognite_toolkit/_cdf_tk/feature_flags.py,sha256=TjwUmGG5qXBQ-8P1ongh2qQnuRfVRvGaP1JBtuUot88,3106
|
|
9
9
|
cognite_toolkit/_cdf_tk/hints.py,sha256=UI1ymi2T5wCcYOpEbKbVaDnlyFReFy8TDtMVt-5E1h8,6493
|
|
10
10
|
cognite_toolkit/_cdf_tk/plugins.py,sha256=JwaN_jrrky1PXBJ3tRpZ22cIcD01EB46WVFgp_bK-fQ,856
|
|
11
11
|
cognite_toolkit/_cdf_tk/protocols.py,sha256=Lc8XnBfmDZN6dwmSopmK7cFE9a9jZ2zdUryEeCXn27I,3052
|
|
@@ -16,7 +16,7 @@ cognite_toolkit/_cdf_tk/apps/_auth_app.py,sha256=ER7uYb3ViwsHMXiQEZpyhwU6TIjKaB9
|
|
|
16
16
|
cognite_toolkit/_cdf_tk/apps/_core_app.py,sha256=Xlhdv2MoCs2kBk0kgJixiy8ouCfixUWXuK3crEXAqB0,14032
|
|
17
17
|
cognite_toolkit/_cdf_tk/apps/_data_app.py,sha256=rFnTcUBAuoFcTQCjxwqZGG0HjUMGdYTFyBGXxWg5gXE,824
|
|
18
18
|
cognite_toolkit/_cdf_tk/apps/_dev_app.py,sha256=q8DBr4BAK33AwsHW3gAWZWSjSaQRuCisqPbsBjmYSxk,589
|
|
19
|
-
cognite_toolkit/_cdf_tk/apps/_download_app.py,sha256=
|
|
19
|
+
cognite_toolkit/_cdf_tk/apps/_download_app.py,sha256=g-VA51KI91wziVuO3w305rmr33xIb0ghYTtW06LhNz8,31994
|
|
20
20
|
cognite_toolkit/_cdf_tk/apps/_dump_app.py,sha256=Ec0aEqbKwCkxni09i06rfY31qZUyOVwbbvo7MHh4cf8,39056
|
|
21
21
|
cognite_toolkit/_cdf_tk/apps/_landing_app.py,sha256=HxzSln3fJXs5NzulfQGUMropXcwMobUYpyePrCrQTQs,1502
|
|
22
22
|
cognite_toolkit/_cdf_tk/apps/_migrate_app.py,sha256=g4S_53kbIgk57ziPLdRMuR6xUe434gkMqa69VmVm5Vg,39619
|
|
@@ -24,7 +24,7 @@ cognite_toolkit/_cdf_tk/apps/_modules_app.py,sha256=95_H2zccRJl2mWn0oQ5mjCaEDnG6
|
|
|
24
24
|
cognite_toolkit/_cdf_tk/apps/_profile_app.py,sha256=vSRJW54bEvIul8_4rOqyOYA7ztXx7TFOvZRZWZTxMbg,7007
|
|
25
25
|
cognite_toolkit/_cdf_tk/apps/_purge.py,sha256=e8IgDK2Fib2u30l71Q2trbJ1az90zSLWr5TViTINmL0,15415
|
|
26
26
|
cognite_toolkit/_cdf_tk/apps/_repo_app.py,sha256=jOf_s7oUWJqnRyz89JFiSzT2l8GlyQ7wqidHUQavGo0,1455
|
|
27
|
-
cognite_toolkit/_cdf_tk/apps/_run.py,sha256=
|
|
27
|
+
cognite_toolkit/_cdf_tk/apps/_run.py,sha256=9tn3o9iWtCP85KcLmnytIaIB_cj1EegtEm51r85Sl44,9082
|
|
28
28
|
cognite_toolkit/_cdf_tk/apps/_upload_app.py,sha256=OfXRUEoqCWFaZTb-KzuZrVdrAZ_f4DR4Wm1Votbs2W8,2146
|
|
29
29
|
cognite_toolkit/_cdf_tk/builders/__init__.py,sha256=Y-AJ4VrcUCRquGNEgDCiwmWW3iGWnJl2DrL17gsUIBg,1172
|
|
30
30
|
cognite_toolkit/_cdf_tk/builders/_base.py,sha256=N32Y17hfepp45rMW_o4qeUY9nsysmtcxpX4GkF-tsio,7829
|
|
@@ -74,7 +74,7 @@ cognite_toolkit/_cdf_tk/client/data_classes/__init__.py,sha256=47DEQpj8HBSa-_TIm
|
|
|
74
74
|
cognite_toolkit/_cdf_tk/client/data_classes/api_classes.py,sha256=X-aGFnYzSxXYDxlFP2rqJ8P10Um7bcRRUZxVVzblYBw,477
|
|
75
75
|
cognite_toolkit/_cdf_tk/client/data_classes/apm_config_v1.py,sha256=0bPq7R0qvdf8SMFS06kX7TXHIClDcJNHwdTBweQB-GU,20150
|
|
76
76
|
cognite_toolkit/_cdf_tk/client/data_classes/base.py,sha256=QG4S0HlByMB6zwxUXWaVHwP-DrA2Y97XGN_o6QsL6FY,2776
|
|
77
|
-
cognite_toolkit/_cdf_tk/client/data_classes/canvas.py,sha256=
|
|
77
|
+
cognite_toolkit/_cdf_tk/client/data_classes/canvas.py,sha256=DrE-7HOLnk1ELhydySsEhw-VOjriUqB_zzon5qb7CDk,50721
|
|
78
78
|
cognite_toolkit/_cdf_tk/client/data_classes/capabilities.py,sha256=muqpAC2JLCFcEpRPzuh_3sS3o_q42WFyfsGzl-LfB_U,8773
|
|
79
79
|
cognite_toolkit/_cdf_tk/client/data_classes/charts.py,sha256=l4LM1eqn8_2lRzw-DdwwL0zxgSczC0lp1LjgW-4wqPI,3770
|
|
80
80
|
cognite_toolkit/_cdf_tk/client/data_classes/charts_data.py,sha256=Zcx3st3bMJE2aa5U6TepDqRzqf-LuTTWW5grSaVGr9E,12244
|
|
@@ -112,15 +112,15 @@ cognite_toolkit/_cdf_tk/commands/_upload.py,sha256=g4DIgBv6chsa10KpIS3uxjCSZKE5H
|
|
|
112
112
|
cognite_toolkit/_cdf_tk/commands/_utils.py,sha256=UxMJW5QYKts4om5n6x2Tq2ihvfO9gWjhQKeqZNFTlKg,402
|
|
113
113
|
cognite_toolkit/_cdf_tk/commands/_virtual_env.py,sha256=GFAid4hplixmj9_HkcXqU5yCLj-fTXm4cloGD6U2swY,2180
|
|
114
114
|
cognite_toolkit/_cdf_tk/commands/auth.py,sha256=PLjfxfJJKaqux1eB2fycIRlwwSMCbM3qxWDnFX-blJU,31720
|
|
115
|
-
cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=
|
|
115
|
+
cognite_toolkit/_cdf_tk/commands/build_cmd.py,sha256=ppaSstd4zd5ZLcwwU9ueg3kH6MflxOL7DXnDuGAcbcY,31007
|
|
116
116
|
cognite_toolkit/_cdf_tk/commands/clean.py,sha256=KDcUn1MEpvk_K7WqQPBiZcIlGV61JVG6D0DcYUXj7BM,16567
|
|
117
117
|
cognite_toolkit/_cdf_tk/commands/collect.py,sha256=zBMKhhvjOpuASMnwP0eeHRI02tANcvFEZgv0CQO1ECc,627
|
|
118
118
|
cognite_toolkit/_cdf_tk/commands/deploy.py,sha256=R185y7oFr3yhh10RSPE81dpYX346ghVYOrVEF-JKaaI,23020
|
|
119
119
|
cognite_toolkit/_cdf_tk/commands/dump_data.py,sha256=8l4M2kqV4DjiV5js5s7EbFVNxV0Np4ld8ogw19vaJp0,21804
|
|
120
120
|
cognite_toolkit/_cdf_tk/commands/dump_resource.py,sha256=ylAFST3GgkWT1Qa-JIzmQXbrQgNCB1UrptrBf3WsyvY,39658
|
|
121
121
|
cognite_toolkit/_cdf_tk/commands/featureflag.py,sha256=lgLMwuNIwFjvvKn1sNMunkq4VTwdNqXtrZfdGFTrNcI,968
|
|
122
|
-
cognite_toolkit/_cdf_tk/commands/init.py,sha256=
|
|
123
|
-
cognite_toolkit/_cdf_tk/commands/modules.py,sha256=
|
|
122
|
+
cognite_toolkit/_cdf_tk/commands/init.py,sha256=M5qT6qMG2AxKwjsi8y6t9tLWBX4nb5uSYp4J6ER8M2A,9463
|
|
123
|
+
cognite_toolkit/_cdf_tk/commands/modules.py,sha256=buGS_SqbrSykechbh-MTfFNvl1VyPhrL_91JE4_jL4I,41092
|
|
124
124
|
cognite_toolkit/_cdf_tk/commands/pull.py,sha256=ktPXHW3f0HpmqCxeMhH8Ac52dAuQqAum3VBmLWJwQSM,39246
|
|
125
125
|
cognite_toolkit/_cdf_tk/commands/repo.py,sha256=MNy8MWphTklIZHvQOROCweq8_SYxGv6BaqnLpkFFnuk,3845
|
|
126
126
|
cognite_toolkit/_cdf_tk/commands/run.py,sha256=JyX9jLEQej9eRrHVCCNlw4GuF80qETSol3-T5CCofgw,37331
|
|
@@ -137,7 +137,7 @@ cognite_toolkit/_cdf_tk/commands/_migrate/issues.py,sha256=L2-kODPavEwcuhte7EXAN
|
|
|
137
137
|
cognite_toolkit/_cdf_tk/commands/_migrate/migration_io.py,sha256=wrdBH5P6NgiZQSYLR0iJ3ZvqfQ5fY-_Ne2yKv9E1g4o,16277
|
|
138
138
|
cognite_toolkit/_cdf_tk/commands/_migrate/prepare.py,sha256=RfqaNoso5CyBwc-p6ckwcYqBfZXKhdJgdGIyd0TATaI,2635
|
|
139
139
|
cognite_toolkit/_cdf_tk/commands/_migrate/selectors.py,sha256=N1H_-rBpPUD6pbrlcofn1uEK1bA694EUXEe1zIXeqyo,2489
|
|
140
|
-
cognite_toolkit/_cdf_tk/cruds/__init__.py,sha256=
|
|
140
|
+
cognite_toolkit/_cdf_tk/cruds/__init__.py,sha256=JLi1k2C2YitmV-Ez-TKcvTHnCnXDHMZSllh5iPwQ1KE,6474
|
|
141
141
|
cognite_toolkit/_cdf_tk/cruds/_base_cruds.py,sha256=3ExMHowKi9jV-EwfKL1jfeSfQLM59z8jZAGq_wJb5Jc,20088
|
|
142
142
|
cognite_toolkit/_cdf_tk/cruds/_data_cruds.py,sha256=PacTXdXaw0sf38tM6_DgNXVYdZXf_J90ZUeLk5v2VRg,9071
|
|
143
143
|
cognite_toolkit/_cdf_tk/cruds/_worker.py,sha256=XdLm6DMFln9DqDgEbeqzepw9WRSXx7WdChbDtmOc89Q,9358
|
|
@@ -147,7 +147,7 @@ cognite_toolkit/_cdf_tk/cruds/_resource_cruds/auth.py,sha256=iGG2_btpEqip3o6OKpc
|
|
|
147
147
|
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/classic.py,sha256=7RdiWvh6MLI1lLmt3gcqDQj61xbwREhsvoyjFuJn2F0,26402
|
|
148
148
|
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/configuration.py,sha256=KrL7bj8q5q18mGB2V-NDkW5U5nfseZOyorXiUbp2uLw,6100
|
|
149
149
|
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/data_organization.py,sha256=iXn9iAtwA8mhH-7j9GF-MlLomTcaw3GhEbFY28Wx0iA,9927
|
|
150
|
-
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py,sha256=
|
|
150
|
+
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/datamodel.py,sha256=kX5psba0lUlvKKabstJWxM8eZsHDD7rTR_FOkHBukBE,65837
|
|
151
151
|
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/extraction_pipeline.py,sha256=zv36HPO9goRmU3NM_i1wOvWQEdsgpQTI4bcAl-eis1g,18232
|
|
152
152
|
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/fieldops.py,sha256=SnQMbxiZ3SSYkTLXQ_vIu2HVf_WyD1jplNRJuoeOUfA,16723
|
|
153
153
|
cognite_toolkit/_cdf_tk/cruds/_resource_cruds/file.py,sha256=F3n2FOWAPder4z3OTYs81VB-6C6r3oUzJsHvigdhaD0,15500
|
|
@@ -240,7 +240,7 @@ cognite_toolkit/_cdf_tk/resource_classes/robotics/location.py,sha256=dbc9HT-bc2Q
|
|
|
240
240
|
cognite_toolkit/_cdf_tk/resource_classes/robotics/map.py,sha256=j77z7CzCMiMj8r94BdUKCum9EuZRUjaSlUAy9K9DL_Q,942
|
|
241
241
|
cognite_toolkit/_cdf_tk/storageio/__init__.py,sha256=T2PzfD2Tf5khE0cmSDLcqTlRy9YEKTU-raKePIFSMNQ,1910
|
|
242
242
|
cognite_toolkit/_cdf_tk/storageio/_annotations.py,sha256=JI_g18_Y9S7pbc9gm6dZMyo3Z-bCndJXF9C2lOva0bQ,4848
|
|
243
|
-
cognite_toolkit/_cdf_tk/storageio/_applications.py,sha256=
|
|
243
|
+
cognite_toolkit/_cdf_tk/storageio/_applications.py,sha256=TuhO5d465RG_maukaAazXi7P7upiJeSofxXrf9guJQE,15113
|
|
244
244
|
cognite_toolkit/_cdf_tk/storageio/_asset_centric.py,sha256=mRwcVvBzUES21zNb-mDH7XqZWN37p4GUs0JRx7lbRyw,32817
|
|
245
245
|
cognite_toolkit/_cdf_tk/storageio/_base.py,sha256=cllSyg3rRGov_X45CoJ_isXhz0cU9Mt7OyV7_t_SeWw,12156
|
|
246
246
|
cognite_toolkit/_cdf_tk/storageio/_data_classes.py,sha256=s3TH04BJ1q7rXndRhEbVMEnoOXjxrGg4n-w9Z5uUL-o,3480
|
|
@@ -248,10 +248,10 @@ cognite_toolkit/_cdf_tk/storageio/_datapoints.py,sha256=AGTQm9CBRbu1oXbBh0X7UGzF
|
|
|
248
248
|
cognite_toolkit/_cdf_tk/storageio/_file_content.py,sha256=HKf3Dg3PMH_QBbPrMhpC75H74laDRVx9R0KiEGKXikI,6103
|
|
249
249
|
cognite_toolkit/_cdf_tk/storageio/_instances.py,sha256=t9fNpHnT6kCk8LDoPj3qZXmHpyDbPF5BZ6pI8ziTyFw,10810
|
|
250
250
|
cognite_toolkit/_cdf_tk/storageio/_raw.py,sha256=5WjAFiVR0KKRhMqCy1IRy1TQFWj86D7nGu5WSFNLp6U,3869
|
|
251
|
-
cognite_toolkit/_cdf_tk/storageio/selectors/__init__.py,sha256=
|
|
251
|
+
cognite_toolkit/_cdf_tk/storageio/selectors/__init__.py,sha256=h7fpasWnxINhwe5prJ_ZhxJw-aPQcOvPqlI_1oHmfI8,2163
|
|
252
252
|
cognite_toolkit/_cdf_tk/storageio/selectors/_asset_centric.py,sha256=7Iv_ccVX6Vzt3ZLFZ0Er3hN92iEsFTm9wgF-yermOWE,1467
|
|
253
253
|
cognite_toolkit/_cdf_tk/storageio/selectors/_base.py,sha256=hjFkbmNGsK3QIW-jnJV_8YNmvVROERxzG82qIZhU7SM,3065
|
|
254
|
-
cognite_toolkit/_cdf_tk/storageio/selectors/_canvas.py,sha256=
|
|
254
|
+
cognite_toolkit/_cdf_tk/storageio/selectors/_canvas.py,sha256=E9S-wr-JUqRosI_2cSCfR0tF8MdIFTrMxDItuWRcuO4,597
|
|
255
255
|
cognite_toolkit/_cdf_tk/storageio/selectors/_charts.py,sha256=lQHuNtF3i6SEIMPAlziMm0QlqRcvZJ7MKIug6HMTDrs,1012
|
|
256
256
|
cognite_toolkit/_cdf_tk/storageio/selectors/_datapoints.py,sha256=EHVkWJYJ_HCs2i4Ur6Fj98UwuDvf67u0HOzrJXAHNt0,1719
|
|
257
257
|
cognite_toolkit/_cdf_tk/storageio/selectors/_file_content.py,sha256=bDcU0Unbb_qG6z004aKTKgeAVhRnFQ4mz-rjNuouXu4,2881
|
|
@@ -302,13 +302,13 @@ cognite_toolkit/_repo_files/.gitignore,sha256=ip9kf9tcC5OguF4YF4JFEApnKYw0nG0vPi
|
|
|
302
302
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/README.md,sha256=OLA0D7yCX2tACpzvkA0IfkgQ4_swSd-OlJ1tYcTBpsA,240
|
|
303
303
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/deploy-pipeline.yml,sha256=brULcs8joAeBC_w_aoWjDDUHs3JheLMIR9ajPUK96nc,693
|
|
304
304
|
cognite_toolkit/_repo_files/AzureDevOps/.devops/dry-run-pipeline.yml,sha256=OBFDhFWK1mlT4Dc6mDUE2Es834l8sAlYG50-5RxRtHk,723
|
|
305
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=
|
|
306
|
-
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=
|
|
307
|
-
cognite_toolkit/_resources/cdf.toml,sha256=
|
|
305
|
+
cognite_toolkit/_repo_files/GitHub/.github/workflows/deploy.yaml,sha256=ecRMptbts1fu6QTsgRFSlSPMOel6aPROK3FGdvqfG_4,668
|
|
306
|
+
cognite_toolkit/_repo_files/GitHub/.github/workflows/dry-run.yaml,sha256=8-4VFTpKuTjXuvmDF8DKwy5ELeljLyhmcKvzKgVj56I,2431
|
|
307
|
+
cognite_toolkit/_resources/cdf.toml,sha256=J7OKCVySsQIRbGF7BY7724trkpchZCoa1h4JY944gxs,488
|
|
308
308
|
cognite_toolkit/demo/__init__.py,sha256=-m1JoUiwRhNCL18eJ6t7fZOL7RPfowhCuqhYFtLgrss,72
|
|
309
309
|
cognite_toolkit/demo/_base.py,sha256=6xKBUQpXZXGQ3fJ5f7nj7oT0s2n7OTAGIa17ZlKHZ5U,8052
|
|
310
|
-
cognite_toolkit-0.6.
|
|
311
|
-
cognite_toolkit-0.6.
|
|
312
|
-
cognite_toolkit-0.6.
|
|
313
|
-
cognite_toolkit-0.6.
|
|
314
|
-
cognite_toolkit-0.6.
|
|
310
|
+
cognite_toolkit-0.6.114.dist-info/METADATA,sha256=kIhY5-tAgzBL0MZyohIzIu1Yg0PKBBmnAwRAgYn3Fec,4502
|
|
311
|
+
cognite_toolkit-0.6.114.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
312
|
+
cognite_toolkit-0.6.114.dist-info/entry_points.txt,sha256=JlR7MH1_UMogC3QOyN4-1l36VbrCX9xUdQoHGkuJ6-4,83
|
|
313
|
+
cognite_toolkit-0.6.114.dist-info/licenses/LICENSE,sha256=CW0DRcx5tL-pCxLEN7ts2S9g2sLRAsWgHVEX4SN9_Mc,752
|
|
314
|
+
cognite_toolkit-0.6.114.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|