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 — fix: raise error if inserting rows with unknown fields by plamut · Pull Request #163 · googleapis/python-bigquery

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

Conversation

@plamut

@plamut plamut commented Jul 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #151.

This PR makes sure that unknown fields are not silently ignored when inserting rows, but instead such errors are detected and raised loudly.

PR checklist

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@plamut
fix: raise error if inserting rows with unknown fields
f579d17
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 11, 2020
@plamut
plamut requested a review from shollyman July 11, 2020 12:51
@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 13, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 13, 2020
shollyman
shollyman reviewed Jul 14, 2020
View reviewed changes

@shollyman shollyman left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think I'm missing something here. The user controls whether they want this behavior in tabledata.insertall via ignoreUnknownValues, which is present in the insert_rows_json() method signature, but I don't see how that's plumbed to this helper.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tswast
tswast reviewed Jul 15, 2020
View reviewed changes
Comment thread google/cloud/bigquery/_helpers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google/cloud/bigquery/_helpers.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@plamut

plamut commented Jul 17, 2020

Copy link
Copy Markdown
Contributor Author

@shollyman Hmm, good point. I'll check how the helper can support the ignore_unknown_values parameter.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plamut added 2 commits July 20, 2020 16:15
@plamut
Merge branch 'master' into iss-151
6e28998
@plamut
Include unknown fields in request when inserting rows
dac6448
@plamut
plamut force-pushed the iss-151 branch from b4d2132 to dac6448 Compare July 20, 2020 15:14
@plamut
plamut requested review from shollyman and tswast July 20, 2020 15:16
@plamut

plamut commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

Changed the helper to include missing fields and let the backend handle that.

The ignore_unknown_values argument to user-facing methods in the client is orthogonal to that, thus the helper signature didn't need a change (FWIW, the backend honors the argument, checked it).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tswast
tswast approved these changes Jul 20, 2020
View reviewed changes
@plamut

plamut commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

Just the coverage failure it seems, will cover the missed code path.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

plamut and others added 3 commits July 20, 2020 18:10
@plamut
Cover missed branch path in a test
db54853
@plamut
Merge branch 'master' into iss-151
75f9d76
@tseaver
Merge branch 'master' into iss-151
630c935
@tseaver

tseaver commented Jul 30, 2020

Copy link
Copy Markdown
Contributor

Assuming that the Python3 test failures in test_download_arrow_tabledata_list_unknown_field_type due to a pyarrow release, I've kicked off a merge.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver
Merge branch 'master' into iss-151
e4dc4cd
@tseaver
tseaver merged commit 8fe7254 into googleapis:master Jul 30, 2020
@plamut

plamut commented Jul 31, 2020

Copy link
Copy Markdown
Contributor Author

Indeed, and those tests were updated in https://github.com/googleapis/python-bigquery/pull/192/files

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@plamut
plamut deleted the iss-151 branch July 31, 2020 08:40
@release-please release-please Bot mentioned this pull request Jan 4, 2022
chore(main): release python-bigquery 1.27.1 #1097
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@shollyman shollyman Awaiting requested review from shollyman
1 more reviewer
@tswast tswast tswast approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

client.insert_rows should fail when inserting non-existing fields

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@plamut @tseaver @tswast @shollyman @googlebot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.