Skip to content

chore(automl): mock AutoMlClient in test_predicition_client_client_info - #18068

Merged
parthea merged 1 commit into
mainfrom
fix-automl-tables-client-mock
Aug 11, 2026
Merged

chore(automl): mock AutoMlClient in test_predicition_client_client_info#18068
parthea merged 1 commit into
mainfrom
fix-automl-tables-client-mock

Conversation

@ohmayr

@ohmayr ohmayr commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Following #17616, google-api-core extracts and deduplicates the x-goog-api-client metrics header during callable construction in _GapicCallable.__init__ (_extract_metrics_header). Because AutoMlClient was not mocked in this test, passing client_info=mock.Mock() caused AutoMlClient's transport wrapper to attempt unpacking the mock metadata into (key, value) pairs, resulting in:

TypeError: cannot unpack non-iterable Mock object

@ohmayr
ohmayr requested a review from a team as a code owner August 11, 2026 16:28

@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 the unit test test_prediction_client_client_info in test_tables_client_v1beta1.py to mock and pass a client argument when instantiating TablesClient. There are no review comments, and I have no feedback to provide.

@parthea
parthea enabled auto-merge (squash) August 11, 2026 17:00
@parthea
parthea merged commit ccc7498 into main Aug 11, 2026
52 checks passed
@parthea
parthea deleted the fix-automl-tables-client-mock branch August 11, 2026 17:05
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.

2 participants