laskoviymishka commented on code in PR #2785: URL: https://github.com/apache/iceberg-go/pull/2785#discussion_r4782111988
########## 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: Fixed in e3ec4cac75, it now probes UpdateView like newViewCatalog and skips on ErrNotImplemented. ########## catalog/catalogtest/catalogtest.go: ########## Review Comment: Fixed in e3ec4cac75. Rename tests aren't on this branch, so I left the rename part to #2786; the line is shaped so it can just add RenamableViewCatalog there. -- 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]
