cognite-neat 0.77.1__py3-none-any.whl → 0.77.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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.77.1"
1
+ __version__ = "0.77.2"
@@ -507,6 +507,26 @@ class HasDataFilterAppliedToTooManyContainersWarning(DMSSchemaWarning):
507
507
  return output
508
508
 
509
509
 
510
+ @dataclass(frozen=True)
511
+ class RawFilterAppliedToViewWarning(DMSSchemaWarning):
512
+ description = "Raw filter is applied to a view, which is against the neat data modeling lifecycle."
513
+ fix = "Do not use raw filter, instead use HasData filter or nodeType filter or change the data model design."
514
+ error_name: ClassVar[str] = "RawFilterAppliedToView"
515
+ view_id: dm.ViewId
516
+
517
+ def message(self) -> str:
518
+ return (
519
+ f"RawFilter applied to the view {self.view_id}."
520
+ " The usage of RawFilter is against the neat team recommendations and the neat data modeling lifecycle."
521
+ " When opting for raw filter, the user is responsible for any errors that arise in neat."
522
+ )
523
+
524
+ def dump(self) -> dict[str, Any]:
525
+ output = super().dump()
526
+ output["view_id"] = self.view_id.dump()
527
+ return output
528
+
529
+
510
530
  @dataclass(frozen=True)
511
531
  class NodeTypeFilterOnParentViewWarning(DMSSchemaWarning):
512
532
  description = (
@@ -237,7 +237,7 @@ class DMSViewInput:
237
237
  description: str | None = None
238
238
  implements: str | None = None
239
239
  reference: str | None = None
240
- filter_: Literal["hasData", "nodeType"] | None = None
240
+ filter_: Literal["hasData", "nodeType", "rawFilter"] | None = None
241
241
  in_model: bool = True
242
242
 
243
243
  @classmethod
@@ -8,6 +8,7 @@ from cognite.neat.rules.issues import IssueList
8
8
  from cognite.neat.rules.models._base import ExtensionCategory, SchemaCompleteness
9
9
  from cognite.neat.rules.models.data_types import DataType
10
10
  from cognite.neat.rules.models.entities import ContainerEntity
11
+ from cognite.neat.rules.models.wrapped_entities import RawFilter
11
12
 
12
13
  from ._rules import DMSProperty, DMSRules
13
14
 
@@ -25,6 +26,7 @@ class DMSPostValidation:
25
26
  self.issue_list = IssueList()
26
27
 
27
28
  def validate(self) -> IssueList:
29
+ self._validate_best_practices()
28
30
  self._consistent_container_properties()
29
31
  self._referenced_views_and_containers_are_existing()
30
32
  self._validate_extension()
@@ -241,6 +243,15 @@ class DMSPostValidation:
241
243
  )
242
244
  )
243
245
 
246
+ def _validate_best_practices(self) -> None:
247
+ for view in self.views:
248
+ if view.filter_ and isinstance(view.filter_, RawFilter):
249
+ self.issue_list.append(
250
+ issues.dms.RawFilterAppliedToViewWarning(
251
+ view_id=view.view.as_id(),
252
+ )
253
+ )
254
+
244
255
  @staticmethod
245
256
  def _changed_attributes_and_properties(
246
257
  new_dumped: dict[str, Any], existing_dumped: dict[str, Any]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cognite-neat
3
- Version: 0.77.1
3
+ Version: 0.77.2
4
4
  Summary: Knowledge graph transformation
5
5
  Home-page: https://cognite-neat.readthedocs-hosted.com/
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
1
  cognite/neat/__init__.py,sha256=v-rRiDOgZ3sQSMQKq0vgUQZvpeOkoHFXissAx6Ktg84,61
2
- cognite/neat/_version.py,sha256=KAGTP0ql_FPeQE1WIVlTa-PVmeudJNxVGVpT_IPdAEg,23
2
+ cognite/neat/_version.py,sha256=kh8YirXq1n0W6XtV5vM5A8L0p7-1zfBuOABzfVzGjbs,23
3
3
  cognite/neat/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  cognite/neat/app/api/asgi/metrics.py,sha256=nxFy7L5cChTI0a-zkCiJ59Aq8yLuIJp5c9Dg0wRXtV0,152
5
5
  cognite/neat/app/api/configuration.py,sha256=2U5M6M252swvQPQyooA1EBzFUZNtcTmuSaywfJDgckM,4232
@@ -187,7 +187,7 @@ cognite/neat/rules/importers/_spreadsheet2rules.py,sha256=dKTue97yZlPQagegfdyOWt
187
187
  cognite/neat/rules/importers/_yaml2rules.py,sha256=F0uksSz1A3po5OlRM2152_w5j8D9oYTLB9NFTkSMlWI,4275
188
188
  cognite/neat/rules/issues/__init__.py,sha256=Ms6jgCxCezc5IgTOwCFtXQPtoVFfOvdcXj84_rs917I,563
189
189
  cognite/neat/rules/issues/base.py,sha256=i2aTC-wq3UVW2bj_7wKeuhYxCpMD06Bd9-m00bWcTBs,6438
190
- cognite/neat/rules/issues/dms.py,sha256=7UyVCqLfky6-KR9-pGNDhJhhMpAxuvOXj2FG-OR5kSA,22035
190
+ cognite/neat/rules/issues/dms.py,sha256=LP6RREMg_CNKBwqYZLR7IBozKWzR607HH4JuUD7X9Fk,22893
191
191
  cognite/neat/rules/issues/fileread.py,sha256=ao199mtvhPSW0IA8ZQZ0RzuLIIipYtL0jp6fLqxb4_c,5748
192
192
  cognite/neat/rules/issues/formatters.py,sha256=_ag2bJ9hncOj8pAGJvTTEPs9kTtxbD7vkqvS9Zcnizc,3385
193
193
  cognite/neat/rules/issues/importing.py,sha256=p90847g_TbUAXMyxalcEaWXaPygJoSE5E85dQO4syoo,12288
@@ -204,10 +204,10 @@ cognite/neat/rules/models/dms/__init__.py,sha256=Wzyqzz2ZIjpUbDg04CMuuIAw-f2A02D
204
204
  cognite/neat/rules/models/dms/_converter.py,sha256=x3u3jLnkknozoXXoAXXOWFHCsppqUwSvWv9wMOJ2F1Y,5706
205
205
  cognite/neat/rules/models/dms/_exporter.py,sha256=WTokr7gyjrpxW212kZpFfvd7zw09RRVPjAsxe_aizFo,18903
206
206
  cognite/neat/rules/models/dms/_rules.py,sha256=ZLdJLdAJGX1l5t1hChEic9TOHdculbWRhiLbUluZRRQ,15568
207
- cognite/neat/rules/models/dms/_rules_input.py,sha256=qfInh3JYf7XGEghxPOtIj7GY0f5_aVvnYeUBmfGV9mk,13620
207
+ cognite/neat/rules/models/dms/_rules_input.py,sha256=2ZGE3nsQyJ7RgdR5o9Wf8XbpSD57ZPbhvMz6H92aJ9g,13633
208
208
  cognite/neat/rules/models/dms/_schema.py,sha256=6lJSLPoZAjFnbfFl6dmAJR0xlAsQKi_Obcxp8Lp_t-0,41973
209
209
  cognite/neat/rules/models/dms/_serializer.py,sha256=Zulj__rnaVNtrbGJPkn4dYMfMXWYyRmtNPR2Yb5zYW0,6668
210
- cognite/neat/rules/models/dms/_validation.py,sha256=rctt6ImSK5-fHhReH-BXbMlYu_EkTRYYE5c_JS-EQgM,14141
210
+ cognite/neat/rules/models/dms/_validation.py,sha256=-7bpj1vQybB7P7nqvSc1XjKJhbpIRCXBzm3pdx6pqPQ,14589
211
211
  cognite/neat/rules/models/domain.py,sha256=13OhG-XavE5ipU2ICaYaUhz60volkuVfbJrsp0PhaUU,2993
212
212
  cognite/neat/rules/models/entities.py,sha256=iBG84Jr1qQ7PvkMJUJzJ1oWApeONb1IACixdJSztUhk,16395
213
213
  cognite/neat/rules/models/information/__init__.py,sha256=KvbYxVk38qReGbGTrU_Y3P3Gz6Bfghk5lHSKs8DlTOI,195
@@ -272,8 +272,8 @@ cognite/neat/workflows/steps_registry.py,sha256=fkTX14ZA7_gkUYfWIlx7A1XbCidvqR23
272
272
  cognite/neat/workflows/tasks.py,sha256=dqlJwKAb0jlkl7abbY8RRz3m7MT4SK8-7cntMWkOYjw,788
273
273
  cognite/neat/workflows/triggers.py,sha256=_BLNplzoz0iic367u1mhHMHiUrCwP-SLK6_CZzfODX0,7071
274
274
  cognite/neat/workflows/utils.py,sha256=gKdy3RLG7ctRhbCRwaDIWpL9Mi98zm56-d4jfHDqP1E,453
275
- cognite_neat-0.77.1.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
276
- cognite_neat-0.77.1.dist-info/METADATA,sha256=CXlHgF0btEegP5yLRqUsR40q8fIh3zaMU9nAefHikpQ,9316
277
- cognite_neat-0.77.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
278
- cognite_neat-0.77.1.dist-info/entry_points.txt,sha256=61FPqiWb25vbqB0KI7znG8nsg_ibLHBvTjYnkPvNFso,50
279
- cognite_neat-0.77.1.dist-info/RECORD,,
275
+ cognite_neat-0.77.2.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
276
+ cognite_neat-0.77.2.dist-info/METADATA,sha256=3XmTaOBYr0Q856UUs19-zkc2BAeUTudgKn2LoMgHW6Q,9316
277
+ cognite_neat-0.77.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
278
+ cognite_neat-0.77.2.dist-info/entry_points.txt,sha256=61FPqiWb25vbqB0KI7znG8nsg_ibLHBvTjYnkPvNFso,50
279
+ cognite_neat-0.77.2.dist-info/RECORD,,