You need to specify the table as the first parameter.

https://github.com/apache/beam/blob/0f9452823750179f740a2ef4fe143c7448c1e4c0/sdks/python/apache_beam/io/gcp/bigquery.py#L452

class BigQuerySink(dataflow_io.NativeSink):
"""A sink based on a BigQuery table."""
def __init__(self, table, dataset=None, project=None, schema=None,
create_disposition=BigQueryDisposition.CREATE_IF_NEEDED,
write_disposition=BigQueryDisposition.WRITE_EMPTY,
validate=False, coder=None):


On Fri, Aug 10, 2018 at 4:48 PM OrielResearch Eila Arich-Landkof <
[email protected]> wrote:

> Hi,
>
> This pipeline is sinking the rows to BQ. I use the following syntax:
>
> | 'write to BQ' >>
> beam.io.Write(beam.io.BigQuerySink(dataset='dataset_cell_line.cell_lines_1',
>
>  
> schema='accession_list:STRING,comment_list:STRING,derived_from:STRING,disease_list:STRING,name_list:STRING,\
>
>  
> reference_list:STRING,same_origin_as:STRING,species_list:STRING,str_list:STRING,\
>
>  web_page_list:STRING,xref_list:STRING',
> create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED,
>
>  write_disposition=beam.io.BigQueryDisposition.WRITE_TRUNCATE)))
>
>
> The following error is being fired:
>
> TypeErrorTraceback (most recent call last)<ipython-input-134-d09b4d35756f> in 
> <module>()      6                                                          
> reference_list:STRING,same_origin_as:STRING,species_list:STRING,str_list:STRING,\
>       7                                                          
> web_page_list:STRING,xref_list:STRING', 
> create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED,----> 8       
>                                                    
> write_disposition=beam.io.BigQueryDisposition.WRITE_TRUNCATE)))TypeError: 
> __init__() takes at least 2 arguments (5 given)
>
>
> Please let me know what I am missing.
>
> Thanks so much,
>
>
> --
> Eila
> www.orielresearch.org
> https://www.meetu <https://www.meetup.com/Deep-Learning-In-Production/>
> p.co <https://www.meetup.com/Deep-Learning-In-Production/>
> m/Deep-Learning-In-Production/
> <https://www.meetup.com/Deep-Learning-In-Production/>
>
>
>

Reply via email to