Skip to content

BigQuery: Add load_table_from_json() method to BQ client - #9076

Merged
plamut merged 5 commits into
googleapis:masterfrom
plamut:iss-4553
Aug 22, 2019
Merged

BigQuery: Add load_table_from_json() method to BQ client#9076
plamut merged 5 commits into
googleapis:masterfrom
plamut:iss-4553

Conversation

@plamut

Copy link
Copy Markdown
Contributor

Closes#4553.

This PR adds a helper client method load_table_from_json(). Is supersedes #9070, because GitHub did not detect updates in my topic branch.

How to test

Check that the method is similar to e.g. client.load_table_from_dataframe() and in line with the requirements.

P.S.: I will address the last issue comment separately once this is approved (replacing the _add_rows() helper in system tests is a separate refactoring task IMO).

@plamutplamut added the api: bigquery Issues related to the BigQuery API. label Aug 22, 2019
@plamut
plamut requested review from a team and tswastAugust 22, 2019 10:09
@plamut

Copy link
Copy Markdown
ContributorAuthor

Linking a comment thread for visibility (a question about deep-copying a LoadJobConfig instance).

#9070 (comment)

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 22, 2019
The load_table_from_json() should not directly change the job config
passed in as an argument.
@plamut
plamutforce-pushed the iss-4553 branch 4 times, most recently from e596212 to 919d30eCompareAugust 22, 2019 11:06
Comment threadbigquery/tests/system.py Outdated
Comment threadbigquery/tests/system.py Outdated
Comment threadbigquery/tests/system.py
Comment threadbigquery/tests/unit/test_client.py
@plamut
plamut requested a review from tswastAugust 22, 2019 19:01
@plamut
plamut merged commit ee2a67f into googleapis:masterAug 22, 2019
@plamut
plamut deleted the iss-4553 branch August 22, 2019 20:02
HemangChothani pushed a commit to HemangChothani/google-cloud-python that referenced this pull request Aug 29, 2019
…9076)
* Add load_table_from_json() method to BQ client
* Manipulate a copy of the job config if provided
The load_table_from_json() should not directly change the job config
passed in as an argument.
* Enable schema autodetect if no explicit schema
* Cover the path of schema provided in unit tests
* Improve tests readability and harden assertions
emar-kar pushed a commit to MaxxleLLC/google-cloud-python that referenced this pull request Sep 18, 2019
…9076)
* Add load_table_from_json() method to BQ client
* Manipulate a copy of the job config if provided
The load_table_from_json() should not directly change the job config
passed in as an argument.
* Enable schema autodetect if no explicit schema
* Cover the path of schema provided in unit tests
* Improve tests readability and harden assertions
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigqueryIssues related to the BigQuery API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add functions equivalent to create_rows and create_rows_json that create a table for you using a load job

3 participants

@plamut@tswast@googlebot