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 2020/08/17 03:17:54 UTC

[GitHub] [airflow] coopergillan opened a new pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

coopergillan opened a new pull request #10354:
URL: https://github.com/apache/airflow/pull/10354


   Several methods used in `GCSToBigQueryOperator` are deprecated. Switch to use the preferred methods, updating parameters and tests as needed.
   
   related: #10288
   
   Note: I only had time to tackle the operator mentioned by the user who opened the issue. It looks like the other Big Query transfer operators have the same issue. I could tackle those at a later date.
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
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



[GitHub] [airflow] coopergillan commented on pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
coopergillan commented on pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#issuecomment-970407407


   @turbaszek - sorry for the nearly-year-long silence. I am hhoping to take a look back into this as it appears that the issue https://github.com/apache/airflow/issues/10288 is still open.


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] turbaszek removed a comment on pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
turbaszek removed a comment on pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#issuecomment-732021183


   @coopergillan any progress on this one? 


----------------------------------------------------------------
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



[GitHub] [airflow] turbaszek commented on pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#issuecomment-732021183


   @coopergillan any progress on this one? 


----------------------------------------------------------------
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



[GitHub] [airflow] turbaszek commented on pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#issuecomment-732034823


   Hey @coopergillan do you have bandwitdth to continue this PR? It's quite important one as we have few issues around this operator 🔥 Maybe @juneoh would like to help? 


----------------------------------------------------------------
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



[GitHub] [airflow] stale[bot] commented on pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
stale[bot] commented on pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#issuecomment-703189591


   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
   


----------------------------------------------------------------
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



[GitHub] [airflow] coopergillan commented on pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
coopergillan commented on pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#issuecomment-674634143


   @turbaszek and @mik-laj both chimed in over in the original issue https://github.com/apache/airflow/issues/10288.


----------------------------------------------------------------
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



[GitHub] [airflow] turbaszek commented on a change in pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #10354:
URL: https://github.com/apache/airflow/pull/10354#discussion_r471291646



##########
File path: airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
##########
@@ -258,7 +258,7 @@ def execute(self, context):
         cursor = conn.cursor()
 
         if self.external_table:
-            cursor.create_external_table(
+            bq_hook.create_external_table(

Review comment:
       This method is also deprecated 

##########
File path: airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
##########
@@ -276,7 +276,7 @@ def execute(self, context):
                 encryption_configuration=self.encryption_configuration
             )
         else:
-            cursor.run_load(
+            bq_hook.insert_job(configuration=dict(

Review comment:
       That won't do:
   ```
   airflow.exceptions.AirflowException: Unknown job type. Supported types: dict_keys(['load', 'copy', 'extract', 'query'])
   ```
   as per docstring:
   ```
   The configuration parameter maps directly to
               BigQuery's configuration field in the job object. See
               https://cloud.google.com/bigquery/docs/reference/v2/jobs for
               details.
   ```
   
   So what I would suggest is:
   - add `configuration` parameter to constructor
   - if this parameter is passed then use `insert_job` method
   - if not then show a deprecation warning that `Users should pass load job definition` and use the existing logic
   
   Probably we should validate that only `load` job is passed... WDYT @edejong ?
   




----------------------------------------------------------------
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



[GitHub] [airflow] stale[bot] closed pull request #10354: Discontinue using deprecated methods in GCSToBigQueryOperator

Posted by GitBox <gi...@apache.org>.
stale[bot] closed pull request #10354:
URL: https://github.com/apache/airflow/pull/10354


   


----------------------------------------------------------------
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