From d7fcf6801f81c91ca1c451140447d29abbc33a4e Mon Sep 17 00:00:00 2001 From: David Li Date: Thu, 10 Sep 2026 02:46:37 +0900 Subject: [PATCH 1/3] feat(go): skip tables in GetObjects that 403 (#296) For example, this happens if you enable listing anonymous datasets because you'll pick up other users' result tables. --- go/connection.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/go/connection.go b/go/connection.go index 9097c6e..4a7fc47 100644 --- a/go/connection.go +++ b/go/connection.go @@ -27,6 +27,7 @@ import ( "context" "crypto/tls" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -43,6 +44,7 @@ import ( "github.com/apache/arrow-go/v18/arrow" "golang.org/x/oauth2" "golang.org/x/oauth2/google/externalaccount" + "google.golang.org/api/googleapi" "google.golang.org/api/impersonate" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -148,7 +150,6 @@ func (c *connectionImpl) GetDBSchemasForCatalog(ctx context.Context, catalog str if schemaPattern.MatchString(ds.DatasetID) { res = append(res, ds.DatasetID) } - } return res, nil @@ -180,6 +181,11 @@ func (c *connectionImpl) GetTablesForDBSchema(ctx context.Context, catalog strin md, err := table.Metadata(ctx, bigquery.WithMetadataView(bigquery.BasicMetadataView)) if err != nil { + if apiErr, ok := errors.AsType[*googleapi.Error](err); ok && apiErr.Code == http.StatusForbidden { + // "User does not have permission to access results of another user's job" + // No sense in erroring the entire list operation; just treat it as nonexistent + continue + } return nil, errToAdbcErr(adbc.StatusInternal, err, "get table metadata for %s.%s.%s", catalog, schema, table.TableID) } From 368b8151ca260ed367efa7a8c87a932d967a0a9b Mon Sep 17 00:00:00 2001 From: David Li Date: Thu, 17 Sep 2026 16:07:12 +0900 Subject: [PATCH 2/3] fix(go): skip 404'd tables in GetObjects --- go/connection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/connection.go b/go/connection.go index 4a7fc47..3996276 100644 --- a/go/connection.go +++ b/go/connection.go @@ -181,9 +181,11 @@ func (c *connectionImpl) GetTablesForDBSchema(ctx context.Context, catalog strin md, err := table.Metadata(ctx, bigquery.WithMetadataView(bigquery.BasicMetadataView)) if err != nil { - if apiErr, ok := errors.AsType[*googleapi.Error](err); ok && apiErr.Code == http.StatusForbidden { + if apiErr, ok := errors.AsType[*googleapi.Error](err); ok && apiErr.Code == http.StatusForbidden || apiErr.Code == http.StatusNotFound { // "User does not have permission to access results of another user's job" // No sense in erroring the entire list operation; just treat it as nonexistent + + // Similarly a 404 probably just means a TOC/TOU error and we can proceed continue } return nil, errToAdbcErr(adbc.StatusInternal, err, "get table metadata for %s.%s.%s", catalog, schema, table.TableID) From 5cbfa626d267c49729988af4bc6312e275b2ced0 Mon Sep 17 00:00:00 2001 From: David Li Date: Thu, 17 Sep 2026 20:09:03 +0900 Subject: [PATCH 3/3] Fix logical error in error handling condition Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- go/connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/connection.go b/go/connection.go index 3996276..eae651d 100644 --- a/go/connection.go +++ b/go/connection.go @@ -181,7 +181,7 @@ func (c *connectionImpl) GetTablesForDBSchema(ctx context.Context, catalog strin md, err := table.Metadata(ctx, bigquery.WithMetadataView(bigquery.BasicMetadataView)) if err != nil { - if apiErr, ok := errors.AsType[*googleapi.Error](err); ok && apiErr.Code == http.StatusForbidden || apiErr.Code == http.StatusNotFound { + if apiErr, ok := errors.AsType[*googleapi.Error](err); ok && (apiErr.Code == http.StatusForbidden || apiErr.Code == http.StatusNotFound) { // "User does not have permission to access results of another user's job" // No sense in erroring the entire list operation; just treat it as nonexistent