turbaszek opened a new issue #10672:
URL: https://github.com/apache/airflow/issues/10672


   **Description**
   
   `BigQueryToGCSOperator` uses currently `cursor` from `BigQueryHook ` and its 
method `run_extract`. Both are deprecated. 
   
   This operator should use `insert_job` method of `BigQueryHook`. This method 
requires job configuration as specified in
   
https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfiguration. 
This operator should build `extract` configuration as a dictionary from user's 
input:
   
   ```python
   def execute(self, context):
          configuration = {
              "extract" : {
                   "destinationUris": self.destination_cloud_storage_uris,
                   ...
          }}
          hook = BigQueryHook(
               bigquery_conn_id=self.gcp_conn_id,
               delegate_to=self.delegate_to,
               location=self.location,
               impersonation_chain=self.impersonation_chain,
           )
          hook.insert_job(configuration=configuration, ...)
   ```
   
   It may be useful to take a look at `run_extract` method of `BigQueryHook` as 
the logic for building the job dictionary is already there.
   
   **Use case / motivation**
   
   To avoid unnecessary warnings.
   
   **Related Issues**
   
   N/A
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to