@mock.patch('airflow.providers.google.common.hooks.base_google.GoogleBaseHook._get_credentials_and_project_id', return_value=(CREDENTIALS, PROJECT_ID))
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.insert_job')
def test_legacy_sql_override_propagates_properly(self, mock_insert, mock_get_service, mock_get_creds_and_proj_id):
    bq_hook = BigQueryHook(use_legacy_sql=False)
    bq_hook.get_first('query')
    (_, kwargs) = mock_insert.call_args
    assert (kwargs['configuration']['query']['useLegacySql'] is False)
@mock.patch('airflow.providers.google.common.hooks.base_google.GoogleBaseHook._get_credentials_and_project_id', return_value=(CREDENTIALS, PROJECT_ID))
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.insert_job')
def test_legacy_sql_override_propagates_properly(self, mock_insert, mock_get_service, mock_get_creds_and_proj_id):
    bq_hook = BigQueryHook(use_legacy_sql=False)
    bq_hook.get_first('query')
    (_, kwargs) = mock_insert.call_args
    assert (kwargs['configuration']['query']['useLegacySql'] is False)