cognite-neat 0.113.1__py3-none-any.whl → 0.113.3__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.

@@ -2,7 +2,6 @@ import warnings
2
2
  from collections import Counter, defaultdict
3
3
  from collections.abc import Mapping
4
4
  from functools import lru_cache
5
- from typing import ClassVar
6
5
 
7
6
  from cognite.client import data_modeling as dm
8
7
  from cognite.client.data_classes.data_modeling import ContainerList, ViewId, ViewList
@@ -16,7 +15,12 @@ from cognite.client.data_classes.data_modeling.views import (
16
15
  from cognite.neat._client import NeatClient
17
16
  from cognite.neat._client.data_classes.data_modeling import ViewApplyDict
18
17
  from cognite.neat._client.data_classes.schema import DMSSchema
19
- from cognite.neat._constants import COGNITE_MODELS, DMS_CONTAINER_PROPERTY_SIZE_LIMIT, DMS_VIEW_CONTAINER_SIZE_LIMIT
18
+ from cognite.neat._constants import (
19
+ COGNITE_MODELS,
20
+ COGNITE_SPACES,
21
+ DMS_CONTAINER_PROPERTY_SIZE_LIMIT,
22
+ DMS_VIEW_CONTAINER_SIZE_LIMIT,
23
+ )
20
24
  from cognite.neat._issues import IssueList, NeatError
21
25
  from cognite.neat._issues.errors import (
22
26
  CDFMissingClientError,
@@ -54,10 +58,6 @@ class DMSValidation:
54
58
  """This class does all the validation of the DMS rules that have dependencies between
55
59
  components."""
56
60
 
57
- # When checking for changes extension=addition, we need to check if the new view has changed.
58
- # For example, changing the filter is allowed, but changing the properties is not.
59
- changeable_view_attributes: ClassVar[set[str]] = {"filter"}
60
-
61
61
  def __init__(
62
62
  self,
63
63
  rules: DMSRules,
@@ -91,6 +91,11 @@ class DMSValidation:
91
91
  imported_views.add(prop.view)
92
92
  view_with_properties.add(prop.view)
93
93
 
94
+ for container in self._containers or []:
95
+ for required in container.constraint or []:
96
+ if required not in existing_containers:
97
+ imported_containers.add(required)
98
+
94
99
  if include_views_with_no_properties:
95
100
  extra_views = existing_views - view_with_properties
96
101
  imported_views.update({view for view in extra_views})
@@ -455,7 +460,7 @@ class DMSValidation:
455
460
  def _validate_raw_filter(self) -> IssueList:
456
461
  issue_list = IssueList()
457
462
  for view in self._views:
458
- if view.filter_ and isinstance(view.filter_, RawFilter):
463
+ if view.filter_ and isinstance(view.filter_, RawFilter) and view.view.space not in COGNITE_SPACES:
459
464
  issue_list.append(
460
465
  NotNeatSupportedFilterWarning(view.view.as_id()),
461
466
  )
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.113.1"
1
+ __version__ = "0.113.3"
2
2
  __engine__ = "^2.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cognite-neat
3
- Version: 0.113.1
3
+ Version: 0.113.3
4
4
  Summary: Knowledge graph transformation
5
5
  License: Apache-2.0
6
6
  Author: Nikola Vasiljevic
@@ -114,7 +114,7 @@ cognite/neat/_rules/models/dms/__init__.py,sha256=fRaUH0IwG0YwWd_DNKM6j-jHHFyiIV
114
114
  cognite/neat/_rules/models/dms/_exporter.py,sha256=tQeRZg0xHSTjG4BGB1BxNdewWaPVIi_8cAp0Mh0Isa4,27894
115
115
  cognite/neat/_rules/models/dms/_rules.py,sha256=dY4JYAtoy_TbYf1DIi1RYWjqoYxpR9FeVTXRJe9IfC0,21509
116
116
  cognite/neat/_rules/models/dms/_rules_input.py,sha256=a7Wfq6KR-L3yjc9J_aX1PUQZSJ7JISuOxziaqcKx0vY,13722
117
- cognite/neat/_rules/models/dms/_validation.py,sha256=L_R5FAw2hBPgnWeaujgCQ5uPkiuGS6CXYz9FmYEpnTE,32148
117
+ cognite/neat/_rules/models/dms/_validation.py,sha256=Uh6DaCywdpTljy3trmVGaHrRI1wqZSAHRBpSi1hemsU,32165
118
118
  cognite/neat/_rules/models/entities/__init__.py,sha256=Hlucp3LyV6ncLl79aqRTbSy2qgiGzoyN8x54D_zaJCY,1469
119
119
  cognite/neat/_rules/models/entities/_constants.py,sha256=g52-pFP_Qghp86NYk76pLDM52b3T4MXMztxhpeDW3Oc,344
120
120
  cognite/neat/_rules/models/entities/_loaders.py,sha256=OQDbz5ANMQ_7ZcdMIBdTR94BoCpWrBA2KBH3fCW0JQo,2728
@@ -176,10 +176,10 @@ cognite/neat/_utils/text.py,sha256=BFJoEOQBFgpelysL92FdF0OVRVFl0q9tRNoz-oRanNc,7
176
176
  cognite/neat/_utils/time_.py,sha256=O30LUiDH9TdOYz8_a9pFqTtJdg8vEjC3qHCk8xZblG8,345
177
177
  cognite/neat/_utils/upload.py,sha256=xWtM6mFuD2QYQHaZ7zCAuGptbEpPIxcH-raWQu93-Ug,5845
178
178
  cognite/neat/_utils/xml_.py,sha256=FQkq84u35MUsnKcL6nTMJ9ajtG9D5i1u4VBnhGqP2DQ,1710
179
- cognite/neat/_version.py,sha256=YuAaqZVpO4dBax_JhqAbzwD9jgVm1U8l9Wa-LpxZoMA,46
179
+ cognite/neat/_version.py,sha256=WOuD_YdIg1vhJB33VJRiME1talrsamVg33rghwUP2Q4,46
180
180
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
181
- cognite_neat-0.113.1.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
182
- cognite_neat-0.113.1.dist-info/METADATA,sha256=xggYdKRkLRLkx_gtX42vqTZNGAJtl0-03onxh5spOd0,5361
183
- cognite_neat-0.113.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
184
- cognite_neat-0.113.1.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
185
- cognite_neat-0.113.1.dist-info/RECORD,,
181
+ cognite_neat-0.113.3.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
182
+ cognite_neat-0.113.3.dist-info/METADATA,sha256=kEl6eFOgoccnwaAoosTWscrzdbb81fWKW-szRqo88ko,5361
183
+ cognite_neat-0.113.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
184
+ cognite_neat-0.113.3.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
185
+ cognite_neat-0.113.3.dist-info/RECORD,,