in modules/harness-build-flex-template/pubsub_dataflow_bigquery/pubsub_transform_bigquery.py [0:0]
def normalize_data(data):
"""
The template reads a json from PubSub that can be a single object
or a List of objects. This function is used by a FlatMap transformation
to normalize the input in to individual objects.
See:
- https://beam.apache.org/documentation/transforms/python/elementwise/flatmap/
""" # noqa
if isinstance(data, list):
return data
return [data]