@@ -139,6 +139,14 @@ class CreateBatchPredictionJobOperator(GoogleCloudBaseOperator):
139139 :param sync: Whether to execute this method synchronously. If False, this method will be executed in
140140 concurrent Future and any downstream object will be immediately returned and synced when the
141141 Future has completed.
142+ :param create_request_timeout: Optional. The timeout for the create request in seconds.
143+ :param batch_size: Optional. The number of the records (e.g. instances)
144+ of the operation given in each batch
145+ to a machine replica. Machine type, and size of a single record should be considered
146+ when setting this parameter, higher value speeds up the batch operation's execution,
147+ but too high value will result in a whole batch not fitting in a machine's memory,
148+ and the whole operation will fail.
149+ The default value is same as in the aiplatform's BatchPredictionJob.
142150 :param retry: Designation of what errors, if any, should be retried.
143151 :param timeout: The timeout for this request.
144152 :param metadata: Strings which should be sent along with the request as metadata.
@@ -181,6 +189,8 @@ def __init__(
181189 labels : dict [str , str ] | None = None ,
182190 encryption_spec_key_name : str | None = None ,
183191 sync : bool = True ,
192+ create_request_timeout : float | None = None ,
193+ batch_size : int | None = None ,
184194 gcp_conn_id : str = "google_cloud_default" ,
185195 impersonation_chain : str | Sequence [str ] | None = None ,
186196 ** kwargs ,
@@ -208,6 +218,8 @@ def __init__(
208218 self .labels = labels
209219 self .encryption_spec_key_name = encryption_spec_key_name
210220 self .sync = sync
221+ self .create_request_timeout = create_request_timeout
222+ self .batch_size = batch_size
211223 self .gcp_conn_id = gcp_conn_id
212224 self .impersonation_chain = impersonation_chain
213225 self .hook : BatchPredictionJobHook | None = None
@@ -241,6 +253,8 @@ def execute(self, context: Context):
241253 labels = self .labels ,
242254 encryption_spec_key_name = self .encryption_spec_key_name ,
243255 sync = self .sync ,
256+ create_request_timeout = self .create_request_timeout ,
257+ batch_size = self .batch_size ,
244258 )
245259
246260 batch_prediction_job = result .to_dict ()
0 commit comments