• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: variables by default in airflow and BigQueryToGCSOperator

Resolved: variables by default in airflow and BigQueryToGCSOperator

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

In this post, we will see how to resolve variables by default in airflow and BigQueryToGCSOperator

Question:

I have an airflow DAG with the following task. At runtime, there is an error because there are special characters in the job_id. How can I correctly pass the variables to the task definition?
the mistake is : google.api_core.exceptions.BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/name_proyect/jobs?prettyPrint=false: Invalid job ID “name_dag{{ ds }}{{ ts }}_6c6c293aa2fa1a63fadeaecefe7ff58c”. Job IDs must be alphanumeric (plus underscores and dashes) and must be at most 1024 characters long.

Best Answer:

I raised PR to address this.
For apache-airflow-providers-google>8.11.0:
Your code will work as the PR included in the release.
For apache-airflow-providers-google<=8.11.0:
This happens because job_id is not in template_fields.
If you can not update provider to newer version you can create custom operator to address it:
Then replace the class in your code:

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

airflow google-cloud-composer
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I implement a function depending on picked up items?

01/04/2023

Resolved: Azuer Service Bus SDK not receiving the specified messages

01/04/2023

Resolved: how to change date format from 201904 to Apr-19 in excel

01/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.