You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by yh...@apache.org on 2025/05/09 18:11:20 UTC

(beam) branch master updated: Revert "Correcting regex for _PROJECT_PATTERN for bigquery table name (resolv…" (#34901)

This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new d427d3731e4 Revert "Correcting regex for _PROJECT_PATTERN for bigquery table name (resolv…" (#34901)
d427d3731e4 is described below

commit d427d3731e4653374310d693c5e13933529ac488
Author: Yi Hu <ya...@google.com>
AuthorDate: Fri May 9 14:11:14 2025 -0400

    Revert "Correcting regex for _PROJECT_PATTERN for bigquery table name (resolv…" (#34901)
    
    This reverts commit b6038e6ce415a66c72c31ed8e521ad562d5a377b.
---
 sdks/python/apache_beam/io/gcp/bigquery_tools.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sdks/python/apache_beam/io/gcp/bigquery_tools.py b/sdks/python/apache_beam/io/gcp/bigquery_tools.py
index d0e081c862a..081571bfef9 100644
--- a/sdks/python/apache_beam/io/gcp/bigquery_tools.py
+++ b/sdks/python/apache_beam/io/gcp/bigquery_tools.py
@@ -104,7 +104,7 @@ UNKNOWN_MIME_TYPE = 'application/octet-stream'
 # Timeout for a BQ streaming insert RPC. Set to a maximum of 2 minutes.
 BQ_STREAMING_INSERT_TIMEOUT_SEC = 120
 
-_PROJECT_PATTERN = r'[a-z][a-z0-9-]*[a-z0-9]'
+_PROJECT_PATTERN = r'([a-z0-9.-]+:)?[a-z][a-z0-9-]*[a-z0-9]'
 _DATASET_PATTERN = r'\w{1,1024}'
 _TABLE_PATTERN = r'[\p{L}\p{M}\p{N}\p{Pc}\p{Pd}\p{Zs}$]{1,1024}'
 
@@ -283,7 +283,7 @@ def parse_table_reference(table, dataset=None, project=None):
     if not match:
       raise ValueError(
           'Expected a table reference (PROJECT:DATASET.TABLE or '
-          'DATASET.TABLE or PROJECT.DATASET.TABLE) instead of %s.' % table)
+          'DATASET.TABLE) instead of %s.' % table)
     table_reference.projectId = match.group('project')
     table_reference.datasetId = match.group('dataset')
     table_reference.tableId = match.group('table')