GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
Contributor
Fixes #297
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
bhtucker
reviewed
|
| job_config | ||
| ) | ||
| destination = _get_sub_prop(job_config, ["copy", "destinationTable"]) | ||
| destination = TableReference.from_api_repr(destination) |
There was a problem 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.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
…into bigquery_issue_297
…into bigquery_issue_297
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…into bigquery_issue_297
| self._configuration._properties, ["copy", "sourceTable"] | ||
| ) | ||
| if source_table: | ||
| _helpers._set_sub_prop( |
There was a problem 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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| 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: |
There was a problem 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.
There was an error while loading. Please reload this page.
| 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: |
There was a problem 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.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my bad.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ) | ||
| elif "query" in job_config: | ||
| copy_config = copy.deepcopy(job_config) | ||
| _del_sub_prop(copy_config, ["query", "destinationTable"]) |
There was a problem 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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Job retry solution (client.create_job) is broken
There was an error while loading. Please reload this page.