SameerMesiah97 commented on code in PR #69108:
URL: https://github.com/apache/airflow/pull/69108#discussion_r3488603502
##########
providers/google/tests/unit/google/cloud/transfers/test_gcs_to_bigquery.py:
##########
@@ -2093,6 +2095,35 @@ def
test_src_fmt_configs_and_extra_config_both_applied_with_precedence(self, hoo
assert config["load"]["skipLeadingRows"] == 5
assert config["load"]["columnNameCharacterMap"] == "STRICT"
+ def test_schema_fields_is_templated(self):
+ """Regression test for #31481.
+
+ ``schema_fields`` must be a template field so a templated value (e.g.
an
+ XComArg or Variable resolving to a schema) is rendered at runtime
instead of
+ being passed through verbatim.
+ """
+ assert "schema_fields" in GCSToBigQueryOperator.template_fields
+ assert
GCSToBigQueryOperator.template_fields_renderers["schema_fields"] == "json"
+
+ with DAG(
+ dag_id="test_gcs_to_bq_schema_fields_templating",
+ schedule=None,
+ start_date=datetime(2024, 1, 1),
+ render_template_as_native_obj=True,
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]