diff --git a/sdks/python/apache_beam/io/gcp/pubsub.py b/sdks/python/apache_beam/io/gcp/pubsub.py index c6d93d03af94..d5afee95580a 100644 --- a/sdks/python/apache_beam/io/gcp/pubsub.py +++ b/sdks/python/apache_beam/io/gcp/pubsub.py @@ -26,6 +26,8 @@ import re +from six import text_type + from apache_beam import coders from apache_beam.io.iobase import Read from apache_beam.io.iobase import Write @@ -184,7 +186,7 @@ def expand(self, pcoll): | _ReadFromPubSub(self.topic, self.subscription, self.id_label, with_attributes=False) | 'DecodeString' >> Map(lambda b: b.decode('utf-8'))) - p.element_type = unicode + p.element_type = text_type return p