Skip to content

Commit 6af5063

Browse files
kevinjqliuCopilot
andcommitted
Cover register_view in REST identifier integration test
Register the created view under a second name that needs URL encoding, now that View exposes its metadata location (#4088). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4677321 commit 6af5063

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎tests/integration/test_catalog.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ def test_rest_identifiers_with_special_characters(
730730
namespace = (*parent, name)
731731
table_identifier = (*namespace, f"table {name}")
732732
view_identifier = (*namespace, f"view {name}")
733+
registered_view_identifier = (*namespace, f"registered view {name}")
733734

734735
rest_catalog.create_namespace(parent)
735736
rest_catalog.create_namespace(namespace, properties={"key": name})
@@ -748,10 +749,16 @@ def test_rest_identifiers_with_special_characters(
748749
assert rest_catalog.load_table(table_identifier).properties["key"] == name
749750

750751
view = View(view_identifier, ViewMetadata.model_validate(example_view_metadata_v1))
751-
rest_catalog.create_view(view_identifier, view.schema(), view.current_version())
752+
created_view = rest_catalog.create_view(view_identifier, view.schema(), view.current_version())
752753
assert rest_catalog.view_exists(view_identifier)
753754
assert rest_catalog.list_views(namespace) == [view_identifier]
754755

756+
assert created_view.metadata_location is not None
757+
rest_catalog.register_view(registered_view_identifier, created_view.metadata_location)
758+
assert rest_catalog.view_exists(registered_view_identifier)
759+
assert sorted(rest_catalog.list_views(namespace)) == sorted([view_identifier, registered_view_identifier])
760+
761+
rest_catalog.drop_view(registered_view_identifier)
755762
rest_catalog.drop_view(view_identifier)
756763
rest_catalog.drop_table(table_identifier)
757764
rest_catalog.drop_namespace(namespace)

0 commit comments

Comments
 (0)