Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: Add client.insert_rows_from_dataframe() method #9162

Merged
merged 3 commits into from
Sep 12, 2019

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Sep 3, 2019

Closes #7553.

This PR adds a new client method insert_rows_from_dataframe(). It should feel similar to the existing insert_rows() method, but accepting the rows data as a pandas dataframe.

How to test

Make sure that the new method matches the specs from the ticket description, and see the tests for usage examples.

@plamut plamut added the api: bigquery Issues related to the BigQuery API. label Sep 3, 2019
@plamut plamut requested a review from a team September 3, 2019 13:37
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 3, 2019
dataframe.itertuples() returns plain tuples under certain conditions,
thus this commit enforces always returning plain tuples, and
constructs the row dictionary manually from each tuple.
@plamut plamut requested a review from tswast September 4, 2019 11:02
@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 4, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 4, 2019
@plamut plamut merged commit 10eb892 into googleapis:master Sep 12, 2019
emar-kar pushed a commit to MaxxleLLC/google-cloud-python that referenced this pull request Sep 18, 2019
…9162)

* Add client.insert_rows_from_dataframe() method

* Avoid using nametuples for dataframe row iteration

dataframe.itertuples() returns plain tuples under certain conditions,
thus this commit enforces always returning plain tuples, and
constructs the row dictionary manually from each tuple.

* Skip insert_rows_from_dataframe tests if no Pandas
emar-kar pushed a commit to MaxxleLLC/google-cloud-python that referenced this pull request Sep 18, 2019
…9162)

* Add client.insert_rows_from_dataframe() method

* Avoid using nametuples for dataframe row iteration

dataframe.itertuples() returns plain tuples under certain conditions,
thus this commit enforces always returning plain tuples, and
constructs the row dictionary manually from each tuple.

* Skip insert_rows_from_dataframe tests if no Pandas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
4 participants