Skip to content

Add unit tests for BigQuery to SQL transfer base operator#69788

Draft
desusaiteja wants to merge 1 commit into
apache:mainfrom
desusaiteja:add-unit-tests-bigquery-to-sql
Draft

Add unit tests for BigQuery to SQL transfer base operator#69788
desusaiteja wants to merge 1 commit into
apache:mainfrom
desusaiteja:add-unit-tests-bigquery-to-sql

Conversation

@desusaiteja

@desusaiteja desusaiteja commented Jul 12, 2026

Copy link
Copy Markdown

Adds a dedicated unit test module for airflow.providers.google.cloud.transfers.bigquery_to_sql, which previously had no tests of its own — it is one of the missing provider test modules tracked in #35442.

The new providers/google/tests/unit/google/cloud/transfers/test_bigquery_to_sql.py covers the abstract BigQueryToSqlBaseOperator (the base for the BigQuery→MySQL/Postgres/MsSQL transfer operators) through a minimal concrete subclass:

  • dataset_table parsing into dataset_id/table_id, including the ValueError for malformed values
  • BigQueryHook construction with the operator's gcp_conn_id, location, and impersonation_chain
  • execute() fetching from BigQuery and inserting every batch into the target SQL table with the right target_fields, replace, and commit_every arguments
  • persist_links() being invoked with the task context
  • get_openlineage_facets_on_complete() returning empty lineage when the BigQuery table cannot be fetched or the SQL hook provides no database info (the happy paths are already covered by the concrete operators' tests)

All 9 new tests pass locally, along with the existing bigquery_to_mysql/postgres/mssql test modules and the fast/manual prek static checks.

related: #35442


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

Generated-by: Claude Code (Fable 5) following the guidelines


Important

🛠️ Maintainer triage note for @desusaiteja · by @potiuk · 2026-07-15 16:00 UTC

Helpful heads-up from the maintainers — please address before this PR can be reviewed (see our Pull Request quality criteria):

  • Provider tests. See docs.

The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.

Automated triage — may be imperfect; a maintainer takes the next look.

The bigquery_to_sql module had no dedicated test module. This adds
coverage for the abstract BigQueryToSqlBaseOperator that concrete
transfer operators (MySQL, Postgres, MsSQL) build on, as part of the
missing provider test modules tracked in apache#35442.
@desusaiteja
desusaiteja requested a review from shahar1 as a code owner July 12, 2026 22:11
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Jul 12, 2026
@potiuk
potiuk marked this pull request as draft July 15, 2026 16:01
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.

1 participant