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/10/15 13:56:42 UTC

[GitHub] [airflow] BhuviTheDataGuy opened a new issue #11545: BigQuery Hook get_records still using bql

BhuviTheDataGuy opened a new issue #11545:
URL: https://github.com/apache/airflow/issues/11545


   Version : 1.10.12
   
   Im trying to get a SQL query results on BigQuery with BigQuery Hook. But in the logs, seems its showing the warning.
   ```py
   WARNING - /root/.local/lib/python3.7/site-packages/airflow/contrib/hooks/bigquery_hook.py:800: DeprecationWarning: Deprecated parameter `bql` used in `BigQueryBaseCursor.run_query` Use `sql` parameter instead to pass the sql to be executed. `bql` parameter is deprecated and will be removed in a future version of Airflow.
     category=DeprecationWarning)
   ```
   My code:
   
   ```py
   from airflow.contrib.operators.gcs_to_bq import GoogleCloudStorageToBigQueryOperator
   def get_dag_ids(tablename,**kwargs):
       bq_hook = BigQueryHook(bigquery_conn_id='bigquery_default',use_legacy_sql=False, location='US')
       records = bq_hook.get_records(sql="select max(time) from project.dataset.{};".format(tablename))
       return records[0][0]
   ```
   Is this something  I need to fix from my code, or from it has to be updated on Airflow's hook itself? 
   


----------------------------------------------------------------
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] eladkal commented on issue #11545: BigQuery Hook get_records still using bql

Posted by GitBox <gi...@apache.org>.
eladkal commented on issue #11545:
URL: https://github.com/apache/airflow/issues/11545#issuecomment-716772750


   To get the latest version you should import the hook from [google provider](https://pypi.org/project/apache-airflow-backport-providers-google/) not from contrib.
   `bql` param was removed in https://github.com/apache/airflow/pull/4060 thus you shouldn't see this deprecation warring when importing the hook via providers.
   


----------------------------------------------------------------
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] BhuviTheDataGuy closed issue #11545: BigQuery Hook get_records still using bql

Posted by GitBox <gi...@apache.org>.
BhuviTheDataGuy closed issue #11545:
URL: https://github.com/apache/airflow/issues/11545


   


----------------------------------------------------------------
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] boring-cyborg[bot] commented on issue #11545: BigQuery Hook get_records still using bql

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #11545:
URL: https://github.com/apache/airflow/issues/11545#issuecomment-709342885


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
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] BhuviTheDataGuy commented on issue #11545: BigQuery Hook get_records still using bql

Posted by GitBox <gi...@apache.org>.
BhuviTheDataGuy commented on issue #11545:
URL: https://github.com/apache/airflow/issues/11545#issuecomment-716915772


   Oh great.
   Thanks, I'll use providers for the hook


----------------------------------------------------------------
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] eladkal edited a comment on issue #11545: BigQuery Hook get_records still using bql

Posted by GitBox <gi...@apache.org>.
eladkal edited a comment on issue #11545:
URL: https://github.com/apache/airflow/issues/11545#issuecomment-716772750


   To get the latest version you should import the hook from [google provider](https://pypi.org/project/apache-airflow-backport-providers-google/) not from contrib.
   `bql` param was removed in https://github.com/apache/airflow/pull/4060 thus you shouldn't see this deprecation warning when importing the hook via providers.
   


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