Skip to content

Conversation

@bobhancockg
Copy link
Contributor

This commit introduces type hints for function arguments, return values, and local variables in examples/audience_insights/generate_audience_insights.py.

Key changes include:

  • Added type hints to all function signatures and return types.
  • Added inline type hints for variables within functions.
  • Imported necessary types from typing, Google Ads client libraries, services, enums, and types modules.
  • Ensured proper organization and removal of unused or duplicate imports.
  • Updated some variable assignments to use specific Enum members for clarity (e.g., AudienceInsightsDimensionEnum).
  • Replaced some string formatting with f-strings in exception handling.

These changes improve code readability, maintainability, and help with static analysis, making your example code more robust and easier to understand.

@bobhancockg bobhancockg requested a review from a team as a code owner May 24, 2025 12:49
@bobhancockg bobhancockg requested review from Raibaz and dorasun May 24, 2025 12:49
@bobhancockg bobhancockg changed the title feat: Add type hints and annotations to audience_insights example Added type hints to examples/audience_insights Jun 2, 2025
This commit introduces type hints for function arguments, return values,
and local variables in `examples/audience_insights/generate_audience_insights.py`.

Key changes include:
- Added type hints to all function signatures and return types.
- Added inline type hints for variables within functions.
- Imported necessary types from `typing`, Google Ads client libraries,
  services, enums, and types modules.
- Ensured proper organization and removal of unused or duplicate imports.
- Updated some variable assignments to use specific Enum members for clarity
  (e.g., `AudienceInsightsDimensionEnum`).
- Replaced some string formatting with f-strings in exception handling.

These changes improve code readability, maintainability, and help with
static analysis, making your example code more robust and easier to understand.
@BenRKarl BenRKarl force-pushed the add-type-hints-audience-insights branch from 89e0688 to 5f38c69 Compare July 21, 2025 18:48
@BenRKarl BenRKarl removed request for Raibaz and dorasun July 21, 2025 18:49
@BenRKarl BenRKarl added the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Jul 21, 2025
@kokoro-team kokoro-team removed the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Jul 21, 2025
@BenRKarl BenRKarl merged commit 9f91899 into main Jul 21, 2025
4 checks passed
@BenRKarl BenRKarl deleted the add-type-hints-audience-insights branch July 21, 2025 19:30
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.

3 participants