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 2021/09/24 13:41:56 UTC

[GitHub] [airflow] Jaxing commented on issue #16209: BigQueryInsertJobOperator required parameter is missing, but which?

Jaxing commented on issue #16209:
URL: https://github.com/apache/airflow/issues/16209#issuecomment-926634257


   I think this might be due to a bug.
   This configuration of the operator works
   ```db_copy_projects = BigQueryInsertJobOperator(
           task_id="db_copy_projects",
           job_id="db_copy_projects",
           configuration={
               "query": {
                   "query": "<SELECT Statement>",
                   "useLegacySql": False
           },
           project_id="<project_id>",
           location='EU',
           gcp_conn_id='google-cloud'
       )
   ```
       
   But if I try to make it save it to a destination table like this
   ```db_copy_projects = BigQueryInsertJobOperator(
           task_id="db_copy_projects",
           job_id="db_copy_projects",
           configuration={
               "query": {
                   "query": "<SELECT Statement>",
                   "useLegacySql": False,
                   "destinationTable": {
                       "projectId": "<project_id>",
                       "datasetId": "testing",
                       "tabelId": "test_bq_operator"
                   },
                   "createDisposition": "CREATE_IF_NEEDED",
                   "write_Disposition": "WRITE_APPEND",
                   "priority": "BATCH",
                   "schemaUpdateOptions": ["ALLOW_FIELD_ADDITION", "ALLOW_FIELD_RELAXATION"],
                   "timePartitioning":{
                       "type": "DAY",
                       "field": "created"
                   }
               }
           },
           project_id="",
           location='EU',
           gcp_conn_id='google-cloud'
       )
   ```
   I getting `google.api_core.exceptions.BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/<project_id>/jobs?prettyPrint=false: Required parameter is missing`


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