Skip to content

Prevent premature validation in Gemini batch job operators#70362

Merged
shahar1 merged 1 commit into
apache:mainfrom
daesung9511:move-gemini-batch-validation
Jul 24, 2026
Merged

Prevent premature validation in Gemini batch job operators#70362
shahar1 merged 1 commit into
apache:mainfrom
daesung9511:move-gemini-batch-validation

Conversation

@daesung9511

@daesung9511 daesung9511 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Move argument validation from operator initialization to execution time for GenAIGeminiCreateBatchJobOperator and GenAIGeminiCreateEmbeddingsBatchJobOperator.

Template fields are rendered after operator initialization. Performing validation in __init__ can therefore inspect unresolved Jinja expressions instead of their rendered values.

This change:

  • moves the relevant validations to execute
  • updates the corresponding unit tests to verify execution-time validation
  • removes both operators from the operator initialization exemption list

Tests:

breeze run pytest providers/google/tests/unit/google/cloud/operators/test_gen_ai.py \
  -k "GenAIGeminiCreateBatchJobOperator or GenAIGeminiCreateEmbeddingsBatchJobOperator"
prek run --from-ref main

related: #70296


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

@shahar1 shahar1 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.

Well done!

@shahar1
shahar1 merged commit a1c27c5 into apache:main Jul 24, 2026
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants