Skip to content

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

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

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

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

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