Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bigquery): preserve job config passed to Client methods #9735

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Nov 12, 2019

Fixes #9727.

This PR fixes the client methods possibly modifying JobConfig instances passed to them.

How to test

Run the example from the ticket description in a debugger, and verify that the job_config instance is indeed not modified when passing it to client.query(). Ditto for any other public client methods that accepts job config as an argument, including the Client class initializer.

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)

This commit assures that Client's methods that accept job config as
an argument operate on deep copies, and do not modify the original
job config instances passed to them.
@plamut plamut added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: bigquery Issues related to the BigQuery API. labels Nov 12, 2019
@plamut plamut requested a review from a team November 12, 2019 13:12
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 12, 2019
@plamut plamut removed the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Nov 12, 2019
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: Client.query modifies job_config object
3 participants