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: broken create_job method by HemangChothani · Pull Request #300 · googleapis/python-bigquery

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

Conversation

@HemangChothani

@HemangChothani HemangChothani commented Oct 6, 2020

Copy link
Copy Markdown
Contributor

Fixes #297

Sorry, something went wrong.

Uh oh!

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

All reactions
@HemangChothani
fix: broken create_job method
f305f04
@HemangChothani
HemangChothani requested review from a team and tswast October 6, 2020 13:30
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 6, 2020
bhtucker
bhtucker reviewed Oct 6, 2020
View reviewed changes

@bhtucker bhtucker left a comment •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

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.

Since the root cause of this being broken for a while was the use of autospec mocks early in the test, I wonder if it's possible to mock something a bit further along so that the test still exercises the request marshalling. Seems like we should be able to at least have coverage through to_api_repr of the Job created by this method.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google/cloud/bigquery/client.py
job_config
)
destination = _get_sub_prop(job_config, ["copy", "destinationTable"])
destination = TableReference.from_api_repr(destination)

@bhtucker bhtucker Oct 6, 2020

Copy link
Copy Markdown

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.

Would you like to guard this check with isinstance(TableReference, destination)?

Sorry, something went wrong.

Uh oh!

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

All reactions

@HemangChothani HemangChothani Oct 7, 2020

Copy link
Copy Markdown
Contributor Author

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 mock further in test so now it cover to_api_repr. I am not sure about the guard to check instance because job_config is dict and as per the example it has values in the string format.

Sorry, something went wrong.

Uh oh!

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

All reactions
HemangChothani added 3 commits October 7, 2020 11:14
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
f98950a
…into bigquery_issue_297
@HemangChothani
fix: changes in unit tests
38ce75e
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
8a27c7c
…into bigquery_issue_297
tswast
tswast suggested changes Oct 9, 2020
View reviewed changes
Comment thread google/cloud/bigquery/client.py Resolved

Uh oh!

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

Comment thread tests/unit/test_client.py Resolved

Uh oh!

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

HemangChothani added 2 commits October 12, 2020 20:16
@HemangChothani
fix: fix sourceTable thing
14bbe01
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
64549c4
…into bigquery_issue_297
tswast
tswast suggested changes Oct 12, 2020
View reviewed changes
Comment thread google/cloud/bigquery/job.py Outdated
self._configuration._properties, ["copy", "sourceTable"]
)
if source_table:
_helpers._set_sub_prop(

@tswast tswast Oct 12, 2020

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.

No need for this logic. We can always set the sourceTables with only a single item, but if given a job resource that has only sourceTable we need to be able to handle that.

Sorry, something went wrong.

Uh oh!

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

All reactions
HemangChothani added 2 commits October 13, 2020 14:48
@HemangChothani
fix: handle sourceTable passed in job resource
f94998f
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
d8b9e77
…into bigquery_issue_297
tswast
tswast suggested changes Oct 13, 2020
View reviewed changes
Comment thread google/cloud/bigquery/job.py Resolved

Uh oh!

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

tswast
tswast reviewed Oct 13, 2020
View reviewed changes
Comment thread tests/unit/test_client.py Outdated
with load_patch as client_method, get_config_patch:
client.create_job(job_config=job_config)
client_method.assert_called_once()
if "copy" in job_config:

@tswast tswast Oct 13, 2020

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.

Ditto. I'm sure confused by this logic, but I think whatever it was meant to do is unnecessary after #323

Sorry, something went wrong.

Uh oh!

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

All reactions
@HemangChothani
fix: resolve conflict and address comments
b578c90
tswast
tswast reviewed Oct 16, 2020
View reviewed changes
Comment thread tests/unit/test_client.py Outdated
with load_patch as client_method, get_config_patch:
client.create_job(job_config=job_config)
client_method.assert_called_once()
# if "copy" in job_config:

@tswast tswast Oct 16, 2020

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.

Is this commented out code needed?

Sorry, something went wrong.

Uh oh!

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

All reactions

@HemangChothani HemangChothani Oct 16, 2020

Copy link
Copy Markdown
Contributor Author

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.

Sorry, my bad.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread tests/unit/test_client.py Resolved

Uh oh!

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

HemangChothani added 2 commits October 19, 2020 11:21
@HemangChothani
fix: remove delete destination table from query
e130f9a
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
5c7a39b
…into bigquery_issue_297
tswast
tswast reviewed Oct 19, 2020
View reviewed changes
Comment thread google/cloud/bigquery/client.py
)
elif "query" in job_config:
copy_config = copy.deepcopy(job_config)
_del_sub_prop(copy_config, ["query", "destinationTable"])

@tswast tswast Oct 19, 2020

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 didn't realize we were already removing this property in past releases. We should restore this, since I don't want to break existing clients.

Sorry, something went wrong.

Uh oh!

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

All reactions
HemangChothani added 2 commits October 19, 2020 20:34
@HemangChothani
fix: revert destination table for query
4223b78
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-bigquery …
104294a
…into bigquery_issue_297
tswast
tswast reviewed Oct 19, 2020
View reviewed changes
Comment thread google/cloud/bigquery/client.py Resolved

Uh oh!

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

tswast
tswast approved these changes Oct 20, 2020
View reviewed changes
@tswast
tswast merged commit 155bacc into googleapis:master Oct 20, 2020
@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

2 more reviewers
@bhtucker bhtucker bhtucker left review comments
@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.

Job retry solution (client.create_job) is broken

Uh oh!

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

3 participants

@HemangChothani @tswast @bhtucker
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.