-
Notifications
You must be signed in to change notification settings - Fork 322
feat: add job_timeout_ms to job configuration classes
#1672
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
feat: add job_timeout_ms to job configuration classes
#1672
Conversation
cea062c to
3c9b034
Compare
Slight tidy up.
3c9b034 to
ec045b5
Compare
job_timeout_ms to job configuration classes
| ValueError: If ``value`` type is invalid. | ||
| """ | ||
|
|
||
| # None as this is an optional parameter. |
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.
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): |
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.
We should also allow None.
| return None | ||
|
|
||
| @jobtimeout_ms.setter | ||
| def jobtimeout(self, value): |
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.
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 |
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.
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) |
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.
Let's set the job configuration timeout ms to something before asserting the value.
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.
Also, move these tests to where we test QueryJobConfig: https://github.com/googleapis/python-bigquery/blob/main/tests/unit/job/test_query_config.py#L20
| 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() =={} |
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.
Revert these changes.
|
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. |
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:
Fixes #<issue_number_goes_here> 🦕