From 9867aab4dd406111dde22d84d07b6f856a439975 Mon Sep 17 00:00:00 2001 From: Pablo Estrada Date: Thu, 23 Apr 2020 12:37:13 -0700 Subject: [PATCH] [BEAM-9812] Fixing bug causing pipelines requiring temp tables to not work --- sdks/python/apache_beam/io/gcp/bigquery_tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/io/gcp/bigquery_tools.py b/sdks/python/apache_beam/io/gcp/bigquery_tools.py index 1ae4f7c9f6247..6eaa454a7f533 100644 --- a/sdks/python/apache_beam/io/gcp/bigquery_tools.py +++ b/sdks/python/apache_beam/io/gcp/bigquery_tools.py @@ -175,6 +175,7 @@ def parse_table_reference(table, dataset=None, project=None): Returns: A TableReference object from the bigquery API. The object has the following attributes: projectId, datasetId, and tableId. + If the input is a TableReference object, a new object will be returned. Raises: ValueError: if the table reference as a string does not match the expected @@ -182,7 +183,10 @@ def parse_table_reference(table, dataset=None, project=None): """ if isinstance(table, bigquery.TableReference): - return table + return bigquery.TableReference( + projectId=table.projectId, + datasetId=table.datasetId, + tableId=table.tableId) elif callable(table): return table elif isinstance(table, value_provider.ValueProvider):