cognite-neat 1.0.3__py3-none-any.whl → 1.0.5__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/neat/_config.py CHANGED
@@ -14,8 +14,15 @@ if sys.version_info >= (3, 11):
14
14
  else:
15
15
  import tomli # type: ignore
16
16
 
17
+ # Public profiles
17
18
  PredefinedProfile: TypeAlias = Literal["legacy-additive", "legacy-rebuild", "deep-additive", "deep-rebuild"]
18
19
 
20
+ # Private profiles only
21
+ _PrivateProfiles: TypeAlias = Literal["no-validation-additive", "no-validation-rebuild"]
22
+
23
+ # All profiles (union of public and private)
24
+ _AllProfiles: TypeAlias = PredefinedProfile | _PrivateProfiles
25
+
19
26
 
20
27
  class ConfigModel(BaseModel):
21
28
  model_config = ConfigDict(populate_by_name=True, validate_assignment=True)
@@ -25,6 +32,7 @@ class ValidationConfig(ConfigModel):
25
32
  """Validation configuration."""
26
33
 
27
34
  exclude: list[str] = Field(default_factory=list)
35
+ override: bool = Field(False, description="If enabled, all validators are skipped.")
28
36
 
29
37
  def can_run_validator(self, code: str, issue_type: type) -> bool:
30
38
  """
@@ -40,7 +48,7 @@ class ValidationConfig(ConfigModel):
40
48
 
41
49
  is_excluded = self._is_excluded(code, self.exclude)
42
50
 
43
- if issue_type in [ModelSyntaxError, ConsistencyError] and is_excluded:
51
+ if issue_type in [ModelSyntaxError, ConsistencyError] and is_excluded and not self.override:
44
52
  print(f"Validator {code} was excluded however it is a critical validator and will still run.")
45
53
  return True
46
54
  else:
@@ -141,7 +149,7 @@ class NeatConfig(ConfigModel):
141
149
  return available_profiles[profile]
142
150
 
143
151
 
144
- def internal_profiles() -> dict[PredefinedProfile, NeatConfig]:
152
+ def internal_profiles() -> dict[_AllProfiles, NeatConfig]:
145
153
  """Get internal NeatConfig profile by name."""
146
154
  return {
147
155
  "legacy-additive": NeatConfig(
@@ -180,6 +188,16 @@ def internal_profiles() -> dict[PredefinedProfile, NeatConfig]:
180
188
  modeling=ModelingConfig(mode="rebuild"),
181
189
  validation=ValidationConfig(exclude=[]),
182
190
  ),
191
+ "no-validation-rebuild": NeatConfig(
192
+ profile="no-validation-rebuild",
193
+ modeling=ModelingConfig(mode="rebuild"),
194
+ validation=ValidationConfig(exclude=["*"], override=True),
195
+ ),
196
+ "no-validation-additive": NeatConfig(
197
+ profile="no-validation-additive",
198
+ modeling=ModelingConfig(mode="additive"),
199
+ validation=ValidationConfig(exclude=["*"], override=True),
200
+ ),
183
201
  }
184
202
 
185
203
 
@@ -496,7 +496,7 @@ class AppliedChanges(BaseDeployObject):
496
496
 
497
497
 
498
498
  class DeploymentResult(BaseDeployObject):
499
- status: Literal["success", "failure", "partial", "pending"]
499
+ status: Literal["success", "failure", "partial", "pending", "recovered", "recovery_failed"]
500
500
  plan: list[ResourceDeploymentPlan]
501
501
  snapshot: SchemaSnapshot
502
502
  responses: AppliedChanges | None = None
@@ -117,7 +117,11 @@ class SchemaDeployer(OnSuccessResultProducer):
117
117
  if not changes.is_success and self.options.auto_rollback:
118
118
  recovery = self.apply_changes(changes.as_recovery_plan())
119
119
  return DeploymentResult(
120
- status="success", plan=list(plan), snapshot=snapshot, responses=changes, recovery=recovery
120
+ status="recovered" if recovery.is_success else "recovery_failed",
121
+ plan=list(plan),
122
+ snapshot=snapshot,
123
+ responses=changes,
124
+ recovery=recovery,
121
125
  )
122
126
  return DeploymentResult(
123
127
  status="success" if changes.is_success else "partial", plan=list(plan), snapshot=snapshot, responses=changes
@@ -234,7 +234,7 @@ class WritePhysicalDataModel:
234
234
 
235
235
  return self._store.write_physical(writer, file_path=file_path)
236
236
 
237
- def cdf(self, dry_run: bool = True, rollback: bool = True, drop_data: bool = False) -> None:
237
+ def cdf(self, dry_run: bool = True, rollback: bool = False, drop_data: bool = False) -> None:
238
238
  """Write physical data model with views, containers, and spaces that are in the same space as the data model
239
239
  to CDF.
240
240
 
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.0.3"
1
+ __version__ = "1.0.5"
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.3
3
+ Version: 1.0.5
4
4
  Summary: Knowledge graph transformation
5
5
  Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
6
6
  Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
@@ -1,8 +1,8 @@
1
1
  cognite/neat/__init__.py,sha256=u5EhnGuNS2GKydU6lVFCNrBpHBBKUnCDAE63Cqk__eo,244
2
- cognite/neat/_config.py,sha256=NXObeA-860LV40KlY4orsqjMGACa0jKRz2UE5L9kH6U,8401
2
+ cognite/neat/_config.py,sha256=MzQiZer0Wyk6VEtfDtl_tTF9KYAjYu2Q8jE7RugMJuM,9201
3
3
  cognite/neat/_exceptions.py,sha256=ox-5hXpee4UJlPE7HpuEHV2C96aLbLKo-BhPDoOAzhA,1650
4
4
  cognite/neat/_issues.py,sha256=wH1mnkrpBsHUkQMGUHFLUIQWQlfJ_qMfdF7q0d9wNhY,1871
5
- cognite/neat/_version.py,sha256=frvUE6medkh8ryei1FSKVbaV9GjqKvs0ByOYDnxdRO0,44
5
+ cognite/neat/_version.py,sha256=NDqX1JNuap05sdyOpx-mO-YgfczKzQKq3Slx3_5vykg,44
6
6
  cognite/neat/legacy.py,sha256=eI2ecxOV8ilGHyLZlN54ve_abtoK34oXognkFv3yvF0,219
7
7
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  cognite/neat/_client/__init__.py,sha256=75Bh7eGhaN4sOt3ZcRzHl7pXaheu1z27kmTHeaI05vo,114
@@ -26,8 +26,8 @@ cognite/neat/_data_model/deployer/_differ_container.py,sha256=mcy7PhUOfnvAxnZWNo
26
26
  cognite/neat/_data_model/deployer/_differ_data_model.py,sha256=iA7Xp-7NRvzZJXLLpJaLebkKKpv_VCBKPX6f-RU9wBk,1864
27
27
  cognite/neat/_data_model/deployer/_differ_space.py,sha256=J_AaqiseLpwQsOkKc7gmho4U2oSWAGVeEdQNepZiWw0,343
28
28
  cognite/neat/_data_model/deployer/_differ_view.py,sha256=g1xHwsoxFUaTOTtQa19nntKF3rxFzc2FxpKKFAUN_NE,11412
29
- cognite/neat/_data_model/deployer/data_classes.py,sha256=ZNSBFNhq46FfERKwC3Zu2TU1RFDdFsnaUzTtztgWdDY,23050
30
- cognite/neat/_data_model/deployer/deployer.py,sha256=_d3A2JnrVD4sjBNJIkXbwtTQOW5fc7QWrQBdwBfN8fs,18277
29
+ cognite/neat/_data_model/deployer/data_classes.py,sha256=NTvLUYb_HbpzByKe_ZPvb-arOOs_YVfTjk3LzGpEHs0,23082
30
+ cognite/neat/_data_model/deployer/deployer.py,sha256=9ZFf9QAZEnyqmX3b4zSkdf5t3A1wnU6cYGDNut_KKuQ,18390
31
31
  cognite/neat/_data_model/exporters/__init__.py,sha256=AskjmB_0Vqib4kN84bWt8-M8nO42QypFf-l-E8oA5W8,482
32
32
  cognite/neat/_data_model/exporters/_api_exporter.py,sha256=G9cqezy_SH8VdhW4o862qBHh_QcbzfP6O1Yyjvdpeog,1579
33
33
  cognite/neat/_data_model/exporters/_base.py,sha256=rG_qAU5i5Hh5hUMep2UmDFFZID4x3LEenL6Z5C6N8GQ,646
@@ -85,7 +85,7 @@ cognite/neat/_data_model/validation/dms/_orchestrator.py,sha256=XrozA27fbzWCuCQK
85
85
  cognite/neat/_data_model/validation/dms/_views.py,sha256=M4egIa7UAMGtZlqzIxx6ZzL4e_qo8GbDGh7vs9wywD8,4266
86
86
  cognite/neat/_session/__init__.py,sha256=owqW5Mml2DSZx1AvPvwNRTBngfhBNrQ6EH-7CKL7Jp0,61
87
87
  cognite/neat/_session/_issues.py,sha256=E8UQeSJURg2dm4MF1pfD9dp-heSRT7pgQZgKlD1-FGs,2723
88
- cognite/neat/_session/_physical.py,sha256=ajNanS87THBESx_y1x6p6LomqOe51b197VKPaBPLZ30,11377
88
+ cognite/neat/_session/_physical.py,sha256=plYgj4D6e8iOA0AP4Pw-yC_WZFxip74rnXo4iFatWT0,11378
89
89
  cognite/neat/_session/_result.py,sha256=po2X4s-Tioe0GQAGCfK862hKXNRX5YjJZsEzNcTC8nI,7879
90
90
  cognite/neat/_session/_session.py,sha256=STrX0Q7dXw9W7y9LFgLV_3XoYJk1fGSyBalSblLEj5w,3264
91
91
  cognite/neat/_session/_wrappers.py,sha256=9t_MnJ0Sw_v-f6oTIh8dtAT-3oEbqumGuND97aPCC3M,3581
@@ -312,7 +312,7 @@ cognite/neat/_v0/session/_to.py,sha256=AnsRSDDdfFyYwSgi0Z-904X7WdLtPfLlR0x1xsu_j
312
312
  cognite/neat/_v0/session/_wizard.py,sha256=baPJgXAAF3d1bn4nbIzon1gWfJOeS5T43UXRDJEnD3c,1490
313
313
  cognite/neat/_v0/session/exceptions.py,sha256=jv52D-SjxGfgqaHR8vnpzo0SOJETIuwbyffSWAxSDJw,3495
314
314
  cognite/neat/_v0/session/_state/README.md,sha256=o6N7EL98lgyWffw8IoEUf2KG5uSKveD5__TW45YzVjA,902
315
- cognite_neat-1.0.3.dist-info/METADATA,sha256=8WESd9hWsL4-9kskDTTa4oYXY_Dv9RJJiy2W8ngdBLA,6030
316
- cognite_neat-1.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
317
- cognite_neat-1.0.3.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
318
- cognite_neat-1.0.3.dist-info/RECORD,,
315
+ cognite_neat-1.0.5.dist-info/METADATA,sha256=v5lXOc4kXrh0v0uaQST1u9Usb3RJVz__3YoJJafP-qU,6030
316
+ cognite_neat-1.0.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
317
+ cognite_neat-1.0.5.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
318
+ cognite_neat-1.0.5.dist-info/RECORD,,