Skip to content

Conversation

@tswast
Copy link
Contributor

@tswast tswast commented Aug 20, 2019

Closes #8140

  • Allow subset of schema to be passed into load_table_from_dataframe.
  • The types of any remaining columns will be auto-detected.
  • When the type of any remaining column can't be determined, warn that the schema was ignored because the type of column X could not be determined.
  • Update snippets to show overriding schema for columns whose types can't be autodetected. Blocked by BigQuery: Load to table from dataframe without index #5572 (comment).

This PR is branched from #9049.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 20, 2019
@tswast tswast force-pushed the issue8140-partial-schema branch from 09bb705 to dba55a4 Compare August 21, 2019 17:55
@tswast tswast force-pushed the issue8140-partial-schema branch from dba55a4 to 105ebc9 Compare August 21, 2019 18:58
@tswast tswast marked this pull request as ready for review August 21, 2019 18:59
@tswast tswast requested review from a team and plamut August 21, 2019 18:59
@tswast
Copy link
Contributor Author

tswast commented Aug 22, 2019

Blocked by #9074

Test failures are because the schema in the snippets samples cannot be autodetected and we send a schema of {"fields": []}, instead of None.

@tswast tswast added api: bigquery Issues related to the BigQuery API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Aug 22, 2019
Copy link
Contributor

@plamut plamut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I can see how this can be useful to users. 👍

Had a few sanity check remarks/questions, please just check if any of them apply.

Edit: What about the last point in the PR checklist, i.e. updating snippets?

@tswast
Copy link
Contributor Author

tswast commented Aug 22, 2019

On second thought, since the snippets show writing the indexes of a DataFrame, I can't actually update them until #5572 (comment) is fixed. I'll work on that issue next.

@tswast tswast requested a review from plamut August 22, 2019 18:21
@tswast tswast removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 22, 2019
Copy link
Contributor

@plamut plamut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and I agree with leaving out the snippets until their blocker is resolved.

Edit: One of the unit tests is failing, needs a fix.

@tswast tswast merged commit adefce3 into googleapis:master Aug 22, 2019
@tswast tswast deleted the issue8140-partial-schema branch August 22, 2019 19:36
HemangChothani pushed a commit to HemangChothani/google-cloud-python that referenced this pull request Aug 29, 2019
…googleapis#9064)

* Allow subset of schema to be passed into `load_table_from_dataframe`.

The types of any remaining columns will be auto-detected.

* Warn when it's not possible to determine a column type.
emar-kar pushed a commit to MaxxleLLC/google-cloud-python that referenced this pull request Sep 18, 2019
…googleapis#9064)

* Allow subset of schema to be passed into `load_table_from_dataframe`.

The types of any remaining columns will be auto-detected.

* Warn when it's not possible to determine a column type.
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

Development

Successfully merging this pull request may close these issues.

BigQuery: Allow partial schema in load_table_from_dataframe

3 participants