Skip to content

Commit d427d37

Browse files
authored
Revert "Correcting regex for _PROJECT_PATTERN for bigquery table name (resolv…" (#34901)
This reverts commit b6038e6.
1 parent 4c59b6a commit d427d37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdks/python/apache_beam/io/gcp/bigquery_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
# Timeout for a BQ streaming insert RPC. Set to a maximum of 2 minutes.
105105
BQ_STREAMING_INSERT_TIMEOUT_SEC = 120
106106

107-
_PROJECT_PATTERN = r'[a-z][a-z0-9-]*[a-z0-9]'
107+
_PROJECT_PATTERN = r'([a-z0-9.-]+:)?[a-z][a-z0-9-]*[a-z0-9]'
108108
_DATASET_PATTERN = r'\w{1,1024}'
109109
_TABLE_PATTERN = r'[\p{L}\p{M}\p{N}\p{Pc}\p{Pd}\p{Zs}$]{1,1024}'
110110

@@ -283,7 +283,7 @@ def parse_table_reference(table, dataset=None, project=None):
283283
if not match:
284284
raise ValueError(
285285
'Expected a table reference (PROJECT:DATASET.TABLE or '
286-
'DATASET.TABLE or PROJECT.DATASET.TABLE) instead of %s.' % table)
286+
'DATASET.TABLE) instead of %s.' % table)
287287
table_reference.projectId = match.group('project')
288288
table_reference.datasetId = match.group('dataset')
289289
table_reference.tableId = match.group('table')

0 commit comments

Comments
 (0)