Skip to content

chore(bigquery): ignore case in assertion - #18230

Open
daniel-sanche wants to merge 3 commits into
googleapis:mainfrom
daniel-sanche:fix_bigquery_unit
Open

chore(bigquery): ignore case in assertion#18230
daniel-sanche wants to merge 3 commits into
googleapis:mainfrom
daniel-sanche:fix_bigquery_unit

Conversation

@daniel-sanche

@daniel-sanche daniel-sanche commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

In #18064, X-Goog-API-Client was changed to lowercase. This broke an assertion in the bigquery tests

This PR updates the test to support either case, like #18064

@daniel-sanche
daniel-sanche requested review from a team as code owners August 26, 2026 23:23
@daniel-sanche
daniel-sanche requested review from GarrettWu and removed request for a team August 26, 2026 23:23

@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 updates a unit test in test_client.py to assert that http.request is called with a requests.structures.CaseInsensitiveDict for headers. However, accessing requests.structures directly will raise an AttributeError at runtime because the structures submodule is not exposed in the requests package's initialization. It is recommended to assert on headers=mock.ANY and perform a manual case-insensitive comparison of the headers instead.

Comment thread packages/google-cloud-bigquery/tests/unit/test_client.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant