@parameterized.expand([(['INCORRECT_OPTION'], None, "\\['INCORRECT_OPTION'\\] contains invalid schema update options\\. Please only use one or more of the following options: \\['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION'\\]"), (['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION', 'INCORRECT_OPTION'], None, "\\['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION', 'INCORRECT_OPTION'\\] contains invalid schema update options\\. Please only use one or more of the following options: \\['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION'\\]"), (['ALLOW_FIELD_ADDITION'], None, "schema_update_options is only allowed if write_disposition is 'WRITE_APPEND' or 'WRITE_TRUNCATE'")])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
def test_run_query_schema_update_options_incorrect(self, schema_update_options, write_disposition, expected_regex, mock_get_service):
    with pytest.raises(ValueError, match=expected_regex):
        self.hook.run_query(sql='query', destination_dataset_table='my_dataset.my_table', schema_update_options=schema_update_options, write_disposition=write_disposition)
@parameterized.expand([(['INCORRECT_OPTION'], None, "\\['INCORRECT_OPTION'\\] contains invalid schema update options\\. Please only use one or more of the following options: \\['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION'\\]"), (['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION', 'INCORRECT_OPTION'], None, "\\['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION', 'INCORRECT_OPTION'\\] contains invalid schema update options\\. Please only use one or more of the following options: \\['ALLOW_FIELD_ADDITION', 'ALLOW_FIELD_RELAXATION'\\]"), (['ALLOW_FIELD_ADDITION'], None, "schema_update_options is only allowed if write_disposition is 'WRITE_APPEND' or 'WRITE_TRUNCATE'")])
@mock.patch('airflow.providers.google.cloud.hooks.bigquery.BigQueryHook.get_service')
def test_run_query_schema_update_options_incorrect(self, schema_update_options, write_disposition, expected_regex, mock_get_service):
    with pytest.raises(ValueError, match=expected_regex):
        self.hook.run_query(sql='query', destination_dataset_table='my_dataset.my_table', schema_update_options=schema_update_options, write_disposition=write_disposition)