googleapis / googleapis/google-cloud-go

bigquery: dataset.Metadata() returns empty StorageBillingModel

Open
#13,225 6 comments 2 reactions 1 assignee Claimed by @alvarowolfx View on GitHub
api: bigquery priority: p2 type: bug
Dominant language
Go
Stars
4.5k
Forks
1.6k
Avg merge
1d 13h
Merged PRs (30d)
109

Description

## Client

BigQuery

## Environment

(reproducible in multiple environments)
Go 1.25
Package: cloud.google.com/go/bigquery v1.71.0

## Code and Dependencies

```go
client, err := bigquery.NewClient(ctx, "my-project-id")
if err != nil {
log.Fatal(err)
}
dataset := client.Dataset("my_dataset")

datasetMD, err := dataset.Metadata(ctx)
if err != nil {
return nil, err
}

fmt.Printf("StorageBillingModel: %q\n", datasetMD.StorageBillingModel)
```

## Expected Behavior

dataset.Metadata(ctx) should return "LOGICAL" or "PHYSICAL", consistent with the value returned by the REST API:
```sh
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://bigquery.googleapis.com/bigquery/v2/projects//datasets/"
```

## Actual Behavior

StorageBillingModel is always an empty string (""), even though the REST API returns the correct value.

Example output:
```
StorageBillingModel: ""
```

Equivalent REST API response for the same dataset:
```
{
"id": "projects/my-project/datasets/my_dataset",
"storageBillingModel": "PHYSICAL"
}
```

## Additional context

- The field previously worked as expected.
- Appears to have stopped populating recently (reports began a few days ago).
- Confirmed that upgrading from v1.69 → v1.71 did not resolve the issue.
- No local code changes. The problem may be due to a regression in how the SDK reads dataset metadata.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.