@@ -3388,7 +3388,7 @@ def query(
33883388 project : Optional [str ] = None ,
33893389 retry : retries .Retry = DEFAULT_RETRY ,
33903390 timeout : TimeoutType = DEFAULT_TIMEOUT ,
3391- job_retry : retries .Retry = DEFAULT_JOB_RETRY ,
3391+ job_retry : Optional [ retries .Retry ] = DEFAULT_JOB_RETRY ,
33923392 api_method : Union [str , enums .QueryApiMethod ] = enums .QueryApiMethod .INSERT ,
33933393 ) -> job .QueryJob :
33943394 """Run a SQL query.
@@ -3455,18 +3455,9 @@ def query(
34553455 class, or if both ``job_id`` and non-``None`` non-default
34563456 ``job_retry`` are provided.
34573457 """
3458- job_id_given = job_id is not None
3459- if (
3460- job_id_given
3461- and job_retry is not None
3462- and job_retry is not DEFAULT_JOB_RETRY
3463- ):
3464- raise TypeError (
3465- "`job_retry` was provided, but the returned job is"
3466- " not retryable, because a custom `job_id` was"
3467- " provided."
3468- )
3458+ _job_helpers .validate_job_retry (job_id , job_retry )
34693459
3460+ job_id_given = job_id is not None
34703461 if job_id_given and api_method == enums .QueryApiMethod .QUERY :
34713462 raise TypeError (
34723463 "`job_id` was provided, but the 'QUERY' `api_method` was requested."
@@ -3524,7 +3515,7 @@ def query_and_wait(
35243515 api_timeout : TimeoutType = DEFAULT_TIMEOUT ,
35253516 wait_timeout : Union [Optional [float ], object ] = POLLING_DEFAULT_VALUE ,
35263517 retry : retries .Retry = DEFAULT_RETRY ,
3527- job_retry : retries .Retry = DEFAULT_JOB_RETRY ,
3518+ job_retry : Optional [ retries .Retry ] = DEFAULT_JOB_RETRY ,
35283519 page_size : Optional [int ] = None ,
35293520 max_results : Optional [int ] = None ,
35303521 ) -> RowIterator :
0 commit comments