Skip to content
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

BigQuery job_id fix for BigQueryInsertJobOperator #11857

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

nathadfield
Copy link
Collaborator

Ensures that the :, -, + and . characters are removed from the string that is built to create a BigQuery jobid.

Closes: #11856

@boring-cyborg boring-cyborg bot added the provider:google Google (including GCP) related issues label Oct 26, 2020
@@ -2062,7 +2062,7 @@ def _job_id(self, context):

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)
return re.sub(r"[:\-+.]", "_", job_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add test for this? It will help us avoid regression. Probably using parametrize will be good idea

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turbaszek Test added.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@turbaszek
Copy link
Member

@nathadfield please rebase due to #11892 and run pre-commit run black --all-files - this should fix the static check issue.

@nathadfield
Copy link
Collaborator Author

@turbaszek Thanks! Tests are rerunning again now

@nathadfield
Copy link
Collaborator Author

Great success!

@turbaszek turbaszek merged commit 79cb771 into apache:master Oct 28, 2020
michalmisiewicz pushed a commit to michalmisiewicz/airflow that referenced this pull request Oct 30, 2020
szn pushed a commit to szn/airflow that referenced this pull request Nov 1, 2020
@nathadfield nathadfield deleted the bq_jobid_fix branch November 11, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQueryInsertJobOperator creates invalid job_ids
2 participants