Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BigQuery - AttributeError: 'module' object has no attribute 'SourceFormat' #5089

Copy link
Copy link
@snehashirsat

Description

@snehashirsat
Issue body actions

Hi, I am using BigQuery API : bigquery.SourceFormat.PARQUET to load parquet data from GCS to BigQuery table.

At line:
job_config = bigquery.LoadJobConfig()
job_config.source_format = bigquery.SourceFormat.PARQUET

it throws an error -
AttributeError: 'module' object has no attribute 'SourceFormat'

Environment specs are here:
Python 2.7.10
Name: google-cloud
Version: 0.32.0
Summary: API Client library for Google Cloud
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google Cloud Platform
Author-email: googleapis-publisher@google.com
License: Apache 2.0

OS and version
ProductName: Mac OS X
ProductVersion: 10.12.6

Code example:

def test_load_table_from_uri_parquet():
    # [START bigquery_load_table_gcs_parquet]
    client = bigquery.Client()
    dataset_id = 'dataset_01'
    dataset_ref = client.dataset(dataset_id)
    job_config = bigquery.LoadJobConfig()
    job_config.source_format = bigquery.SourceFormat.PARQUET
    load_job = client.load_table_from_uri(
        'gs://xxxx/xxx/*.parquet',
        dataset_ref.table('tablexxx'),
        job_config=job_config)
    assert load_job.job_type == 'load'

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.type: processA process-related concern. May include testing, release, or the like.A process-related concern. May include testing, release, or the like.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.