Add unit tests for BigQuery to SQL transfer base operator#69788
Open
desusaiteja wants to merge 1 commit into
Open
Add unit tests for BigQuery to SQL transfer base operator#69788desusaiteja wants to merge 1 commit into
desusaiteja wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pycovers the abstractBigQueryToSqlBaseOperator(the base for the BigQuery→MySQL/Postgres/MsSQL transfer operators) through a minimal concrete subclass:dataset_tableparsing intodataset_id/table_id, including theValueErrorfor malformed valuesBigQueryHookconstruction with the operator'sgcp_conn_id,location, andimpersonation_chainexecute()fetching from BigQuery and inserting every batch into the target SQL table with the righttarget_fields,replace, andcommit_everyargumentspersist_links()being invoked with the task contextget_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?
Generated-by: Claude Code (Fable 5) following the guidelines