diff --git a/cognite/client/data_classes/data_modeling/views.py b/cognite/client/data_classes/data_modeling/views.py index f516fc06f5..714845ae5b 100644 --- a/cognite/client/data_classes/data_modeling/views.py +++ b/cognite/client/data_classes/data_modeling/views.py @@ -429,6 +429,8 @@ def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = ) if "direction" in resource: instance.direction = resource["direction"] + if "connectionType" in resource: + instance.connection_type = resource["connectionType"] return instance def dump(self, camel_case: bool = True) -> dict[str, Any]: @@ -456,6 +458,7 @@ def as_apply(self) -> SingleHopConnectionDefinitionApply: description=self.description, edge_source=self.edge_source, direction=self.direction, + connection_type=self.connection_type, ) @@ -557,6 +560,8 @@ def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None = ) if "direction" in resource: instance.direction = resource["direction"] + if "connectionType" in resource: + instance.connection_type = resource["connectionType"] return instance def dump(self, camel_case: bool = True) -> dict: diff --git a/tests/tests_unit/test_data_classes/test_data_models/test_views.py b/tests/tests_unit/test_data_classes/test_data_models/test_views.py index 03b4771847..e904c3cd28 100644 --- a/tests/tests_unit/test_data_classes/test_data_models/test_views.py +++ b/tests/tests_unit/test_data_classes/test_data_models/test_views.py @@ -54,7 +54,7 @@ def test_load_dumped_mapped_property_for_apply(self) -> None: def test_load_dump_connection_property(self) -> None: input = { - "connectionType": "multiEdgeConnection", + "connectionType": "multi_edge_connection", "type": {"space": "mySpace", "externalId": "myExternalId"}, "source": {"type": "view", "space": "mySpace", "externalId": "myExternalId", "version": "myVersion"}, "direction": "outwards", @@ -64,7 +64,7 @@ def test_load_dump_connection_property(self) -> None: actual = ViewProperty.load(input) assert actual.dump(camel_case=False) == { - "connection_type": "multiEdgeConnection", + "connection_type": "multi_edge_connection", "description": None, "direction": "outwards", "edge_source": None,