title: Python Streaming Dataflow "WriteToPubSub" behaviour
body: <p>I am trying out a Streaming dataflow to read from PubSub and write to another PubSub. I am using python 3.7.3 version. The pipeline looks something like this,</p>
  
  <pre><code>lines = (pipe | "Read from PubSub" &gt;&gt; beam.io.ReadFromPubSub(topic=TOPIC).with_output_types(bytes)
      | "Transformation" &gt;&gt; beam.ParDo(PubSubToDict())
      | "Write to PubSub" &gt;&gt; beam.io.WriteToPubSub(topic=OUTPUT, with_attributes=False)
      )
  </code></pre>
  
  <p>The "Transformation" step is something where I need to so some custom transformation. I am ensuring that the output of this transform is bytes. Something like this,</p>
  
  <pre><code>class PubSubToDict(beam.DoFn):
      def process(self, element):
          """pubsub input is a byte string"""
          data = element.decode('utf-8')
          """do some custom transform here"""
          data = data.encode('utf-8')
          return data
  </code></pre>
  
  <p>Now when I publish a test message, I get an error like this,</p>
  
  <pre><code>ERROR: Data being published to Pub/Sub must be sent as a bytestring. [while running 'Write to PubSub']
  </code></pre>
  
  <p>I managed to solve this by returning an array instead like this,</p>
  
  <pre><code>return [data]
  </code></pre>
  
  <p>But I don't know the reason why this worked. So I was looking for an explanation to this.</p>
  
  <p>Regards,
  Prasad</p>