You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/08/09 21:55:43 UTC

[GitHub] [airflow] bingqinzhou edited a comment on issue #5764: Change default value of autodetect to be True.

bingqinzhou edited a comment on issue #5764: Change default value of autodetect to be True.
URL: https://github.com/apache/airflow/pull/5764#issuecomment-520076369
 
 
   > This seems to be reasonable change but is it backward compatible? If user passes a schema definition and autodetect is set to True will the schema be use instead of autodetection?
   > 
   That's a good catch. Not sure how this autodetect config will ultimately be handled by google, but I think for this case, schema should still be used instead of autodetection. Please refer to codes below:
   
   - If schema_fields is not None, it will use schema_fields.
   (https://github.com/apache/airflow/blob/master/airflow/contrib/operators/gcs_to_bq.py#L242-L243)
   - If schema_fields is None but schema_objects is not None, it will use schema_objects.
   (https://github.com/apache/airflow/blob/master/airflow/contrib/operators/gcs_to_bq.py#L229-L235)
   - If schema_fields is None, schema_objects is None and autodetect is True, it will use autodection.
   (https://github.com/apache/airflow/blob/master/airflow/contrib/operators/gcs_to_bq.py#L239-L240)
   - If schema_fields is None, schema_object is None, and autodetect is False, it will throw Exception.
   (https://github.com/apache/airflow/blob/master/airflow/contrib/operators/gcs_to_bq.py#L236-L238)
   
   > Also, please adjust commit and PR message to reference the JIRA issue ✅
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services