EugeneYushin opened a new pull request, #45610:
URL: https://github.com/apache/airflow/pull/45610

   Closes https://github.com/apache/airflow/issues/45512
   
   This PR fixes the case when schema `autodetect` is used in 
`BigQueryCreateExternalTableOperator`. Currently, the table created in BigQuery 
can't be queried when empty `schema.fields` are passed to GCP. Simply omitting 
empty `schema.fields` to be passed in request body to GCP allows schema 
auto-detection flow to prosper.
   
   This part of API is marked as deprecated, hence [unit 
tests](https://github.com/apache/airflow/commit/ffe09d62ed15bbc09aeba19ebd5d1b2a2cc8e0ed)
 I was able to come up with fail:
   ```
   E   airflow.exceptions.AirflowProviderDeprecationWarning: Passing table 
parameters via keywords arguments will be deprecated. Please provide table 
definition using `table_resource` parameter.
   ```
   
   I was able to run that test with `--disable-forbidden-warnings ` flag:
   ```
   pytest --disable-forbidden-warnings 
providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryCreateExternalTableOperator
   ...
   
   
providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryCreateExternalTableOperator::test_execute_with_csv_format
 PASSED                                                                         
 [ 25%]
   
providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryCreateExternalTableOperator::test_execute_with_parquet_format
 PASSED                                                                      [ 
50%]
   
providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryCreateExternalTableOperator::test_get_openlineage_facets_on_complete
 PASSED                                                               [ 75%]
   
providers/tests/google/cloud/operators/test_bigquery.py::TestBigQueryCreateExternalTableOperator::test_execute_with_schema_fields_not_set
 PASSED                                                               [100%]
   ...
   
============================================================================================
 4 passed, 1 warning in 1.83s 
============================================================================================
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to