Skip to content

Conversation

crescentrose
Copy link
Contributor

@crescentrose crescentrose commented May 26, 2025

The QUERY_CACHE_HIT variant was missing from the IndexUnusedCode enum. This caused deserialization to fail when requesting job details for a query that's been cached by Google Cloud.

Additionally, this commit also adds a second variant that was missing from this enum, STALE_INDEX. See the Google Cloud docs for reference:
https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#Code_1


Note: Adding new enum variants is a breaking change in Rust, but I suspect that Google does not see adding enum variants to their API as such. To mitigate this in the future, I would recommend:

  • mark all enums used in deserialization as #[non_exhaustive],
  • introduce a fallback "Other" variant to enums used for deserialization with #[serde(other)], so that a change in the Google Cloud API does not break existing code.

Let me know if you'd like me to help out with that. Ideally these changes should be done all at once as a part of v2.0 to minimize breakage (as tagging a public enum as #[non_exhaustive] is a breaking change in itself), and to avoid having to release multiple major versions.

The `QUERY_CACHE_HIT` variant was missing from the IndexUnusedCode
enum. This caused deserialization to fail when requesting job details
for a query that's been cached by Google Cloud.

Additionally, this commit also adds a second variant that was missing
from this enum, `STALE_INDEX`.

See the Google Cloud docs for reference:
https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#Code_1
@yoshidan yoshidan added the safe to test safe to test label May 28, 2025
@yoshidan yoshidan merged commit b1c49eb into yoshidan:main May 28, 2025
8 of 9 checks passed
@yoshidan
Copy link
Owner

Thank you for your contribution.

@crescentrose crescentrose deleted the add-missing-index-unused-variant branch June 2, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test safe to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants