cognite-neat 1.0.19__py3-none-any.whl → 1.0.20__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.
@@ -152,6 +152,7 @@ class DMSView(TableObj):
152
152
  description: str | None = None
153
153
  implements: EntityList | None = None
154
154
  filter: str | None = None
155
+ in_model: bool | None = Field(None, exclude=True, description="Legacy column")
155
156
 
156
157
  @field_validator("filter", mode="after")
157
158
  def _legacy_filter(cls, value: str | None) -> str | None:
@@ -231,6 +232,31 @@ class TableDMS(TableObj):
231
232
  return {title_case(k): v for k, v in data.items()}
232
233
  return data
233
234
 
235
+ @model_validator(mode="after")
236
+ def _drop_in_model_false_views_definitions(self) -> "TableDMS":
237
+ """These method is used to drop definition of legacy views which have In Model column set to False
238
+ We need to drop these views from Views sheet and also drop their properties from Properties sheet.
239
+ """
240
+
241
+ views_to_drop: set[Entity] = set()
242
+ for view in self.views:
243
+ if isinstance(view.in_model, bool) and not view.in_model:
244
+ views_to_drop.add(view.view)
245
+
246
+ if not views_to_drop:
247
+ return self
248
+
249
+ print(
250
+ "You are using legacy `In Model` column which is no longer in use!"
251
+ f"\nTotal of {len(views_to_drop)} views has `In Model` set to False."
252
+ f"\nThese views and their property definitions will be dropped from the session!"
253
+ )
254
+
255
+ self.views = [view for view in self.views if view.view not in views_to_drop]
256
+ self.properties = [prop for prop in self.properties if prop.view not in views_to_drop]
257
+
258
+ return self
259
+
234
260
  @classmethod
235
261
  def get_sheet_columns(
236
262
  cls, sheet_id: str, sheet: FieldInfo | None = None, *, column_type: Literal["all", "required"] = "required"
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.0.19"
1
+ __version__ = "1.0.20"
2
2
  __engine__ = "^2.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite-neat
3
- Version: 1.0.19
3
+ Version: 1.0.20
4
4
  Summary: Knowledge graph transformation
5
5
  Author: Nikola Vasiljevic, Anders Albert
6
6
  Author-email: Nikola Vasiljevic <nikola.vasiljevic@cognite.com>, Anders Albert <anders.albert@cognite.com>
@@ -35,7 +35,7 @@ cognite/neat/_data_model/importers/__init__.py,sha256=dHnKnC_AXk42z6wzEHK15dxIOh
35
35
  cognite/neat/_data_model/importers/_api_importer.py,sha256=H8Ow3Tt7utuAuBhC6s7yWvhGqunHAtE0r0XRsVAr6IE,7280
36
36
  cognite/neat/_data_model/importers/_base.py,sha256=NRB0FcEBj4GaethU68nRffBfTedBBA866A3zfJNfmiQ,433
37
37
  cognite/neat/_data_model/importers/_table_importer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- cognite/neat/_data_model/importers/_table_importer/data_classes.py,sha256=-S379Apvz2QSchBTG89mrVdOrAo7LH_O1kjqMOlv-fk,9619
38
+ cognite/neat/_data_model/importers/_table_importer/data_classes.py,sha256=MU3gZg9w3OO0FCJfYdbfa4e8tSNPVhkPOzpJNab4jG4,10762
39
39
  cognite/neat/_data_model/importers/_table_importer/importer.py,sha256=lQ4_Gpv0haEwQEDYZJaxtR9dL6Y0ys9jbjFfWxH6s2o,8870
40
40
  cognite/neat/_data_model/importers/_table_importer/reader.py,sha256=I9-zHCpJLo7bj4BabAzSgNBDVUAocdhlvBfy95JkWRw,49451
41
41
  cognite/neat/_data_model/importers/_table_importer/source.py,sha256=h7u5ur5oetmvBs3wgj7Ody5uPF21QwxeAceoIhJ5qzo,3300
@@ -316,9 +316,9 @@ cognite/neat/_v0/session/_template.py,sha256=BNcvrW5y7LWzRM1XFxZkfR1Nc7e8UgjBClH
316
316
  cognite/neat/_v0/session/_to.py,sha256=AnsRSDDdfFyYwSgi0Z-904X7WdLtPfLlR0x1xsu_jAo,19447
317
317
  cognite/neat/_v0/session/_wizard.py,sha256=baPJgXAAF3d1bn4nbIzon1gWfJOeS5T43UXRDJEnD3c,1490
318
318
  cognite/neat/_v0/session/exceptions.py,sha256=jv52D-SjxGfgqaHR8vnpzo0SOJETIuwbyffSWAxSDJw,3495
319
- cognite/neat/_version.py,sha256=onSFVAbnxhsysa26LC582oahDsPs8hBbz60BuiI6-_k,45
319
+ cognite/neat/_version.py,sha256=sA2ZsS8D9yHBhDKFo6czh0Y817b0hccxIxB45Dzk75o,45
320
320
  cognite/neat/legacy.py,sha256=eI2ecxOV8ilGHyLZlN54ve_abtoK34oXognkFv3yvF0,219
321
321
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
322
- cognite_neat-1.0.19.dist-info/WHEEL,sha256=eycQt0QpYmJMLKpE3X9iDk8R04v2ZF0x82ogq-zP6bQ,79
323
- cognite_neat-1.0.19.dist-info/METADATA,sha256=9Z2LFjIc0ujZh2LS0wB4e4AK8OoipENA6btEAMW4rsY,6689
324
- cognite_neat-1.0.19.dist-info/RECORD,,
322
+ cognite_neat-1.0.20.dist-info/WHEEL,sha256=eycQt0QpYmJMLKpE3X9iDk8R04v2ZF0x82ogq-zP6bQ,79
323
+ cognite_neat-1.0.20.dist-info/METADATA,sha256=-nVza3PgQsgHSNGru9JTxml_7T4k4UqxhQo4hrbMMG0,6689
324
+ cognite_neat-1.0.20.dist-info/RECORD,,