cognite-neat 1.0.4__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
 
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.0.4"
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.4
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=PG0hTrgdtokkHUdUcZQhG_UiE_vFIC9YHCENYSPb91w,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
@@ -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.4.dist-info/METADATA,sha256=5n7OsUlUVMaXmo5m9O4VQsSsWleV2xcjomJdMjyMBTE,6030
316
- cognite_neat-1.0.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
317
- cognite_neat-1.0.4.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
318
- cognite_neat-1.0.4.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,,