-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigQueryInsertJobOperator will fail if the DagID contains the '.' character #11280
Comments
@nathadfield @potiuk what approach do we think should be taken here? Should we scrub the dag_id for the '.' char prior to submitting? |
@nathadfield @potiuk |
I think it we already do similar thing elsewhere in Airflow - we are replacing . with dot I believe. It is in "views.py" - and it is mostly to prevent some subdag matching. I do not know BigQuery part well enough , but something like that might be a good idea:
It's really typical "escaping" thing :). |
Or should we build the string and then use the following code with added
|
Btw. I'm not sure if using |
yes, it creates a sub-dag if we use . between parent & child, I agree with you @turbaszek , |
Well, perhaps this is something that I shouldn't have done early on, but we've specified a DAG version as part of the DagID using a '.'. Not had any problems with this until now but then we don't use subdags. I can change our DAG names quite easily to eliminate this but I would argue that it shouldn't be possible to create a DAG if the id contains a restricted set of characters. Perhaps the dag_id should also be constrained to the same criteria as above? |
Make autogenerated job_id more unique by using microseconds and hash of configuration. Replace dots in job_id. Closes: #11280
Apache Airflow version: 1.10.*
BackPort Packages version: 2020.10.5rc1
What happened:
BigQueryInsertJobOperator
tries to start a BigQuery job by specifying a job_id which is a combination ofdag_id
,task_id
,execution_date
and an additionaluniqueness_suffix
.https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/operators/bigquery.py#L2072
However, because BigQuery only accepts alphanumeric (in additon to dashes and underscore) characters then, if a DagID contains a version number whcih includes a
.
character then this will cause the task to fail.https://cloud.google.com/bigquery/docs/running-jobs#generate-jobid
How to reproduce it:
Create a DAG with the name
my-dag-v1.0
.The text was updated successfully, but these errors were encountered: