Skip to content

Make schema_fields templated in GCSToBigQueryOperator#69108

Open
nikolauspschuetz wants to merge 1 commit into
apache:mainfrom
nikolauspschuetz:fix/gcs-to-bq-template-schema-fields-31481
Open

Make schema_fields templated in GCSToBigQueryOperator#69108
nikolauspschuetz wants to merge 1 commit into
apache:mainfrom
nikolauspschuetz:fix/gcs-to-bq-template-schema-fields-31481

Conversation

@nikolauspschuetz

Copy link
Copy Markdown

GCSToBigQueryOperator.schema_fields was not a template field, so a templated value (a Variable or XComArg resolving to a schema) passed to it was never rendered — the raw, unresolved object reached BigQuery (e.g. surfacing as "Object of type MappedArgument is not JSON serializable").

This marks schema_fields as templated and registers a json renderer, matching how BigQueryUpdateTableSchemaOperator already templates schema_fields_updates. Callers passing a plain list/dict are unaffected; only the previously-broken templated case changes.

closes: #31481


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

schema_fields was not a template field, so a templated value (a Variable
or XComArg resolving to a schema) passed to GCSToBigQueryOperator was never
rendered and reached BigQuery unresolved. Mark it templated, matching how
BigQueryUpdateTableSchemaOperator already templates schema_fields_updates.
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Jun 28, 2026

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

Looks fine. Just have one comment.

dag_id="test_gcs_to_bq_schema_fields_templating",
schedule=None,
start_date=datetime(2024, 1, 1),
render_template_as_native_obj=True,

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.

I am just wondering if render_template_as_native_obj=True is strictly required for this test? If not, we can skip creating the DAG object.

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.

[google-cloud-transfers] Object of type MappedArgument is not JSON serializable

2 participants