in Education by
I am running dataflow pipeline to load into biqquery but I am getting the below error wrapper = lambda x: [fn(x)] File "/home/mprabakaran/mergefile.py", line 93, in NameError: name 'funt1' is not defined [while running 'format data-ptransform-40'] I defined the function 'funt1' as below in my code def funt1(row): data={} data['ID']=row[0] if row[1]['gender']: data['gender']=row[1]['gender'][0] else: data['gender']=None if row[1]['weight']: data['weight']=row[1]['weight'][0] else: data['weight']='' #print(data) return data below is the part of pipeline code data = (({'gender': gender_data, 'weight': weight_data}) | 'Merge' >> beam.CoGroupByKey() | 'format data' >> beam.Map(lambda x: funt1(x)) | beam.Map(print) ) beam.io.WriteToBigQuery( table_spec2, dataset="nyb_data", project="toyota-poc-340710", # known_args.output, # schema='id:INTEGER,gender:STRING,wieght:STRING', write_disposition=beam.io.BigQueryDisposition.WRITE_TRUNCATE, create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED ) not sure what I am missing. Kindly help me on this. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You have to make sure that the Python module that contains the function funt1 is packaged and staged in Dataflow VMs so that it's available during runtime. Please see here for instructions. Another option is to set save_main_session option which results in the main session (including functions loaded to session) available to workers, but this might not work for all cases.

Related questions

0 votes
    We're running multiple streaming Dataflow pipelines that always eventually hang and need to be restarted after about ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    ____________ requires data in a structured format as per the defined data model. (1)RDBMS (2)NoSQL...
asked Apr 23, 2021 in Technology by JackTerrance
0 votes
    How to get callback in our app when user delete song from music app. Is there any solution? Thanks ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a couple of MySQL queries that take a really long time and I'd like to display a progress ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I have a couple of MySQL queries that take a really long time and I'd like to display a progress ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Which type of remote URL does not require your user-name and password while for cloning or pushing? A. SSH url B. Https Url...
asked Dec 17, 2022 in Technology by JackTerrance
0 votes
    Name the output files created by Informatica server during session running....
asked Mar 26, 2021 in Technology by JackTerrance
0 votes
    The relation EMPDT1 is defined with attributes empcode(unique), name, street, city, state, and pincode. ... topic in division Query Processing Techniques of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Name the assembly in which the MVC framework is typically defined....
asked Dec 8, 2020 in Technology by JackTerrance
0 votes
    In Hive, when we do a query (like: select * from employee), we do not get any column names in the ... when you execute any query? Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    Finding covariance matrix in steps from the given below data. ABC = Math Physics English 90 80 40 90 60 80 60 50 70 30 40 70 30 20 90 Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email in an ... is used in this) Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email ... an excel file format Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    Which of the following options/option are/is not supported while loading the data from a local data source using Web UI? (1 ... and commas (2)Only Commas (3)Only Wildcards (4)dots...
asked May 31, 2021 in Education by JackTerrance
...