Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
27 changes: 27 additions & 0 deletions google/cloud/bigquery/job/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,33 @@ def __setattr__(self, name, value):
)
super(_JobConfig, self).__setattr__(name, value)

@property
def jobtimeout(self):
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.

nit: normally we use snake_case to transform from rest API to python.

I'd prefer job_timeout_ms unless we change this to accept a datetime.timedelta, in which case job_timeout may make more sense.

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.

FWIW: We use default_table_expiration_ms here:

def default_table_expiration_ms(self):
so probably makes the most sense to stay consistent with that.

Comment thread
chalmerlowe marked this conversation as resolved.
Outdated
""" Optional parameter. Job timeout in milliseconds. If this time limit is exceeded, BigQuery might attempt to stop the job.

https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfiguration.FIELDS.job_timeout_ms

e.g.
job_config = bigquery.QueryJobConfig( jobtimeout = 5000 )

or

job_config.jobtimeout = 5000
Raises:
ValueError: If ``value`` type is invalid.
"""

# None as this is an optional parameter.
Comment thread
chalmerlowe marked this conversation as resolved.
return None

@jobtimeout.setter
def jobtimeout(self, value):
Comment thread
chalmerlowe marked this conversation as resolved.
Outdated
if not isinstance(value, int):
raise ValueError("Pass an int for jobTimeoutMs, e.g. 5000")

""" Docs indicate a string is expected by the API """
self._properties["jobTimeoutMs"] = str(value)

@property
def labels(self):
"""Dict[str, str]: Labels for the job.
Expand Down