badalprasadsingh commented on code in PR #2785: URL: https://github.com/apache/iceberg-go/pull/2785#discussion_r4781304101
########## catalog/catalogtest/catalogtest.go: ########## Review Comment: lets also mention UpdatableViewCatalog os implementers know why the update cases skip one line should do both as #2786's rename cases need the same line ########## catalog/catalogtest/update_view.go: ########## @@ -0,0 +1,140 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package catalogtest + +import ( + "context" + "testing" + + "github.com/apache/iceberg-go" + "github.com/apache/iceberg-go/catalog" + "github.com/apache/iceberg-go/table" + "github.com/apache/iceberg-go/view" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// updateViewPropertyKey is the property the UpdateView tests set and remove. +const updateViewPropertyKey = "conformance.update-view" + +// newUpdatableViewCatalog returns a fresh catalog from cfg with its view and +// view update capabilities. It skips the test when either is missing. +func newUpdatableViewCatalog(t *testing.T, cfg Config) (catalog.Catalog, catalog.ViewCatalog, catalog.UpdatableViewCatalog) { + t.Helper() + + cat, views := newViewCatalog(t, cfg) + updater, ok := catalog.As[catalog.UpdatableViewCatalog](cat) + if !ok { + t.Skip("catalog does not implement catalog.UpdatableViewCatalog") + } + + return cat, views, updater Review Comment: similar comment to 2786, the rest client always implements `UpdatableViewCatalog`, so any server that serves views but not `POST /v1/{prefix}/namespaces/{namespace}/views/{view}` fails all four cases -> though the package doc says view tests skip on ErrNotImplemented better: we can probe like newViewCatalog and newRegisterableCatalog -- 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]
