GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — load_table_from_dataframe -- support alternative serialization formats · Issue #383 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

load_table_from_dataframe -- support alternative serialization formats #383

Copy link
Copy link
Closed
#399
Closed
load_table_from_dataframe -- support alternative serialization formats#383
#399
Copy link
Assignees
cguardia
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@tswast
tswast
opened on Nov 11, 2020
Issue body actions

Currently, pandas-gbq doesn't use load_table_from_dataframe because it is using CSV for serialization, which has better support for TIME, DATE, DATETIME than Parquet. See: #56, #382

Struct / Array support could also be improved (though this is partially due to problems in the pyarrow library). #19

I propose supporting the CSV serialization type.

Activity

  1. product-auto-label
    added
    api: bigqueryIssues related to the googleapis/python-bigquery API.
    on Nov 11, 2020
  2. tswast
    self-assigned this
    on Nov 11, 2020
  3. tswast
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Nov 11, 2020
  4. tswast
    assigned
    cguardia
    and unassigned
    tswast
    on Nov 17, 2020
  5. tswast commented on Nov 17, 2020

    @tswast
    tswast
    on Nov 17, 2020
    ContributorAuthor
    More actions

    To go from DataFrame to CSV, we can use the same tempfile logic as we have for parquet, but instead use to_csv + a few parameters to ensure proper data types:

    https://github.com/pydata/pandas-gbq/blob/ac2d2fe4ac0025109f8df3723e3f03a337face94/pandas_gbq/load.py#L16-L30

  6. tswast commented on Nov 17, 2020

    @tswast
    tswast
    on Nov 17, 2020
    ContributorAuthor
    More actions

    This would also require adding CSV to the allowed serialization formats here:

    python-bigquery/google/cloud/bigquery/client.py

    Lines 2201 to 2206 in 809e4a2

    if job_config.source_format != job.SourceFormat.PARQUET:
    raise ValueError(
    "Got unexpected source_format: '{}'. Currently, only PARQUET is supported".format(
    job_config.source_format
    )
    )

  7. cguardia commented on Nov 24, 2020

    @cguardia
    cguardia
    on Nov 24, 2020
    Contributor
    More actions

    @tswast I have the initial work for this in #399. Looking for comments about which are the best parameters to use in the to_csv call, and whether this is going in the right direction.

  8. tswast
    closed this as completedin #399on Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @cguardia
    cguardia

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.