Right now I'm just able to grab the RunTime value inside a class using a ParDo, is there another way to get to use the runtime parameter like in my functions?
This is the code I got right now:
class UserOptions(PipelineOptions):
@classmethod
def _add_argparse_args(cls, parser):
parser.add_value_provider_argument('--firestore_document',default='')
def run(argv=None):
parser = argparse.ArgumentParser()
pipeline_options = PipelineOptions()
user_options = pipeline_options.view_as(UserOptions)
pipeline_options.view_as(SetupOptions).save_main_session = True
with beam.Pipeline(options=pipeline_options) as p:
rows = (p
| 'Create inputs' >> beam.Create([''])
| 'Call Firestore' >> beam.ParDo(
CallFirestore(user_options.firestore_document))
| 'Read DB2' >> beam.Map(ReadDB2))
I want the user_options.firestore_document to be usable in other functions without having to do a ParDo
user_options.firestore_document
variable? – Chattyuser_options.firestore_document to be usable in other functions without having to do a ParDo
? – CrucifyCallFirestore
? – Chatty