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 — BigQuery: removes LoadJob error for autodetect=True and schema set by alixhami · Pull Request #4213 · googleapis/google-cloud-python

Conversation

@alixhami

@alixhami alixhami commented Oct 18, 2017

Copy link
Copy Markdown
Contributor

Validations in the LoadJob class were set to disallow a schema to be set while autodetect is True. This raised an error when running client.get_job() and client.list_jobs() for LoadJobs that were created with autodetect=True because the jobs came back with the schema having been set. The additional code added in system tests shows how to reproduce the bug.

Sorry, something went wrong.

Uh oh!

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

All reactions
@alixhami
BigQuery: removes LoadJob error for autodetect + schema
a9ecddf
@alixhami alixhami added the api: bigquery Issues related to the BigQuery API. label Oct 18, 2017
@alixhami
alixhami requested review from jba, lukesneeringer, tseaver and tswast October 18, 2017 00:41
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 18, 2017
jba
jba reviewed Oct 18, 2017
View reviewed changes

@jba jba 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.

OK I guess, but I wonder if there's a way to distinguish between a user setting a schema when autodetect=True, which should be an error, vs. reading a LoadJob. Maybe the from_api_repr method could set _schema instead of schema to avoid triggering the check?

Sorry, something went wrong.

Uh oh!

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

All reactions
@tswast

tswast commented Oct 18, 2017

Copy link
Copy Markdown
Contributor

You're right that it could be possible to bypass the check on load. It would be to change

config.schema = _parse_schema_resource(schema)

to

config._schema = _parse_schema_resource(schema)

I think the server-side error message is pretty clear if someone does try to set a schema and use autodetect. I'm okay removing the client-side check.

All reactions

Sorry, something went wrong.

Uh oh!

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

tswast
tswast approved these changes Oct 18, 2017
View reviewed changes
@tswast
tswast merged commit f192cb6 into googleapis:bigquery-b2 Oct 18, 2017
@alixhami
alixhami deleted the bq-fix-load-job-schema-setter branch January 5, 2018 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes
@lukesneeringer lukesneeringer Awaiting requested review from lukesneeringer
@tseaver tseaver Awaiting requested review from tseaver
+1 more reviewer
@jba jba jba left review comments
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

api: bigquery Issues related to the BigQuery API. 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.

Uh oh!

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

4 participants

@alixhami @tswast @jba @googlebot
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.