Search code examples
pythongoogle-cloud-platformgoogle-bigquery

column_name_character_map in LoadJobConfig


I am looking to apply column_name_character_map=V2 setting using below

job_config = bigquery.LoadJobConfig(
    schema=[
        bigquery.SchemaField("name", "STRING"),
        bigquery.SchemaField("post_abbr", "STRING"),
    ],
    skip_leading_rows=1,
    column_name_character_map='V2',
    # The source format defaults to CSV, so the line below is optional.
    source_format=bigquery.SourceFormat.CSV,
)

But I am getting error, is it not possible to enable column_name_character_map using Python? -

Property column_name_character_map is unknown for <class 'google.cloud.bigquery.job.load.LoadJobConfig'>

Solution

  • According to this google cloud documentation LoadJobConfig supports column_name_character_map.

    To solve the above error,consider upgrading to the latest version.

    pip install --upgrade google-cloud-bigquery

    Before upgrading please go through the release note and identify the changes.