Skip to content

Commit

Permalink
Allow dot in BigQuery job_id
Browse files Browse the repository at this point in the history
Closes: apache#11280
  • Loading branch information
turbaszek committed Oct 5, 2020
1 parent a33a919 commit 8564f18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2068,8 +2068,9 @@ def _job_id(self, context):
if self.job_id:
return f"{self.job_id}_{uniqueness_suffix}"

exec_date = re.sub(r"\:|-|\+", "_", context['execution_date'].isoformat())
return f"airflow_{self.dag_id}_{self.task_id}_{exec_date}_{uniqueness_suffix}"
exec_date = context['execution_date'].isoformat()
job_id = f"airflow_{self.dag_id}_{self.task_id}_{exec_date}_{uniqueness_suffix}"
return re.sub(r"\:|-|\+\.", "_", job_id)

def execute(self, context: Any):
hook = BigQueryHook(
Expand Down

0 comments on commit 8564f18

Please sign in to comment.