You could also parameterize your DoFn, with a boolean (or swap out a different DoFn altogether) by consulting the options at pipeline construction.
On Sun, Nov 11, 2018 at 6:13 PM Juan Carlos Garcia <[email protected]> wrote: > You can use the PipelineOption which can be accessed from within a {@link > DoFn} by invoking getPipelineOptions() on the input DoFn.ProcessContext > Context object, or the same from the StartBundleContext, and from there > you can access to the Runner options you are passing from the command line. > > JC > > On Sun, Nov 11, 2018 at 12:23 PM Davide Anastasia < > [email protected]> wrote: > >> Hi, >> I am mostly working with Dataflow using Beam, but I mostly develop using >> the local runner. However, I am interacting with other google service in >> production which I don't want to necessarily interact with during the >> development stage. >> >> I am wondering if there is a way to write something like: >> >> if (runner == "Dataflow") { >> // do stuff >> } else { >> // do nothing >> } >> >> inside my PTransform / DoFn or elsewhere in the code. >> >> Is there anyway I can fill the "runner" variable in a consistent way? >> >> Thanks, >> D. >> > > > -- > > JC > >
