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

feat: add job_timeout_ms to job configuration classes - #1672

Closed
DevStephanie wants to merge 2 commits into
googleapis:mainfrom
DevStephanie:fix/add-jobtimeoutms-to-jobconfig
Closed

feat: add job_timeout_ms to job configuration classes#1672
DevStephanie wants to merge 2 commits into
googleapis:mainfrom
DevStephanie:fix/add-jobtimeoutms-to-jobconfig

Conversation

@DevStephanie

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • 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)

Fixes #<issue_number_goes_here> 🦕

  • correcting syntax for jobtimeoutms
  • adding test to test_query, based on example comment

@DevStephanie
DevStephanie requested review from a team and jainsahab and removed request for a teamOctober 4, 2023 19:02
@product-auto-labelproduct-auto-labelBot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Oct 4, 2023
@tswast
tswast changed the base branch from fix/add-jobtimeoutms-to-jobconfig to mainOctober 4, 2023 19:06
@DevStephanie
DevStephanieforce-pushed the fix/add-jobtimeoutms-to-jobconfig branch from cea062c to 3c9b034CompareOctober 4, 2023 19:14
@DevStephanie
DevStephanieforce-pushed the fix/add-jobtimeoutms-to-jobconfig branch from 3c9b034 to ec045b5CompareOctober 4, 2023 19:20
@DevStephanieDevStephanie changed the title Correcting syntax, adding test to test_query.pyfeat: add job_timeout_ms to job configuration classesOct 4, 2023
Comment threadgoogle/cloud/bigquery/job/base.py Outdated
Comment threadgoogle/cloud/bigquery/job/base.py Outdated
Comment threadgoogle/cloud/bigquery/job/base.py Outdated
ValueError: If ``value`` type is invalid.
"""

# None as this is an optional parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It could be None, but it could also be a real integer value. We should return self._properties.get("jobTimeoutMs") (converted to an integer if not None. I believe there are other integer properties that use a helper function for this conversion.)


@jobtimeout_ms.setter
def jobtimeout(self, value):
if not isinstance(value, int):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should also allow None.

return None

@jobtimeout_ms.setter
def jobtimeout(self, value):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make sure this function name matches your @property.

from google.cloud.bigquery import _helpers
from google.cloud.bigquery import standard_sql
from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration
import google.cloud.bigquery.model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can revert the changes in this file.

self.assertEqual(job.ddl_target_table.project, self.PROJECT)

def test_jobtimeout_ms(self):
self.assertIsInstance(job.timeout_ms, value)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's set the job configuration timeout ms to something before asserting the value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment threadtests/unit/job/test_query.py Outdated
assert object_under_test.labels =={}
object_under_test.labels = {"data_owner": "someteam"}
assert object_under_test.labels == {"data_owner": "someteam"}
assert object_under_test.labels() =={}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revert these changes.

@chalmerlowe

Copy link
Copy Markdown
Collaborator

Thanks for providing this PR. I am grateful that you are looking to assist.

For the record: work is being conducted in the following PR to address this issue.
I submitted some ideas back to the original author of 1656 to help them advance their code and provide tests. I am gonna finalize that effort. Will close this PR.

#1656

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: mPull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@DevStephanie@chalmerlowe@tswast