[Python] No attribute 'TableReference' in Apache Beam when trying to write to BigQuery

Discussão em 'Python' iniciado por Stack, Fevereiro 27, 2025.

  1. Stack

    Stack Membro Participativo

    When trying to run this pipeline I get this exception:

    Exception has occurred: AttributeError module 'apache_beam.io.gcp.internal.clients.bigquery' has no attribute 'TableReference'

    table_spec='ExporterPlayGround.TEST_STREAM'
    with beam.Pipeline(options=pipeline_options) as p:
    from apache_beam.io.gcp.internal.clients import bigquery
    raw_stream = (
    p | 'Start subscriber' >> beam.io.gcp.pubsub.ReadFromPubSub(subscription=subscription_name)
    | 'Write to Table' >> beam.io.WriteToBigQuery(
    table_spec,
    schema='test_float:FLOAT, test2_float:FLOAT',
    write_disposition=beam.io.BigQueryDisposition.WRITE_APPEND,
    create_disposition=beam.io.BigQueryDisposition.CREATE_IF_NEEDED)
    )


    Maybe I'm missing something obvious but I can't seem to see what the problem is, I am giving reference bigquery that the documentation points to.

    Continue reading...

Compartilhe esta Página