diff --git a/sdks/python/apache_beam/io/gcp/bigquery.py b/sdks/python/apache_beam/io/gcp/bigquery.py index 0905ba764deb..7310bbdc9fb6 100644 --- a/sdks/python/apache_beam/io/gcp/bigquery.py +++ b/sdks/python/apache_beam/io/gcp/bigquery.py @@ -2764,6 +2764,9 @@ def expand(self, input): class ConvertToBeamRows(PTransform): def __init__(self, schema, dynamic_destinations): + if not isinstance(schema, + (bigquery.TableSchema, bigquery.TableFieldSchema)): + schema = bigquery_tools.get_bq_tableschema(schema) self.schema = schema self.dynamic_destinations = dynamic_destinations