Skip to content

fix(bigquery): allow timestamp format overrides in createQueryStream#7905

Open
rafal-hawrylak wants to merge 1 commit intogoogleapis:mainfrom
rafal-hawrylak:bigquery-timestamp-format-param-pass-fix
Open

fix(bigquery): allow timestamp format overrides in createQueryStream#7905
rafal-hawrylak wants to merge 1 commit intogoogleapis:mainfrom
rafal-hawrylak:bigquery-timestamp-format-param-pass-fix

Conversation

@rafal-hawrylak
Copy link
Copy Markdown
Contributor

Description

This PR fixes a bug in createQueryStream where formatOptions were being stripped from the query object before reaching the internal request builder. This caused the library to always use the default ISO8601_STRING format, which is rejected by some BigQuery backends.

By extracting these options in queryAsStream_ and passing them through to the request builder, users can now successfully opt-out of the new default behavior when necessary.

Impact

  • createQueryStream now correctly handles formatOptions.timestampOutputFormat and formatOptions.useInt64Timestamp if provided in the options object.
  • Bypasses 'timestamp_output_format is not supported yet' errors in restricted environments.

Testing

  • Updated unit tests in test/bigquery.ts to verify the 'Gatekeeper' fix.
  • Added a specific test case to verify that formatOptions are correctly passed through.
  • Verified that all existing BigQuery tests pass.

## Description

This PR fixes a bug in createQueryStream where formatOptions were being
stripped from the query object before reaching the internal request builder.
This caused the library to always use the default ISO8601_STRING format,
which is rejected by some BigQuery backends.

By extracting these options in queryAsStream_ and passing them through to
the request builder, users can now successfully opt-out of the new default
behavior when necessary.

## Impact

- createQueryStream now correctly handles formatOptions.timestampOutputFormat
  and formatOptions.useInt64Timestamp if provided in the options object.
- Bypasses 'timestamp_output_format is not supported yet' errors in restricted
  environments.

## Testing

- Updated unit tests in test/bigquery.ts to verify the 'Gatekeeper' fix.
- Added a specific test case to verify that formatOptions are correctly passed through.
- Verified that all existing BigQuery tests pass.
@rafal-hawrylak rafal-hawrylak requested a review from a team as a code owner March 27, 2026 10:32
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Mar 27, 2026
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.

1 participant