title: If statement for steps in a apache beam dataflow pipeline (python)
body: <p>I was wondering if it is possible to have an if statement in a beam pipeline for enacting a different transform based on different scenarios. For example: </p>
  
  <p>1) Make one of the input arguments backfill/regular and then based on that input argument it would decide whether to start with</p>
  
  <pre><code>(p 
              | fileio.MatchFiles(known_args.input_bucket)
              | fileio.ReadMatches()
              | beam.Map(lambda file: file.metadata.path, json.loads(file.read_utf8())))
  </code></pre>
  
  <p>or </p>
  
  <pre><code>p | beam.io.ReadFromText(known_args.input_file_name)
  </code></pre>
  
  <p>2) If the file name contains a certain country name (i.e. USA), call <code>TransformUSA(beam.DoFn)</code>, else call <code>TransformAllCountries(beam.DoFn)</code></p>
  
  <p>Sorry if this isn't a great question, i haven't seen this anywhere else and am trying to make my code modular instead of having separate pipelines</p>