Skip to content

feat(bigquery): add TotalServicesSkuSlotMillis to QueryStatistics - #13808

Merged
gcf-merge-on-green[bot] merged 1 commit into
googleapis:mainfrom
mma0727:total-services-sku
Feb 11, 2026
Merged

gcf-merge-on-green[bot] merged 1 commit into
googleapis:mainfrom
mma0727:total-services-sku

Conversation

@mma0727

@mma0727 mma0727 commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mma0727
mma0727 requested review from a team as code owners February 6, 2026 20:21
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Feb 6, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @mma0727, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances BigQuery's QueryStatistics by adding a new field, TotalServicesSkuSlotMillis. This addition provides more granular insight into the resource consumption of BigQuery jobs, specifically tracking slot-milliseconds attributed to external services and their associated billing. The change ensures that this new metric is correctly captured and validated within the client library.

Highlights

  • New Metric Added: Introduced TotalServicesSkuSlotMillis to the QueryStatistics struct in bigquery/job.go. This new field captures the total slot milliseconds consumed by external services that are billed on the services SKU.
  • Data Population: The TotalServicesSkuSlotMillis field is now populated from the underlying BigQuery API response (s.Query.TotalServicesSkuSlotMs) within the setStatistics method.
  • Integration Test Update: An integration test in bigquery/integration_test.go has been updated to include a validation check, ensuring that the TotalServicesSkuSlotMillis value is non-negative.
Changelog
  • bigquery/integration_test.go
    • Added a check to ensure TotalServicesSkuSlotMillis is greater than or equal to zero in query statistics integration tests.
  • bigquery/job.go
    • Added TotalServicesSkuSlotMillis field (int64) to the QueryStatistics struct with a descriptive comment.
    • Populated the new TotalServicesSkuSlotMillis field from the BigQuery API response in the setStatistics method.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the TotalServicesSkuSlotMillis field to the QueryStatistics struct to expose information about slot milliseconds for jobs on external services. The changes correctly populate this new field from the underlying BigQuery API response and include an integration test to validate the value. The implementation is straightforward and correct. The minor suggestion to fix a typo in a test error message is retained.

Comment thread bigquery/integration_test.go Outdated
}

if qStats.TotalServicesSkuSlotMillis < 0 {
t.Errorf("expected total services SKU slot ms >= 0, got: %d", qStats.TotalServicesSkuSlotMillis)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a minor typo in the error message string: an extra space exists between ms and >=.

Suggested change
t.Errorf("expected total services SKU slot ms >= 0, got: %d", qStats.TotalServicesSkuSlotMillis)
t.Errorf("expected total services SKU slot ms >= 0, got: %d", qStats.TotalServicesSkuSlotMillis)

@mma0727
mma0727 force-pushed the total-services-sku branch from b69278d to dfb8c04 Compare February 6, 2026 20:27
@shollyman shollyman changed the title bigquery: add TotalServicesSkuSlotMillis to QueryStatistics feat(bigquery): add TotalServicesSkuSlotMillis to QueryStatistics Feb 11, 2026
@shollyman shollyman added kokoro:force-run Add this label to force Kokoro to re-run the tests. automerge Merge the pull request once unit tests and other checks pass. labels Feb 11, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 11, 2026
@gcf-merge-on-green
gcf-merge-on-green Bot merged commit d716a47 into googleapis:main Feb 11, 2026
9 of 10 checks passed
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 11, 2026
shollyman added a commit that referenced this pull request Feb 25, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.8.3
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:19bb93e8f1f916c61b597db2bad65dc432f79baaabb210499d7d0e4ad1dffe29
<details><summary>bigquery: v1.74.0</summary>

##
[v1.74.0](bigquery/v1.73.1...bigquery/v1.74.0)
(2026-02-25)

### Features

* add TotalServicesSkuSlotMillis to QueryStatistics (#13808)
([d716a47](d716a472))

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants