File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
airflow/providers/google/cloud/hooks Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -461,6 +461,7 @@ def upload(
461461 timeout : int | None = DEFAULT_TIMEOUT ,
462462 num_max_attempts : int = 1 ,
463463 metadata : dict | None = None ,
464+ cache_control : str | None = None ,
464465 ) -> None :
465466 """
466467 Uploads a local file or file data as string or bytes to Google Cloud Storage.
@@ -476,6 +477,7 @@ def upload(
476477 :param timeout: Request timeout in seconds.
477478 :param num_max_attempts: Number of attempts to try to upload the file.
478479 :param metadata: The metadata to be uploaded with the file.
480+ :param cache_control: Cache-Control metadata field.
479481 """
480482
481483 def _call_with_retry (f : Callable [[], None ]) -> None :
@@ -512,6 +514,9 @@ def _call_with_retry(f: Callable[[], None]) -> None:
512514 if metadata :
513515 blob .metadata = metadata
514516
517+ if cache_control :
518+ blob .cacheControl = cache_control
519+
515520 if filename and data :
516521 raise ValueError (
517522 "'filename' and 'data' parameter provided. Please "
You can’t perform that action at this time.
0 commit comments