cognite-neat 1.0.15__py3-none-any.whl → 1.0.16__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/_data_model/deployer/data_classes.py +20 -0
- cognite/neat/_data_model/models/dms/_view_filter.py +4 -1
- cognite/neat/_version.py +1 -1
- {cognite_neat-1.0.15.dist-info → cognite_neat-1.0.16.dist-info}/METADATA +1 -1
- {cognite_neat-1.0.15.dist-info → cognite_neat-1.0.16.dist-info}/RECORD +6 -6
- {cognite_neat-1.0.15.dist-info → cognite_neat-1.0.16.dist-info}/WHEEL +1 -1
|
@@ -622,3 +622,23 @@ class DeploymentResult(BaseDeployObject):
|
|
|
622
622
|
|
|
623
623
|
output.update(counts)
|
|
624
624
|
return output
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
def humanize_changes(changes: Sequence[FieldChange]) -> str:
|
|
628
|
+
primitive_changes = get_primitive_changes(changes)
|
|
629
|
+
lines = []
|
|
630
|
+
for change in primitive_changes:
|
|
631
|
+
lines.append(f"- Field '{change.field_path}': {change.description}")
|
|
632
|
+
return "\n".join(lines)
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
def get_primitive_changes(changes: Sequence[FieldChange]) -> list[PrimitiveField]:
|
|
636
|
+
primitive_changes: list[PrimitiveField] = []
|
|
637
|
+
for change in changes:
|
|
638
|
+
if isinstance(change, FieldChanges):
|
|
639
|
+
primitive_changes.extend(get_primitive_changes(change.changes))
|
|
640
|
+
elif isinstance(change, PrimitiveField):
|
|
641
|
+
primitive_changes.append(change)
|
|
642
|
+
else:
|
|
643
|
+
raise NotImplementedError(f"Unknown FieldChange type: {type(change)}")
|
|
644
|
+
return primitive_changes
|
|
@@ -250,6 +250,9 @@ def _move_filter_key(value: Any) -> Any:
|
|
|
250
250
|
return value
|
|
251
251
|
if len(value) != 1:
|
|
252
252
|
raise ValueError("Filter data must have exactly one key.")
|
|
253
|
+
# legacy filter which we want to ignore
|
|
254
|
+
if "invalid" in value:
|
|
255
|
+
return None
|
|
253
256
|
if "filterType" in value:
|
|
254
257
|
# Already in the correct format
|
|
255
258
|
return value
|
|
@@ -280,6 +283,6 @@ def _move_filter_key(value: Any) -> Any:
|
|
|
280
283
|
return value
|
|
281
284
|
|
|
282
285
|
|
|
283
|
-
Filter = Annotated[dict[FilterTypes, FilterData], BeforeValidator(_move_filter_key)]
|
|
286
|
+
Filter = Annotated[dict[FilterTypes, FilterData] | None, BeforeValidator(_move_filter_key)]
|
|
284
287
|
|
|
285
288
|
FilterAdapter: TypeAdapter[Filter] = TypeAdapter(Filter)
|
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "1.0.
|
|
1
|
+
__version__ = "1.0.16"
|
|
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
|
+
Version: 1.0.16
|
|
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>
|
|
@@ -22,7 +22,7 @@ cognite/neat/_data_model/deployer/_differ_container.py,sha256=mcy7PhUOfnvAxnZWNo
|
|
|
22
22
|
cognite/neat/_data_model/deployer/_differ_data_model.py,sha256=iA7Xp-7NRvzZJXLLpJaLebkKKpv_VCBKPX6f-RU9wBk,1864
|
|
23
23
|
cognite/neat/_data_model/deployer/_differ_space.py,sha256=J_AaqiseLpwQsOkKc7gmho4U2oSWAGVeEdQNepZiWw0,343
|
|
24
24
|
cognite/neat/_data_model/deployer/_differ_view.py,sha256=g1xHwsoxFUaTOTtQa19nntKF3rxFzc2FxpKKFAUN_NE,11412
|
|
25
|
-
cognite/neat/_data_model/deployer/data_classes.py,sha256=
|
|
25
|
+
cognite/neat/_data_model/deployer/data_classes.py,sha256=cq86u7wuKCcvH-A_cGI_gWzlQCTIG6mrXG2MahdiGco,27299
|
|
26
26
|
cognite/neat/_data_model/deployer/deployer.py,sha256=acMGnAeZnfFf-kzN5UFDiErT48bsTW7qsXhwdt9h-Mw,19096
|
|
27
27
|
cognite/neat/_data_model/exporters/__init__.py,sha256=AskjmB_0Vqib4kN84bWt8-M8nO42QypFf-l-E8oA5W8,482
|
|
28
28
|
cognite/neat/_data_model/exporters/_api_exporter.py,sha256=G9cqezy_SH8VdhW4o862qBHh_QcbzfP6O1Yyjvdpeog,1579
|
|
@@ -60,7 +60,7 @@ cognite/neat/_data_model/models/dms/_references.py,sha256=Mx_nxfvOrvAx7nvebhhbFw
|
|
|
60
60
|
cognite/neat/_data_model/models/dms/_schema.py,sha256=2JFLcm52smzPdtZ69Lf02UbYAD8I_hpRbI7ZAzdxJJs,641
|
|
61
61
|
cognite/neat/_data_model/models/dms/_space.py,sha256=3KvWg0bVuLpgQwhkDbsJ53ZMMmK0cKUgfyDRrSrERko,1904
|
|
62
62
|
cognite/neat/_data_model/models/dms/_types.py,sha256=5-cgC53AG186OZUqkltv7pMjcGNLuH7Etbn8IUcgk1c,447
|
|
63
|
-
cognite/neat/_data_model/models/dms/_view_filter.py,sha256=
|
|
63
|
+
cognite/neat/_data_model/models/dms/_view_filter.py,sha256=uV5cI8CA_L28Ry2KhH_bSwOx1zru31s5J5ak7TGVPj0,10577
|
|
64
64
|
cognite/neat/_data_model/models/dms/_view_property.py,sha256=nJBPmw4KzJOdaQmvRfCE3A4FL-E13OsNUEufI64vLKo,9271
|
|
65
65
|
cognite/neat/_data_model/models/dms/_views.py,sha256=oWSqp9_tBNwKQgj4xKICQKE3f89Ya6Xyjcms-I66zN0,8931
|
|
66
66
|
cognite/neat/_data_model/models/entities/__init__.py,sha256=7dDyES7fYl9LEREal59F038RdEvfGRpUOc6n_MtSgjU,836
|
|
@@ -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=
|
|
319
|
+
cognite/neat/_version.py,sha256=NWe6vYJNJJT0Uxz7Lq74J6fpGVLlbxI8usM-joa7U2M,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.
|
|
323
|
-
cognite_neat-1.0.
|
|
324
|
-
cognite_neat-1.0.
|
|
322
|
+
cognite_neat-1.0.16.dist-info/WHEEL,sha256=KSLUh82mDPEPk0Bx0ScXlWL64bc8KmzIPNcpQZFV-6E,79
|
|
323
|
+
cognite_neat-1.0.16.dist-info/METADATA,sha256=c8Vvlzs386LWDcbannET6hwQeUN3jqro7eLUdRRvzoQ,6091
|
|
324
|
+
cognite_neat-1.0.16.dist-info/RECORD,,
|