Skip to content

Commit c9da662

Browse files
authored
feat: enable_caching in PipelineJob to compile time settings (#557)
1 parent 6f8d3d1 commit c9da662

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

google/cloud/aiplatform/pipeline_jobs.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __init__(
9696
job_id: Optional[str] = None,
9797
pipeline_root: Optional[str] = None,
9898
parameter_values: Optional[Dict[str, Any]] = None,
99-
enable_caching: Optional[bool] = True,
99+
enable_caching: Optional[bool] = None,
100100
encryption_spec_key_name: Optional[str] = None,
101101
labels: Optional[Dict[str, str]] = None,
102102
credentials: Optional[auth_credentials.Credentials] = None,
@@ -121,7 +121,15 @@ def __init__(
121121
Optional. The mapping from runtime parameter names to its values that
122122
control the pipeline run.
123123
enable_caching (bool):
124-
Optional. Whether to turn on caching for the run. Defaults to True.
124+
Optional. Whether to turn on caching for the run.
125+
126+
If this is not set, defaults to the compile time settings, which
127+
are True for all tasks by default, while users may specify
128+
different caching options for individual tasks.
129+
130+
If this is set, the setting applies to all tasks in the pipeline.
131+
132+
Overrides the compile time settings.
125133
encryption_spec_key_name (str):
126134
Optional. The Cloud KMS resource identifier of the customer
127135
managed encryption key used to protect the job. Has the
@@ -198,7 +206,8 @@ def __init__(
198206
runtime_config = gca_pipeline_job_v1beta1.PipelineJob.RuntimeConfig()._pb
199207
json_format.ParseDict(runtime_config_dict, runtime_config)
200208

201-
_set_enable_caching_value(pipeline_job["pipelineSpec"], enable_caching)
209+
if enable_caching is not None:
210+
_set_enable_caching_value(pipeline_job["pipelineSpec"], enable_caching)
202211

203212
self._gca_resource = gca_pipeline_job_v1beta1.PipelineJob(
204213
display_name=display_name,

0 commit comments

Comments
 (0)