ebyhr commented on code in PR #3224:
URL: https://github.com/apache/iceberg-python/pull/3224#discussion_r3185347605


##########
tests/integration/test_rest_catalog.py:
##########
@@ -62,3 +67,47 @@ def test_create_namespace_if_already_existing(catalog: 
RestCatalog) -> None:
     catalog.create_namespace_if_not_exists(TEST_NAMESPACE_IDENTIFIER)
 
     assert catalog.namespace_exists(TEST_NAMESPACE_IDENTIFIER)
+
+
[email protected]
[email protected]("catalog", [lf("session_catalog")])
+def test_load_view(catalog: RestCatalog, table_schema_nested: Schema, 
database_name: str, view_name: str) -> None:
+    identifier = (database_name, view_name)
+    if not catalog.namespace_exists(database_name):
+        catalog.create_namespace(database_name)
+
+    view_version = ViewVersion(
+        version_id=1,
+        schema_id=1,
+        timestamp_ms=int(time.time() * 1000),
+        summary={},
+        representations=[
+            SQLViewRepresentation(
+                type="sql",
+                sql="SELECT 1 as some_col",
+                dialect="spark",
+            )
+        ],
+        default_namespace=["default"],
+    )
+    view = catalog.create_view(identifier, table_schema_nested, 
view_version=view_version)
+    loaded_view = catalog.load_view(identifier)
+    assert view.name() == loaded_view.name()
+    assert view.metadata == loaded_view.metadata

Review Comment:
   We could verify the entire object instead:
   ```suggestion
       assert view == loaded_view
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to