dimas-b commented on code in PR #1289: URL: https://github.com/apache/polaris/pull/1289#discussion_r2029490650
########## service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java: ########## @@ -462,7 +462,7 @@ public boolean dropTable(TableIdentifier tableIdentifier, boolean purge) { @Override public List<TableIdentifier> listTables(Namespace namespace) { - if (!namespaceExists(namespace) && !namespace.isEmpty()) { + if (!namespaceExists(namespace)) { throw new NoSuchNamespaceException( "Cannot list tables for namespace. Namespace does not exist: %s", namespace); Review Comment: Maybe add quotes around `%s` (same for views)? The empty namespace will result in an awkward message otherwise. ########## quarkus/service/src/test/java/org/apache/polaris/service/quarkus/catalog/IcebergCatalogTest.java: ########## @@ -386,18 +387,29 @@ public Map<String, BaseResult> purgeRealms(Iterable<String> realms) { }; } - /** TODO: Unblock this test, see: https://github.com/apache/polaris/issues/1272 */ - @Override @Test - @Disabled( - """ - Disabled because the behavior is not applicable to Polaris. - To unblock: - 1) Align Polaris behavior with the superclass by handling empty namespaces the same way, or - 2) Modify this test to expect an exception and add a Polaris-specific version. - """) - public void listNamespacesWithEmptyNamespace() { - super.listNamespacesWithEmptyNamespace(); + public void testEmptyNamespace() { + IcebergCatalog catalog = catalog(); + TableIdentifier tableInRootNs = TableIdentifier.of("table"); + + ThrowingCallable createTable = () -> catalog.createTable(tableInRootNs, SCHEMA); + Assertions.assertThatThrownBy(createTable).isInstanceOf(NoSuchNamespaceException.class); Review Comment: Could you assert the message of this `NoSuchNamespaceException`? -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org