From a2d3d3ee372eddc6c30a36dba524f3cfc0f4b026 Mon Sep 17 00:00:00 2001 From: Derek Perkins Date: Tue, 1 Aug 2023 16:19:21 -0600 Subject: [PATCH] fix(bigquery): use JobFromProject for storage iterator There's no guarantee that the provided client is in the same project or location as the job, so those details need to also be provided from the job object --- bigquery/storage_iterator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigquery/storage_iterator.go b/bigquery/storage_iterator.go index 48f131be0c17..c0ef9fedfb37 100644 --- a/bigquery/storage_iterator.go +++ b/bigquery/storage_iterator.go @@ -67,7 +67,7 @@ func newStorageRowIteratorFromTable(ctx context.Context, table *Table, ordered b func newStorageRowIteratorFromJob(ctx context.Context, j *Job) (*RowIterator, error) { // Needed to fetch destination table - job, err := j.c.JobFromID(ctx, j.jobID) + job, err := j.c.JobFromProject(ctx, j.projectID, j.jobID, j.location) if err != nil { return nil, err }