Skip to content

Commit 1a6ec3a

Browse files
authored
Per element schema parsing in ConvertToBeamRows (#36393)
* get_bq_tableschema was invoked on every dict to row conversion if bq schema is not of tableschema type * get_bq_tableschema was invoked on every dict to row conversion if bq schema is not of tableschema type
1 parent 09aa10c commit 1a6ec3a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,6 +2764,9 @@ def expand(self, input):
27642764

27652765
class ConvertToBeamRows(PTransform):
27662766
def __init__(self, schema, dynamic_destinations):
2767+
if not isinstance(schema,
2768+
(bigquery.TableSchema, bigquery.TableFieldSchema)):
2769+
schema = bigquery_tools.get_bq_tableschema(schema)
27672770
self.schema = schema
27682771
self.dynamic_destinations = dynamic_destinations
27692772

0 commit comments

Comments
 (0)