You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/30 21:40:00 UTC

[jira] [Commented] (AIRFLOW-3792) Bigquery hook no longer accepts queryParameters and use_legacy_sql=False

    [ https://issues.apache.org/jira/browse/AIRFLOW-3792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16756579#comment-16756579 ] 

ASF GitHub Bot commented on AIRFLOW-3792:
-----------------------------------------

ogirardot commented on pull request #4626: [AIRFLOW-3792] Fix in BigQuery hook queryParameters and useLegacySQL flags
URL: https://github.com/apache/airflow/pull/4626
 
 
   ### Description
   
   This PR fixes a bug in BigQuery Hook when using : 
   - useLegacySQL to False
   - or queryParameters, because since 1.10 the queryParameters are validated as dict instead of what google's API expects (a list of dict)
   
   ### Tests
   
   - [ x] My PR adds the following unit tests : in `contrib/test_bigquery_hook.py` a test called `test_run_query_sql_dialect_legacy_with_query_params` which tests both the proper form of query params and the legacy sql flag set to False in conjonction.
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   
   ### Documentation
   No new thing, just a bug fix.
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> Bigquery hook no longer accepts queryParameters and use_legacy_sql=False
> ------------------------------------------------------------------------
>
>                 Key: AIRFLOW-3792
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3792
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: contrib
>    Affects Versions: 1.10.0, 1.10.1, 1.10.2
>         Environment: any OS but when using BigQuery
>            Reporter: Olivier Girardot
>            Assignee: Olivier Girardot
>            Priority: Major
>
> Since AIRFLOW-491 with PR [https://github.com/apache/airflow/pull/3733] there is a regression induced that make queryParameters unusable in `BigQueryBaseCursor.run_query` and is a bit inconsistent when `use_legacy_sql` flag is set to false, because it only accepts None even though the parameter is a bool.
> For the use_legacy_sql flag there is only a simple condition to add, and for queryParameters the check_param expects a dict but google's api expects a list of dict. c.f. 
> |{{configuration.query.queryParameters[]}}|
> in [https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query]
> PR will soon be opened after this issue 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)