Skip to content

Commit

Permalink
[BEAM-9812] Fixing bug causing pipelines requiring temp tables to not…
Browse files Browse the repository at this point in the history
… work
  • Loading branch information
pabloem committed Apr 23, 2020
1 parent ef267d9 commit 9867aab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdks/python/apache_beam/io/gcp/bigquery_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,18 @@ 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
format.
"""

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):
Expand Down

0 comments on commit 9867aab

Please sign in to comment.