Skip to content

...fix: update template fields - #70679

Open
osintalex wants to merge 1 commit into
apache:mainfrom
osintalex:add-template-fields-vertex-batch-operator
Open

...fix: update template fields#70679
osintalex wants to merge 1 commit into
apache:mainfrom
osintalex:add-template-fields-vertex-batch-operator

Conversation

@osintalex

Copy link
Copy Markdown

Allow callers to template both gcs, bq inputs and outputs for batch jobs. I am adding this in after swapping from using the vertex batch ai job operator to writing my own custom operator due to the inability to template destinations and outputs to both gcs and bq.

This seems like normal airflow behaviour to me to allow templating for different inputs/outputs, i.e. in dev environment you would inject a dev bigquery project from the config and then template that to build <dev-project>.<dataset> whereas in prod you would have <prod-project>.<dataset>. Lacking the ability to do this in my experience pretty much breaks this operator for multi-stage work environments where you want the same code to run across dev/staging/prod.


Was generative AI tooling used to co-author this PR?

No


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@osintalex
osintalex requested a review from shahar1 as a code owner July 29, 2026 11:52
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Jul 29, 2026
Allow callers to template both gcs, bq inputs and outputs for batch jobs
@osintalex
osintalex force-pushed the add-template-fields-vertex-batch-operator branch from e6d2c3d to 6b06797 Compare July 29, 2026 11:52

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

  1. Could you please fix the PR title? (it should very specific to what you patch in this PR, without conventional commits prefixes like fix:)
  2. To get this approved and merged we'll need stronger justifications than just "it looks normal" - did you, or anyone else, actually need it on real-production cases? Do we need it for all currently suggested fields, or only few would be sufficient?

Template fields, at least in their current design, might incur a technical debt if misused in the operator - so we should be very picky regarding new additions.
I raised up #70296 after improving the pre-commit that checks for more forms of misuse, and there were about 60 justified cases where it applied. It might not be the case here (I'll let the CI/CD run to judge that), but I want to ensure that they have indeed a valid case, because we cannot easily break it afterwards.

I would like to note that if you have a valid case and you need this feature, you could always subclass and override the existing operator.

"gcs_source",
"bigquery_source",
"gcs_destination_prefix",
"gcs_destination_prefix",

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.

This appears twice

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants