cognite-neat 1.0.30__py3-none-any.whl → 1.0.31__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.
@@ -890,10 +890,12 @@ class ValidationResources:
890
890
  - to_remove: Existing constraints that are redundant or wrongly oriented
891
891
  - status: The optimization status for this view
892
892
  """
893
- modifiable_containers_in_view = self.containers_by_view.get(view, set()).intersection(
894
- self.modifiable_containers
895
- )
893
+ containers_in_view = self.containers_by_view.get(view, set())
894
+ modifiable_containers_in_view = containers_in_view.intersection(self.modifiable_containers)
896
895
  if not modifiable_containers_in_view:
896
+ # No modifiable containers - check if view is already optimized via existing constraints
897
+ if self.forms_directed_path(containers_in_view, self.requires_constraint_graph):
898
+ return RequiresChangesForView(set(), set(), RequiresChangeStatus.OPTIMAL)
897
899
  return RequiresChangesForView(set(), set(), RequiresChangeStatus.NO_MODIFIABLE_CONTAINERS)
898
900
 
899
901
  # Early exit for inherently unsolvable views (no CDM anchor + all modifiables are roots)
@@ -50,7 +50,7 @@ class MissingRequiresConstraint(DataModelValidator):
50
50
 
51
51
  message = (
52
52
  f"View '{view_ref!s}' is not optimized for querying. "
53
- f"Add a 'requires' constraint from '{src!s}' to '{dst!s}'."
53
+ f"Add a 'requires' constraint from the container '{src!s}' to '{dst!s}'."
54
54
  )
55
55
  if not is_safe:
56
56
  # Find a superset view to suggest for ingestion
@@ -113,8 +113,9 @@ class SuboptimalRequiresConstraint(DataModelValidator):
113
113
  recommendations.append(
114
114
  Recommendation(
115
115
  message=(
116
- f"View '{view_ref!s}' has a requires constraint '{src!s}' -> '{dst!s}' "
117
- "that is not part of the optimal structure. Consider removing it."
116
+ f"View '{view_ref!s}' is mapping to container '{src!s}' "
117
+ f"that has a requires constraint to '{dst!s}'. This constraint is "
118
+ "not part of the optimal structure. Consider removing it."
118
119
  ),
119
120
  fix="Remove the unnecessary requires constraint",
120
121
  code=self.code,
@@ -170,8 +171,8 @@ class UnresolvableQueryPerformance(DataModelValidator):
170
171
  recommendations.append(
171
172
  Recommendation(
172
173
  message=(
173
- f"View '{view_ref!s}' has poor query performance. "
174
- "It maps only to CDF built-in containers which cannot have requires constraints. "
174
+ f"View '{view_ref!s}' is not optimized for querying. It maps only to CDF "
175
+ "built-in containers and some of these lack requires constraints between them. "
175
176
  "Consider adding a view-specific container that requires the others."
176
177
  ),
177
178
  fix="Add a container that requires the others, or restructure the view",
@@ -182,7 +183,7 @@ class UnresolvableQueryPerformance(DataModelValidator):
182
183
  recommendations.append(
183
184
  Recommendation(
184
185
  message=(
185
- f"View '{view_ref!s}' has poor query performance. "
186
+ f"View '{view_ref!s}' is not optimized for querying. "
186
187
  "No valid requires constraint solution was found. "
187
188
  "Consider adding a view-specific container that requires the others."
188
189
  ),
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "1.0.30"
1
+ __version__ = "1.0.31"
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.30
3
+ Version: 1.0.31
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>
@@ -17,7 +17,7 @@ cognite/neat/_client/statistics_api.py,sha256=5meeh0v5mxC2SMB7xGdOwMh4KkaX3DtpUj
17
17
  cognite/neat/_client/views_api.py,sha256=YMaw7IaxU4gmixpd_t1u9JK9BHfNerf5DMNinGPCAa0,3692
18
18
  cognite/neat/_config.py,sha256=IJS_R-86M4SLxdo644LZ0dE9h0jg2XBL1A4QKWJj0TQ,10160
19
19
  cognite/neat/_data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- cognite/neat/_data_model/_analysis.py,sha256=Z5HQ1ExB58Y_2W79ovOXbhyHQiAuB0S86117ZYMMjpg,43285
20
+ cognite/neat/_data_model/_analysis.py,sha256=y-U2ko4uIGu4bgnL6HIZnZWrEZSZFH0Kf3NdQ5870ns,43595
21
21
  cognite/neat/_data_model/_constants.py,sha256=h6FaREqE2KG7hy2ZQVDq-3_yjVjlpSG6Usz2kadIUIs,1722
22
22
  cognite/neat/_data_model/_identifiers.py,sha256=lDLvMvYDgRNFgk5GmxWzOUunG7M3synAciNjzJI0m_o,1913
23
23
  cognite/neat/_data_model/_shared.py,sha256=H0gFqa8tKFNWuvdat5jL6OwySjCw3aQkLPY3wtb9Wrw,1302
@@ -84,7 +84,7 @@ cognite/neat/_data_model/validation/dms/_consistency.py,sha256=IKSUoRQfQQcsymviE
84
84
  cognite/neat/_data_model/validation/dms/_containers.py,sha256=n2L8HiJLylHIkzGi1veGb2QLVEFZuLlOwws77mxm0Fw,10552
85
85
  cognite/neat/_data_model/validation/dms/_limits.py,sha256=rAIh54DJBPi3J7d7eD-jMdldZS8R2vlkQ5MD9RxNsrI,14830
86
86
  cognite/neat/_data_model/validation/dms/_orchestrator.py,sha256=qiuUSUmNhekFyBARUUO2yhG-X9AeU_LL49UrJ65JXFA,2964
87
- cognite/neat/_data_model/validation/dms/_performance.py,sha256=hq4neZfoa0EKdYjhiQpugP9jrhSpTsn8_VJRncTj5Bk,8500
87
+ cognite/neat/_data_model/validation/dms/_performance.py,sha256=LvSQpmoYblSVqnSX5EOqCXnwPfMTGSndVCkX3ogoOSc,8611
88
88
  cognite/neat/_data_model/validation/dms/_views.py,sha256=pRdnj5ZBnHNnbLKleXGbipteGma8_l5AYsDIfqgAil4,6345
89
89
  cognite/neat/_exceptions.py,sha256=hOjPL1vFNNAZzqAHFB9l9ek-XJEBKcqiaPk0onwLPns,2540
90
90
  cognite/neat/_issues.py,sha256=wH1mnkrpBsHUkQMGUHFLUIQWQlfJ_qMfdF7q0d9wNhY,1871
@@ -328,9 +328,9 @@ cognite/neat/_v0/session/_template.py,sha256=BNcvrW5y7LWzRM1XFxZkfR1Nc7e8UgjBClH
328
328
  cognite/neat/_v0/session/_to.py,sha256=AnsRSDDdfFyYwSgi0Z-904X7WdLtPfLlR0x1xsu_jAo,19447
329
329
  cognite/neat/_v0/session/_wizard.py,sha256=baPJgXAAF3d1bn4nbIzon1gWfJOeS5T43UXRDJEnD3c,1490
330
330
  cognite/neat/_v0/session/exceptions.py,sha256=jv52D-SjxGfgqaHR8vnpzo0SOJETIuwbyffSWAxSDJw,3495
331
- cognite/neat/_version.py,sha256=6cfMmDsIfl6IMAFwlEU9DPRkWwKrndMYQPZ5zAZvnuk,45
331
+ cognite/neat/_version.py,sha256=q5vmOs-FCuZ31umumKHe6GbNV8ckfBN8mfbY89LmFps,45
332
332
  cognite/neat/legacy.py,sha256=DMFeLCSBLT2enk-nm1KfX1rKR2DQDpxY-w6ThY0y9c8,421
333
333
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
334
- cognite_neat-1.0.30.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
335
- cognite_neat-1.0.30.dist-info/METADATA,sha256=ixyEZ8MjefyUNCq_1yz_hoqgVeARW7_jFhxCrF0OfW0,6872
336
- cognite_neat-1.0.30.dist-info/RECORD,,
334
+ cognite_neat-1.0.31.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
335
+ cognite_neat-1.0.31.dist-info/METADATA,sha256=ME2bvIHfAazZH8FezWe5bURIdXAqIvoKCTl8pHpsobA,6872
336
+ cognite_neat-1.0.31.dist-info/RECORD,,