cognite-neat 0.123.0__py3-none-any.whl → 0.123.2__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.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- cognite/neat/_version.py +1 -1
- cognite/neat/core/_client/_api/neat_instances.py +30 -0
- cognite/neat/core/_constants.py +10 -1
- cognite/neat/core/_instances/loaders/_rdf2dms.py +8 -0
- cognite/neat/core/_issues/errors/__init__.py +2 -1
- cognite/neat/core/_issues/errors/_general.py +14 -0
- cognite/neat/plugins/__init__.py +3 -0
- cognite/neat/plugins/_issues.py +35 -0
- cognite/neat/plugins/_manager.py +103 -0
- cognite/neat/plugins/data_model/__init__.py +0 -0
- cognite/neat/plugins/data_model/importers/__init__.py +5 -0
- cognite/neat/plugins/data_model/importers/_base.py +28 -0
- cognite/neat/session/_base.py +2 -0
- cognite/neat/session/_experimental.py +1 -0
- cognite/neat/session/_plugin.py +67 -0
- cognite/neat/session/exceptions.py +4 -1
- {cognite_neat-0.123.0.dist-info → cognite_neat-0.123.2.dist-info}/METADATA +1 -1
- {cognite_neat-0.123.0.dist-info → cognite_neat-0.123.2.dist-info}/RECORD +20 -13
- {cognite_neat-0.123.0.dist-info → cognite_neat-0.123.2.dist-info}/WHEEL +0 -0
- {cognite_neat-0.123.0.dist-info → cognite_neat-0.123.2.dist-info}/licenses/LICENSE +0 -0
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.123.
|
|
1
|
+
__version__ = "0.123.2"
|
|
2
2
|
__engine__ = "^2.0.4"
|
|
@@ -7,6 +7,11 @@ from cognite.client.data_classes.filters import Filter
|
|
|
7
7
|
from cognite.client.exceptions import CogniteAPIError
|
|
8
8
|
from cognite.client.utils.useful_types import SequenceNotStr
|
|
9
9
|
|
|
10
|
+
from cognite.neat.core._constants import DMS_INSTANCE_LIMIT_MARGIN
|
|
11
|
+
from cognite.neat.core._issues import NeatIssue
|
|
12
|
+
from cognite.neat.core._issues.errors import WillExceedLimitError
|
|
13
|
+
from cognite.neat.core._issues.warnings import NeatValueWarning
|
|
14
|
+
|
|
10
15
|
if TYPE_CHECKING:
|
|
11
16
|
from cognite.neat.core._client._api_client import NeatClient
|
|
12
17
|
|
|
@@ -69,3 +74,28 @@ class NeatInstancesAPI:
|
|
|
69
74
|
if (time.perf_counter() - last_limit_change) > 30.0 and body["limit"] < 1_000:
|
|
70
75
|
body["limit"] = min(int(body["limit"] * 1.5), 1_000)
|
|
71
76
|
last_limit_change = time.perf_counter()
|
|
77
|
+
|
|
78
|
+
def validate_cdf_project_capacity(self, total_instances: int) -> NeatIssue | None:
|
|
79
|
+
"""Validates if the current project instance capacity can accommodate the given number of instances.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
total_instances (int): The total number of instances to check against the project's capacity.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
NeatIssue | None: Returns a warning if the capacity is exceeded, otherwise None.
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
WillExceedLimitError: If the total instances exceed the project's instance capacity.
|
|
89
|
+
|
|
90
|
+
"""
|
|
91
|
+
try:
|
|
92
|
+
stats = self._client.instance_statistics.project()
|
|
93
|
+
except CogniteAPIError as e:
|
|
94
|
+
# This endpoint is not yet in alpha, it may change or not be available.
|
|
95
|
+
return NeatValueWarning(f"Cannot check project instance capacity. Endpoint not available: {e}")
|
|
96
|
+
instance_capacity = stats.instances.instances_limit - stats.instances.instances
|
|
97
|
+
if total_instances + DMS_INSTANCE_LIMIT_MARGIN > instance_capacity:
|
|
98
|
+
raise WillExceedLimitError(
|
|
99
|
+
"instances", total_instances, stats.project, instance_capacity, DMS_INSTANCE_LIMIT_MARGIN
|
|
100
|
+
)
|
|
101
|
+
return None
|
cognite/neat/core/_constants.py
CHANGED
|
@@ -9,7 +9,6 @@ from rdflib import DC, DCTERMS, FOAF, OWL, RDF, RDFS, SH, SKOS, XSD, Namespace,
|
|
|
9
9
|
from rdflib.namespace import DefinedNamespace
|
|
10
10
|
|
|
11
11
|
from cognite import neat
|
|
12
|
-
from cognite.neat.core._issues.errors._general import NeatValueError
|
|
13
12
|
|
|
14
13
|
if TYPE_CHECKING:
|
|
15
14
|
from cognite.neat.core._data_model.models.physical import PhysicalProperty
|
|
@@ -161,6 +160,14 @@ DMS_DIRECT_RELATION_LIST_DEFAULT_LIMIT = 100
|
|
|
161
160
|
DMS_PRIMITIVE_LIST_DEFAULT_LIMIT = 1000
|
|
162
161
|
DMS_CONTAINER_LIST_MAX_LIMIT = 2000
|
|
163
162
|
|
|
163
|
+
# The number of instances that should be left as a margin when Neat writes to CDF through the DMS API.
|
|
164
|
+
# This is currently set conservatively to 1 million. The reasoning for this is that there are CDF
|
|
165
|
+
# applications such as Infield and Industrial Canvas that can write to the DMS API, as well as likely third-party
|
|
166
|
+
# applications that can write to the DMS API. If Neat fills up the entire capacity, these type of data gathering
|
|
167
|
+
# applications will experience data loss. The limit of 1 million is chosen such that it will trigger alarms in the
|
|
168
|
+
# CDF projects, such that admins can take action to increase or clean up the capacity before it is too late.
|
|
169
|
+
DMS_INSTANCE_LIMIT_MARGIN = 1_000_000
|
|
170
|
+
|
|
164
171
|
_ASSET_ROOT_PROPERTY = {
|
|
165
172
|
"connection": "direct",
|
|
166
173
|
"container": "cdf_cdm:CogniteAsset",
|
|
@@ -211,6 +218,8 @@ def get_base_concepts(
|
|
|
211
218
|
base_model: The base model to get the concepts for.
|
|
212
219
|
total_concepts: The number of concepts to get. If None, all concepts are returned.
|
|
213
220
|
"""
|
|
221
|
+
# Local import to avoid circular dependency issues
|
|
222
|
+
from cognite.neat.core._issues.errors._general import NeatValueError
|
|
214
223
|
|
|
215
224
|
if base_model == "CogniteCore":
|
|
216
225
|
return [f"cdf_cdm:{concept}(version=v1)" for concept in COGNITE_CONCEPTS][:total_concepts]
|
|
@@ -159,6 +159,14 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
|
|
|
159
159
|
if self.neat_prefix_by_type_uri:
|
|
160
160
|
self._lookup_identifier_by_uri()
|
|
161
161
|
|
|
162
|
+
if self._client:
|
|
163
|
+
validate_issue = self._client.instances.validate_cdf_project_capacity(
|
|
164
|
+
sum(it.instance_count for it in view_iterations)
|
|
165
|
+
)
|
|
166
|
+
if validate_issue:
|
|
167
|
+
yield validate_issue
|
|
168
|
+
return
|
|
169
|
+
|
|
162
170
|
for it in view_iterations:
|
|
163
171
|
view = it.view
|
|
164
172
|
if view is None:
|
|
@@ -12,7 +12,7 @@ from ._external import (
|
|
|
12
12
|
NeatYamlError,
|
|
13
13
|
OxigraphStorageLockedError,
|
|
14
14
|
)
|
|
15
|
-
from ._general import NeatImportError, NeatTypeError, NeatValueError, RegexViolationError
|
|
15
|
+
from ._general import NeatImportError, NeatTypeError, NeatValueError, RegexViolationError, WillExceedLimitError
|
|
16
16
|
from ._properties import (
|
|
17
17
|
PropertyDefinitionDuplicatedError,
|
|
18
18
|
PropertyDefinitionError,
|
|
@@ -82,6 +82,7 @@ __all__ = [
|
|
|
82
82
|
"ReversedConnectionNotFeasibleError",
|
|
83
83
|
"SpreadsheetError",
|
|
84
84
|
"ViewValueError",
|
|
85
|
+
"WillExceedLimitError",
|
|
85
86
|
]
|
|
86
87
|
|
|
87
88
|
_NEAT_ERRORS_BY_NAME = {error.__name__: error for error in _get_subclasses(NeatError, include_base=True)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
+
from typing import Literal
|
|
2
3
|
|
|
3
4
|
from cognite.neat.core._issues import NeatError
|
|
4
5
|
|
|
@@ -35,3 +36,16 @@ class NeatImportError(NeatError, ImportError):
|
|
|
35
36
|
|
|
36
37
|
module: str
|
|
37
38
|
neat_extra: str
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(unsafe_hash=True)
|
|
42
|
+
class WillExceedLimitError(NeatError, RuntimeError):
|
|
43
|
+
"""Cannot write {resource_count} {resource_type} to project {project} as the current available capacity
|
|
44
|
+
is {available_capacity} {resource_type}. Neat requires a capacity of at least {margin} {resource_type} are
|
|
45
|
+
left for future writes, {available_capacity}-{resource_count} < {margin}."""
|
|
46
|
+
|
|
47
|
+
resource_type: Literal["instances"]
|
|
48
|
+
resource_count: int
|
|
49
|
+
project: str
|
|
50
|
+
available_capacity: int
|
|
51
|
+
margin: int
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
from cognite.neat.core._issues.errors import _NEAT_ERRORS_BY_NAME, NeatError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass(unsafe_hash=True)
|
|
7
|
+
class PluginError(NeatError, ImportError):
|
|
8
|
+
"""No plugin of type '{plugin_type}' registered under name '{plugin_name}'"""
|
|
9
|
+
|
|
10
|
+
plugin_name: str
|
|
11
|
+
plugin_type: str
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(unsafe_hash=True)
|
|
15
|
+
class PluginLoadingError(PluginError):
|
|
16
|
+
"""Unable to load plugin of type '{plugin_type}' registered under name '{plugin_name}' due to: {exception}"""
|
|
17
|
+
|
|
18
|
+
exception: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(unsafe_hash=True)
|
|
22
|
+
class PluginDuplicateError(PluginError):
|
|
23
|
+
"""Plugin of type '{plugin_type}' registered for under name '{plugin_name}' already exists"""
|
|
24
|
+
|
|
25
|
+
...
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Register the errors in the _NEAT_ERRORS_BY_NAME dictionary
|
|
29
|
+
_NEAT_ERRORS_BY_NAME.update(
|
|
30
|
+
{
|
|
31
|
+
"PluginError": PluginError,
|
|
32
|
+
"PluginLoadingError": PluginLoadingError,
|
|
33
|
+
"PluginDuplicateError": PluginDuplicateError,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""Plugin manager for external plugins."""
|
|
2
|
+
|
|
3
|
+
from importlib import metadata
|
|
4
|
+
from typing import Any, ClassVar, TypeAlias, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from ._issues import PluginDuplicateError, PluginError, PluginLoadingError
|
|
7
|
+
from .data_model.importers import DataModelImporterPlugin
|
|
8
|
+
|
|
9
|
+
# Here we configure entry points where external plugins are going to be registered.
|
|
10
|
+
plugins_entry_points = {
|
|
11
|
+
"cognite.neat.plugins.data_model.importers": DataModelImporterPlugin,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#: Type alias for all supported plugin types
|
|
15
|
+
NeatPlugin: TypeAlias = DataModelImporterPlugin
|
|
16
|
+
|
|
17
|
+
# Generic type variable for plugin types
|
|
18
|
+
T_NeatPlugin = TypeVar("T_NeatPlugin", bound=NeatPlugin)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Plugin:
|
|
22
|
+
"""Plugin class for registering plugins registered via entry points (i.e. external plugins).
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
name (str): The name of format (e.g. Excel) or action (e.g. merge) plugin is handling.
|
|
26
|
+
type_ (type): The type of the plugin.
|
|
27
|
+
entry_point (EntryPoint): The entry point for the plugin.
|
|
28
|
+
|
|
29
|
+
!!! note "name uniqueness"
|
|
30
|
+
The name of the plugin must be lower case and unique across all plugins of the same kind.
|
|
31
|
+
If two plugins have the same name, the exception will be raised.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
def __init__(self, name: str, type_: type[NeatPlugin], entry_point: metadata.EntryPoint):
|
|
35
|
+
self.name = name
|
|
36
|
+
self.type_ = type_
|
|
37
|
+
self.entry_point = entry_point
|
|
38
|
+
|
|
39
|
+
def load(self) -> type[NeatPlugin]:
|
|
40
|
+
try:
|
|
41
|
+
return self.entry_point.load()
|
|
42
|
+
except Exception as e:
|
|
43
|
+
raise PluginLoadingError(self.name, self.type_.__name__, str(e)) from e
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class PluginManager:
|
|
47
|
+
"""Plugin manager for external plugins."""
|
|
48
|
+
|
|
49
|
+
_plugins_entry_points: ClassVar[dict[str, type[NeatPlugin]]] = {
|
|
50
|
+
"cognite.neat.plugins.data_model.importers": DataModelImporterPlugin,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, plugins: dict[tuple[str, type[NeatPlugin]], Any]) -> None:
|
|
54
|
+
self._plugins = plugins
|
|
55
|
+
|
|
56
|
+
def get(self, name: str, type_: type[T_NeatPlugin]) -> type[T_NeatPlugin]:
|
|
57
|
+
"""
|
|
58
|
+
Returns desired plugin
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
name (str): The name of format (e.g. Excel) or action (e.g. merge) plugin is handling.
|
|
62
|
+
type_ (type): The type of the plugin.
|
|
63
|
+
"""
|
|
64
|
+
try:
|
|
65
|
+
plugin_class = self._plugins[(name, type_)]
|
|
66
|
+
return cast(type[T_NeatPlugin], plugin_class)
|
|
67
|
+
except KeyError:
|
|
68
|
+
raise PluginError(plugin_name=name, plugin_type=type_.__name__) from None
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def load_plugins(cls, entry_points: metadata.EntryPoints | None = None) -> "PluginManager":
|
|
72
|
+
"""Load plugins from entry points and register them to the manager.
|
|
73
|
+
This method scans the provided entry points for plugins defined in the
|
|
74
|
+
`_plugins_entry_points` dictionary and registers them.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
entry_points: Entry points to load plugins from. If None, uses the default entry points.
|
|
78
|
+
"""
|
|
79
|
+
_plugins: dict[tuple[str, type[NeatPlugin]], Any] = {}
|
|
80
|
+
|
|
81
|
+
entry_points = entry_points or metadata.entry_points()
|
|
82
|
+
if hasattr(entry_points, "select"):
|
|
83
|
+
for group, type_ in cls._plugins_entry_points.items():
|
|
84
|
+
for entry_point in entry_points.select(group=group):
|
|
85
|
+
# Check for duplicate plugins
|
|
86
|
+
if (entry_point.name, type_) in _plugins:
|
|
87
|
+
raise PluginDuplicateError(plugin_name=entry_point.name, plugin_type=type_.__name__)
|
|
88
|
+
|
|
89
|
+
# Register the plugin
|
|
90
|
+
_plugins[(entry_point.name, type_)] = Plugin(entry_point.name, type_, entry_point).load()
|
|
91
|
+
|
|
92
|
+
return cls(_plugins)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
_manager_instance: PluginManager | None = None
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def get_plugin_manager(force_reload: bool = False) -> PluginManager:
|
|
99
|
+
"""Get or create a singleton PluginManager instance."""
|
|
100
|
+
global _manager_instance
|
|
101
|
+
if force_reload or _manager_instance is None:
|
|
102
|
+
_manager_instance = PluginManager.load_plugins()
|
|
103
|
+
return _manager_instance
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from cognite.neat.core._data_model.importers._base import BaseImporter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class DataModelImporterPlugin:
|
|
8
|
+
"""This class is used an interface for data model import plugins.
|
|
9
|
+
Any plugin that is used for importing data models should inherit from this class.
|
|
10
|
+
It is expected to implement the `configure` method which returns a configured importer.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def configure(self, io: str | Path | None, **kwargs: Any) -> BaseImporter:
|
|
14
|
+
"""Return a configure plugin for data model import.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
io (str | Path | None): The input/output interface for the plugin.
|
|
18
|
+
**kwargs (Any): Additional keyword arguments for configuration.
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
BaseImporter: A configured instance of the BaseImporter.
|
|
22
|
+
|
|
23
|
+
!!! note "Returns"
|
|
24
|
+
The method must return an instance of `BaseImporter` or its subclasses
|
|
25
|
+
meaning it must implement the `BaseImporter` interface.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
raise NotImplementedError()
|
cognite/neat/session/_base.py
CHANGED
|
@@ -30,6 +30,7 @@ from ._explore import ExploreAPI
|
|
|
30
30
|
from ._fix import FixAPI
|
|
31
31
|
from ._inspect import InspectAPI
|
|
32
32
|
from ._mapping import MappingAPI
|
|
33
|
+
from ._plugin import PluginAPI
|
|
33
34
|
from ._prepare import PrepareAPI
|
|
34
35
|
from ._read import ReadAPI
|
|
35
36
|
from ._set import SetAPI
|
|
@@ -108,6 +109,7 @@ class NeatSession:
|
|
|
108
109
|
self.subset = SubsetAPI(self._state)
|
|
109
110
|
self.template = TemplateAPI(self._state)
|
|
110
111
|
self._explore = ExploreAPI(self._state)
|
|
112
|
+
self.plugins = PluginAPI(self._state)
|
|
111
113
|
self.opt = OptAPI()
|
|
112
114
|
self.opt._display()
|
|
113
115
|
if load_engine != "skip" and (engine_version := load_neat_engine(client, load_engine)):
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from cognite.neat.core._issues._base import IssueList
|
|
6
|
+
from cognite.neat.core._utils.reader._base import NeatReader
|
|
7
|
+
from cognite.neat.plugins import get_plugin_manager
|
|
8
|
+
from cognite.neat.plugins.data_model.importers._base import DataModelImporterPlugin
|
|
9
|
+
from cognite.neat.session._experimental import ExperimentalFlags
|
|
10
|
+
|
|
11
|
+
from ._state import SessionState
|
|
12
|
+
from .exceptions import session_class_wrapper
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@session_class_wrapper
|
|
16
|
+
class PluginAPI:
|
|
17
|
+
"""Read from a data source into NeatSession graph store."""
|
|
18
|
+
|
|
19
|
+
def __init__(self, state: SessionState) -> None:
|
|
20
|
+
self._state = state
|
|
21
|
+
|
|
22
|
+
self.data_model = DataModelPlugins(self._state)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@session_class_wrapper
|
|
26
|
+
class DataModelPlugins:
|
|
27
|
+
"""Read from a data source into NeatSession graph store."""
|
|
28
|
+
|
|
29
|
+
def __init__(self, state: SessionState) -> None:
|
|
30
|
+
self._state = state
|
|
31
|
+
|
|
32
|
+
def read(self, name: str, io: str | Path | None = None, **kwargs: Any) -> IssueList:
|
|
33
|
+
"""Provides access to the external plugins for data model importing.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
name (str): The name of format (e.g. Excel) plugin is handling.
|
|
37
|
+
io (str | Path | None): The input/output interface for the plugin.
|
|
38
|
+
**kwargs (Any): Additional keyword arguments for the plugin.
|
|
39
|
+
|
|
40
|
+
!!! note "kwargs"
|
|
41
|
+
Users must consult the documentation of the plugin to understand
|
|
42
|
+
what keyword arguments are supported.
|
|
43
|
+
"""
|
|
44
|
+
warnings.filterwarnings("default")
|
|
45
|
+
ExperimentalFlags.plugin.warn()
|
|
46
|
+
|
|
47
|
+
# Some plugins may not support the io argument
|
|
48
|
+
if io:
|
|
49
|
+
reader = NeatReader.create(io)
|
|
50
|
+
path = reader.materialize_path()
|
|
51
|
+
else:
|
|
52
|
+
path = None
|
|
53
|
+
|
|
54
|
+
self._state._raise_exception_if_condition_not_met(
|
|
55
|
+
"Data Model Read",
|
|
56
|
+
empty_data_model_store_required=True,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
plugin_manager = get_plugin_manager()
|
|
60
|
+
plugin = plugin_manager.get(name, DataModelImporterPlugin)
|
|
61
|
+
|
|
62
|
+
print(
|
|
63
|
+
f"You are using an external plugin {plugin.__name__}, which is not developed by the NEAT team."
|
|
64
|
+
"\nUse it at your own risk."
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return self._state.data_model_import(plugin().configure(io=path, **kwargs))
|
|
@@ -5,7 +5,8 @@ from typing import Any, TypeVar
|
|
|
5
5
|
|
|
6
6
|
from cognite.neat.core._issues.errors import CDFMissingClientError, NeatImportError
|
|
7
7
|
from cognite.neat.core._issues.errors._external import OxigraphStorageLockedError
|
|
8
|
-
from cognite.neat.core._issues.errors._general import NeatValueError
|
|
8
|
+
from cognite.neat.core._issues.errors._general import NeatValueError, WillExceedLimitError
|
|
9
|
+
from cognite.neat.plugins._issues import PluginError
|
|
9
10
|
from cognite.neat.session._experimental import ExperimentalFeatureWarning
|
|
10
11
|
|
|
11
12
|
from ._collector import _COLLECTOR
|
|
@@ -50,6 +51,8 @@ def _session_method_wrapper(func: Callable, cls_name: str) -> Any:
|
|
|
50
51
|
NeatImportError,
|
|
51
52
|
NeatValueError,
|
|
52
53
|
OxigraphStorageLockedError,
|
|
54
|
+
PluginError,
|
|
55
|
+
WillExceedLimitError,
|
|
53
56
|
) as e:
|
|
54
57
|
print(f"{_ERROR_PREFIX} {escape(e.as_message())}")
|
|
55
58
|
except ModuleNotFoundError as e:
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
cognite/neat/__init__.py,sha256=12StS1dzH9_MElqxGvLWrNsxCJl9Hv8A2a9D0E5OD_U,193
|
|
2
|
-
cognite/neat/_version.py,sha256=
|
|
2
|
+
cognite/neat/_version.py,sha256=HP2O0I_4JuG1TczHFazc53TQqD0Z8qh9R2SVWsXmlSQ,46
|
|
3
3
|
cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
cognite/neat/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cognite/neat/core/_config.py,sha256=WT1BS8uADcFvGoUYOOfwFOVq_VBl472TisdoA3wLick,280
|
|
6
|
-
cognite/neat/core/_constants.py,sha256=
|
|
6
|
+
cognite/neat/core/_constants.py,sha256=Cc7p1QbpbzPSjlf-PB_Ow2pKRhWQL-K8VJma96HzU3A,8863
|
|
7
7
|
cognite/neat/core/_shared.py,sha256=Ov59SWYboRRsncB_5V1ZC_BAoACfNLjo80vqE5Ru6wo,2325
|
|
8
8
|
cognite/neat/core/_client/__init__.py,sha256=RQ7MwL8mwGqGHokRzsPqO3XStDzmI4-c12_gz1UPJ74,177
|
|
9
9
|
cognite/neat/core/_client/_api_client.py,sha256=CqgG4kEArI9jiKAh82YrRZv_SzeMKA5guIZOvDg2R5I,860
|
|
10
10
|
cognite/neat/core/_client/testing.py,sha256=rZGd-TFwNtfUqT8LV0u3FT0kHwNrjnvDNZU_Mcd5yx4,1329
|
|
11
11
|
cognite/neat/core/_client/_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
cognite/neat/core/_client/_api/data_modeling_loaders.py,sha256=YEZP0V_RXenzzFSxDzt4SbVnpzB4VP0fcI-Bab1VLw8,39815
|
|
13
|
-
cognite/neat/core/_client/_api/neat_instances.py,sha256=
|
|
13
|
+
cognite/neat/core/_client/_api/neat_instances.py,sha256=8HcQO1sp8zjXdnRBRQ4yeQzt1O906HNSrDDCgrgTe8A,4805
|
|
14
14
|
cognite/neat/core/_client/_api/schema.py,sha256=lbA8Cka_7K_RjmaxdeqkVkIwKPfWeDvpYvvEOGI07xo,6967
|
|
15
15
|
cognite/neat/core/_client/_api/statistics.py,sha256=M0JpCHD6WMfggoe-HyXfeigwRCvZJjVF-xNB9CgB4UE,3796
|
|
16
16
|
cognite/neat/core/_client/data_classes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -110,7 +110,7 @@ cognite/neat/core/_instances/extractors/_classic_cdf/_sequences.py,sha256=zwHM52
|
|
|
110
110
|
cognite/neat/core/_instances/extractors/_classic_cdf/_timeseries.py,sha256=Py8MDcn82MJcsDPbeqDHMx4g2rQHmEOSHNe6gOi5gew,2044
|
|
111
111
|
cognite/neat/core/_instances/loaders/__init__.py,sha256=qyOrKy0cJgYmgEuWVM-O1mpUemQE8EkfQYtJyEc8UVs,778
|
|
112
112
|
cognite/neat/core/_instances/loaders/_base.py,sha256=jfik8xsdocMHVlodvgHpnDJfYdEjYuKdd0t7MGhzAHI,4337
|
|
113
|
-
cognite/neat/core/_instances/loaders/_rdf2dms.py,sha256=
|
|
113
|
+
cognite/neat/core/_instances/loaders/_rdf2dms.py,sha256=Nel9ZZ560XAfqNapHSr-P_sk5F_Yv4Ffk9slCfB7dG4,29355
|
|
114
114
|
cognite/neat/core/_instances/loaders/_rdf_to_instance_space.py,sha256=qVxRzEUyhv8AGvAO8whJWPCZ-8BppEy0mk1Ux_8gOzY,11937
|
|
115
115
|
cognite/neat/core/_instances/queries/__init__.py,sha256=W477LMyB4l6HIRbQhJoFgA_MUBwVCh2GBvtFeZu0AUA,53
|
|
116
116
|
cognite/neat/core/_instances/queries/_base.py,sha256=APevHeeWQDEoOQ0MlBtVlPf9hbZukVkI5fOvt5oPJCE,543
|
|
@@ -128,9 +128,9 @@ cognite/neat/core/_issues/_base.py,sha256=iZcqGd5R6nnTBvVDGJ5VV67vQNvDuUzSQGtl2Z
|
|
|
128
128
|
cognite/neat/core/_issues/_contextmanagers.py,sha256=5-QXVmfplt4S_k2csrQ2xuezOOuE5_FxSA9GVGVG1s4,1582
|
|
129
129
|
cognite/neat/core/_issues/_factory.py,sha256=ifEzHZcvPyO0ZGJo8T8CE20F5L4yRzrrGPxl9d87oIs,2829
|
|
130
130
|
cognite/neat/core/_issues/formatters.py,sha256=k2h_6wHW0ve52gXeuRoEcGwrxqqSe5sYFa_HycPiqW8,3323
|
|
131
|
-
cognite/neat/core/_issues/errors/__init__.py,sha256=
|
|
131
|
+
cognite/neat/core/_issues/errors/__init__.py,sha256=yIW5cntr-OA0BplqEtUJaaxTZpnwq-bAcTKhY-SSawc,2418
|
|
132
132
|
cognite/neat/core/_issues/errors/_external.py,sha256=AaKwO5-AvX01d7Hd83vqYl1qNmMtgsmShmvyH8ioZAM,2354
|
|
133
|
-
cognite/neat/core/_issues/errors/_general.py,sha256=
|
|
133
|
+
cognite/neat/core/_issues/errors/_general.py,sha256=QEgTp_bvzGjmpRtr09Lj_SBeD9IVdql5_JmP02P7PfM,1391
|
|
134
134
|
cognite/neat/core/_issues/errors/_properties.py,sha256=XkMLO4tkFX8vmGRixLdsmDAnlcipc78lypGccMYVAQk,2541
|
|
135
135
|
cognite/neat/core/_issues/errors/_resources.py,sha256=lBK65tJZMhV3z3_xi8zJeo7Nt_agXsOklH_RPKQu28s,4002
|
|
136
136
|
cognite/neat/core/_issues/errors/_wrapper.py,sha256=clhuSwUuHy-FQXQopFIQRY8c_NZM5u-QB9ncoc6Hrbo,2320
|
|
@@ -160,15 +160,22 @@ cognite/neat/core/_utils/upload.py,sha256=yR-BvvrWPh0XHoIGByXMEVi3JONzmc5xwXbmED
|
|
|
160
160
|
cognite/neat/core/_utils/xml_.py,sha256=FQkq84u35MUsnKcL6nTMJ9ajtG9D5i1u4VBnhGqP2DQ,1710
|
|
161
161
|
cognite/neat/core/_utils/reader/__init__.py,sha256=fPkrNB_9hLB7CyHTCFV_xEbIfOMqUQzNly5JN33-QfM,146
|
|
162
162
|
cognite/neat/core/_utils/reader/_base.py,sha256=fRXxUWW8a3UFedeCLxDTDgFntWGlHaEGxmKLcITtiWE,5417
|
|
163
|
+
cognite/neat/plugins/__init__.py,sha256=Q7r1FFbybOt71N9TjHjjk-1HguLRfHieLeiGVSG5HTY,75
|
|
164
|
+
cognite/neat/plugins/_issues.py,sha256=jukeVjSs1DEzqtFuGRcIDbg7bNxZRxGPqnzumVRF-8c,940
|
|
165
|
+
cognite/neat/plugins/_manager.py,sha256=_eJa5_3UGoLVacSQgbDrE0eWcopjeXxgbfSmvujeSiU,3979
|
|
166
|
+
cognite/neat/plugins/data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
167
|
+
cognite/neat/plugins/data_model/importers/__init__.py,sha256=d4UJNCFR1DXPY7lv5LdCW2hiStEhvXiu2g_bRSIp1y0,89
|
|
168
|
+
cognite/neat/plugins/data_model/importers/_base.py,sha256=M9zXp7tEu1SfJZRAJAtLmqpssdFcoi2X-5e25q_n_h8,1034
|
|
163
169
|
cognite/neat/session/__init__.py,sha256=fxQ5URVlUnmEGYyB8Baw7IDq-uYacqkigbc4b-Pr9Fw,58
|
|
164
|
-
cognite/neat/session/_base.py,sha256=
|
|
170
|
+
cognite/neat/session/_base.py,sha256=vg8KgzpQxFnFCR4F0yRNSsRmrgYZQ77rW6eX4w7L9M4,12884
|
|
165
171
|
cognite/neat/session/_collector.py,sha256=-icWXOT9YBjAOVZfpPtBx-D39kpRP2RaQKdPtcr7Xm8,4233
|
|
166
172
|
cognite/neat/session/_drop.py,sha256=ipD8RS_ZebPNpeIkhC7yqSSeo7e57TXMRxrh5_6IRik,4239
|
|
167
|
-
cognite/neat/session/_experimental.py,sha256=
|
|
173
|
+
cognite/neat/session/_experimental.py,sha256=0peZPZ9JpmzQE05wHbng2tWmPPLLTAVfWZEEUhdnI6o,1274
|
|
168
174
|
cognite/neat/session/_explore.py,sha256=PLxpHDqBk5B0Q4a5tJKnF6KzL4heQ77b2qUETbf6iVQ,1599
|
|
169
175
|
cognite/neat/session/_fix.py,sha256=oJRXuRI4f_HgLYHkjbtPAwHK0vSDUYd19hIZeFaE7rQ,919
|
|
170
176
|
cognite/neat/session/_inspect.py,sha256=AESQd2SOidR_pDTFk5B_JdPnKZ5PNNskdAQBepH2Mv0,10175
|
|
171
177
|
cognite/neat/session/_mapping.py,sha256=ItEXhXo_8V3069hktHMxdpBsLNeTck3gZBvhlm12Oxw,2895
|
|
178
|
+
cognite/neat/session/_plugin.py,sha256=diFvZUFRvY037iVy_HxnIGMSfrauOpwYCSvFEPOzchQ,2282
|
|
172
179
|
cognite/neat/session/_prepare.py,sha256=pskEVNgcnVJVRvYKk5xI55V89vKDO_kgjszj5flY8Zs,12778
|
|
173
180
|
cognite/neat/session/_read.py,sha256=sKtSw7Ub--vR6wfEexNzzaEHb0MZCHj3kzCEnF5wjf0,35349
|
|
174
181
|
cognite/neat/session/_set.py,sha256=PU4lKI-LGtKFVyvdtfZkk-zLw9e_rnFHzuV9IyrOrTM,4593
|
|
@@ -178,13 +185,13 @@ cognite/neat/session/_subset.py,sha256=p7n6WmL0gZlUbqpVBgyPncQ6uWn_pi7FDSixDFrm7
|
|
|
178
185
|
cognite/neat/session/_template.py,sha256=NCgrrwLT98DpLYoo3Wybr_OUXrEXpsJZjrJ83KqfyWc,9908
|
|
179
186
|
cognite/neat/session/_to.py,sha256=_R-UB3iEIQoa12kTD7tuSrRDdbySQXQg_mzbn5t-7bg,19399
|
|
180
187
|
cognite/neat/session/_wizard.py,sha256=hARNNzD5Zfkk_V147rIjOLVvrFaqzXGXWhZuH1NJG3M,1486
|
|
181
|
-
cognite/neat/session/exceptions.py,sha256=
|
|
188
|
+
cognite/neat/session/exceptions.py,sha256=z5jxwfVTXDCCFZKTTYVIaksNKqb9CMa2tyIZgyNL3Us,3475
|
|
182
189
|
cognite/neat/session/_state/README.md,sha256=o6N7EL98lgyWffw8IoEUf2KG5uSKveD5__TW45YzVjA,902
|
|
183
190
|
cognite/neat/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4dvca6n48bu_bI,120
|
|
184
191
|
cognite/neat/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
|
|
185
192
|
cognite/neat/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
|
|
186
193
|
cognite/neat/session/engine/_load.py,sha256=g52uYakQM03VqHt_RDHtpHso1-mFFifH5M4T2ScuH8A,5198
|
|
187
|
-
cognite_neat-0.123.
|
|
188
|
-
cognite_neat-0.123.
|
|
189
|
-
cognite_neat-0.123.
|
|
190
|
-
cognite_neat-0.123.
|
|
194
|
+
cognite_neat-0.123.2.dist-info/METADATA,sha256=S0A0bAMepNWiOxj_BGAZL_nSetJnWlVdrgA8JOps3rI,9171
|
|
195
|
+
cognite_neat-0.123.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
196
|
+
cognite_neat-0.123.2.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
|
|
197
|
+
cognite_neat-0.123.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|