PiotrAndrzejewsky commented on code in PR #14637:
URL: https://github.com/apache/gravitino/pull/14637#discussion_r4491694197
##########
clients/client-python/tests/unittests/test_relational_catalog.py:
##########
@@ -565,6 +710,72 @@ def test_alter_view_not_exists(self):
ViewChange.rename("new_view"),
)
+ def test_alter_view_set_property(self):
+ ident = NameIdentifier.of(self.schema_name, "view1")
+ updated = self._new_view_dto(
+ "view1",
+ "comment",
+ self._default_columns(),
+ self._default_representations(),
+ properties={"k1": "v1"},
+ )
+ req = ViewUpdateRequest.SetViewPropertyRequest(_property="k1",
_value="v1")
+ self._run_alter_view(ident, req, updated,
ViewChange.set_property("k1", "v1"))
+
+ def test_alter_view_remove_property(self):
+ ident = NameIdentifier.of(self.schema_name, "view1")
+ updated = self._new_view_dto(
+ "view1",
+ "comment",
+ self._default_columns(),
+ self._default_representations(),
+ )
+ req = ViewUpdateRequest.RemoveViewPropertyRequest(_property="k1")
+ self._run_alter_view(ident, req, updated,
ViewChange.remove_property("k1"))
+
+ def test_alter_view_replace(self):
+ ident = NameIdentifier.of(self.schema_name, "view1")
+ new_rep = SQLRepresentationDTO(
+ _dialect=Dialects.TRINO,
+ _sql="SELECT 3",
+ )
+ new_columns = self._default_columns()
+ new_reps = [new_rep]
+ updated = self._new_view_dto(
+ "view1",
+ "new comment",
+ new_columns,
+ new_reps,
+ )
Review Comment:
Done! Allowed default_catalog and default_schema in _new_view_dto() to
accept None, set both to None in the updated fixture, and added assertions
verifying that altered.default_catalog() and altered.default_schema() are None.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]