fix: extract_gemini_web_search_count#418
fix: extract_gemini_web_search_count#418zachary822 wants to merge 3 commits intoPostHog:masterPostHog/posthog-python:masterfrom zachary822:fix_extract_gemini_web_search_countzachary822/posthog-python:fix_extract_gemini_web_search_countCopy head branch name to clipboard
Conversation
| def test_none_candidates_no_web_search(mock_client, mock_google_genai_client): | ||
| """Test that response with candidates=None does not crash web search extraction.""" | ||
|
|
||
| mock_response = MagicMock() |
There was a problem hiding this comment.
[P3] Prefer parameterizing the web-search “no candidates” cases
This new test covers candidates=None, but it duplicates the structure of the existing “no web search” tests nearby; given the repo preference for parameterized tests, it’d be simpler to combine the “no candidates” variants (e.g. candidates=None and candidates=[]) into one @pytest.mark.parametrize case table so new edge cases don’t keep adding near-identical blocks.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/test/ai/gemini/test_gemini.py
Line: 1166:1169
Comment:
[P3] Prefer parameterizing the web-search “no candidates” cases
This new test covers `candidates=None`, but it duplicates the structure of the existing “no web search” tests nearby; given the repo preference for parameterized tests, it’d be simpler to combine the “no candidates” variants (e.g. `candidates=None` and `candidates=[]`) into one `@pytest.mark.parametrize` case table so new edge cases don’t keep adding near-identical blocks.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.|
We've updated our release process. We require |
I added the file sampo generated. |
extract_gemini_web_search_counterrors ifresponse.candidatesis None