Skip to content

Move template-field validation out of GoogleCampaignManagerDeleteRepo… - #71343

Open
bujjibabukatta wants to merge 1 commit into
apache:mainfrom
bujjibabukatta:fix/#70296-2
Open

Move template-field validation out of GoogleCampaignManagerDeleteRepo…#71343
bujjibabukatta wants to merge 1 commit into
apache:mainfrom
bujjibabukatta:fix/#70296-2

Conversation

@bujjibabukatta

Copy link
Copy Markdown
Contributor

Part of #70296.

Summary

Moves report_name / report_id validation in GoogleCampaignManagerDeleteReportOperator
from __init__ into execute(), and removes the class from the
validate-operators-init exemption list.

Root cause

report_name and report_id are template fields, which are rendered after the
constructor runs. Validating them in __init__ therefore checks the un-rendered
Jinja expressions instead of the actual values — the reason this class was on the
exemption list.

Fix

  • campaign_manager.py — moved the "provide report_name or report_id" and
    "only one of them" checks from __init__ to the start of execute(); __init__
    now only does plain self.field = field assignments.
  • validate_operators_init_exemptions.txt — removed the
    GoogleCampaignManagerDeleteReportOperator entry (required in the same PR; the
    hook fails on a stale exemption once the class is compliant).
  • test_campaign_manager.py — added tests asserting both invalid cases (both
    provided / neither provided) now raise from execute().

Was generative AI tooling used ?

  • Yes - Claude

Generated-by: Claude following the guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:providers backport-to-v3-3-test Backport to v3-3-test provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant