class_docstr: Copy objects that were modified during a time span, run a transform, and upload results to a bucket.
  
  Determines a list of objects that were added or modified at a GCS source
  location during a specific time-span, copies them to a temporary location
  on the local file system, runs a transform on this file as specified by
  the transformation script and uploads the output to the destination bucket.
  
  .. seealso::
      For more information on how to use this operator, take a look at the guide:
      :ref:`howto/operator:GCSTimeSpanFileTransformOperator`
  
  The locations of the source and the destination files in the local
  filesystem is provided as an first and second arguments to the
  transformation script. The time-span is passed to the transform script as
  third and fourth argument as UTC ISO 8601 string.
  
  The transformation script is expected to read the
  data from source, transform it and write the output to the local
  destination file.
  
  :param source_bucket: The bucket to fetch data from. (templated)
  :param source_prefix: Prefix string which filters objects whose name begin with
         this prefix. Can interpolate execution date and time components. (templated)
  :param source_gcp_conn_id: The connection ID to use connecting to Google Cloud
         to download files to be processed.
  :param source_impersonation_chain: Optional service account to impersonate using short-term
      credentials (to download files to be processed), or chained list of accounts required to
      get the access_token of the last account in the list, which will be impersonated in the
      request. If set as a string, the account must grant the originating account
      the Service Account Token Creator IAM role.
      If set as a sequence, the identities from the list must grant
      Service Account Token Creator IAM role to the directly preceding identity, with first
      account from the list granting this role to the originating account (templated).
  
  :param destination_bucket: The bucket to write data to. (templated)
  :param destination_prefix: Prefix string for the upload location.
      Can interpolate execution date and time components. (templated)
  :param destination_gcp_conn_id: The connection ID to use connecting to Google Cloud
         to upload processed files.
  :param destination_impersonation_chain: Optional service account to impersonate using short-term
      credentials (to upload processed files), or chained list of accounts required to get the access_token
      of the last account in the list, which will be impersonated in the request.
      If set as a string, the account must grant the originating account
      the Service Account Token Creator IAM role.
      If set as a sequence, the identities from the list must grant
      Service Account Token Creator IAM role to the directly preceding identity, with first
      account from the list granting this role to the originating account (templated).
  
  :param transform_script: location of the executable transformation script or list of arguments
      passed to subprocess ex. `['python', 'script.py', 10]`. (templated)
  
  
  :param chunk_size: The size of a chunk of data when downloading or uploading (in bytes).
      This must be a multiple of 256 KB (per the google clout storage API specification).
  :param download_continue_on_fail: With this set to true, if a download fails the task does not error out
      but will still continue.
  :param upload_chunk_size: The size of a chunk of data when uploading (in bytes).
      This must be a multiple of 256 KB (per the google clout storage API specification).
  :param upload_continue_on_fail: With this set to true, if an upload fails the task does not error out
      but will still continue.
  :param upload_num_attempts: Number of attempts to try to upload a single file.
class_docstr_tok: ["Copy","objects","that","were","modified","during","a","time","span",",","run","a","transform",",","and","upload","results","to","a","bucket",".","Determines","a","list","of","objects","that","were","added","or","modified","at","a","GCS","source","location","during","a","specific","time-span",",","copies","them","to","a","temporary","location","on","the","local","file","system",",","runs","a","transform","on","this","file","as","specified","by","the","transformation","script","and","uploads","the","output","to","the","destination","bucket",".","..","seealso",":",":","For","more","information","on","how","to","use","this","operator",",","take","a","look","at","the","guide",":",":","ref",":","`","howto\/operator",":","GCSTimeSpanFileTransformOperator","`","The","locations","of","the","source","and","the","destination","files","in","the","local","filesystem","is","provided","as","an","first","and","second","arguments","to","the","transformation","script",".","The","time-span","is","passed","to","the","transform","script","as","third","and","fourth","argument","as","UTC","ISO","8601","string",".","The","transformation","script","is","expected","to","read","the","data","from","source",",","transform","it","and","write","the","output","to","the","local","destination","file",".",":","param","source_bucket",":","The","bucket","to","fetch","data","from",".","(","templated",")",":","param","source_prefix",":","Prefix","string","which","filters","objects","whose","name","begin","with","this","prefix",".","Can","interpolate","execution","date","and","time","components",".","(","templated",")",":","param","source_gcp_conn_id",":","The","connection","ID","to","use","connecting","to","Google","Cloud","to","download","files","to","be","processed",".",":","param","source_impersonation_chain",":","Optional","service","account","to","impersonate","using","short-term","credentials","(","to","download","files","to","be","processed",")",",","or","chained","list","of","accounts","required","to","get","the","access_token","of","the","last","account","in","the","list",",","which","will","be","impersonated","in","the","request",".","If","set","as","a","string",",","the","account","must","grant","the","originating","account","the","Service","Account","Token","Creator","IAM","role",".","If","set","as","a","sequence",",","the","identities","from","the","list","must","grant","Service","Account","Token","Creator","IAM","role","to","the","directly","preceding","identity",",","with","first","account","from","the","list","granting","this","role","to","the","originating","account","(","templated",")",".",":","param","destination_bucket",":","The","bucket","to","write","data","to",".","(","templated",")",":","param","destination_prefix",":","Prefix","string","for","the","upload","location",".","Can","interpolate","execution","date","and","time","components",".","(","templated",")",":","param","destination_gcp_conn_id",":","The","connection","ID","to","use","connecting","to","Google","Cloud","to","upload","processed","files",".",":","param","destination_impersonation_chain",":","Optional","service","account","to","impersonate","using","short-term","credentials","(","to","upload","processed","files",")",",","or","chained","list","of","accounts","required","to","get","the","access_token","of","the","last","account","in","the","list",",","which","will","be","impersonated","in","the","request",".","If","set","as","a","string",",","the","account","must","grant","the","originating","account","the","Service","Account","Token","Creator","IAM","role",".","If","set","as","a","sequence",",","the","identities","from","the","list","must","grant","Service","Account","Token","Creator","IAM","role","to","the","directly","preceding","identity",",","with","first","account","from","the","list","granting","this","role","to","the","originating","account","(","templated",")",".",":","param","transform_script",":","location","of","the","executable","transformation","script","or","list","of","arguments","passed","to","subprocess","ex",".","`","[","'python","'",",","'script.py","'",",","10","]","`",".","(","templated",")",":","param","chunk_size",":","The","size","of","a","chunk","of","data","when","downloading","or","uploading","(","in","bytes",")",".","This","must","be","a","multiple","of","256","KB","(","per","the","google","clout","storage","API","specification",")",".",":","param","download_continue_on_fail",":","With","this","set","to","true",",","if","a","download","fails","the","task","does","not","error","out","but","will","still","continue",".",":","param","upload_chunk_size",":","The","size","of","a","chunk","of","data","when","uploading","(","in","bytes",")",".","This","must","be","a","multiple","of","256","KB","(","per","the","google","clout","storage","API","specification",")",".",":","param","upload_continue_on_fail",":","With","this","set","to","true",",","if","an","upload","fails","the","task","does","not","error","out","but","will","still","continue",".",":","param","upload_num_attempts",":","Number","of","attempts","to","try","to","upload","a","single","file","."]
docstr: Interpolate prefix with datetime.
  
  :param prefix: The prefix to interpolate
  :param dt: The datetime to interpolate
docstr_tok: ["Interpolate","prefix","with","datetime",".",":","param","prefix",":","The","prefix","to","interpolate",":","param","dt",":","The","datetime","to","interpolate"]
code: def interpolate_prefix(
      prefix: str, dt: datetime.datetime
  ) -> str | None:
      """Interpolate prefix with datetime.
  
      :param prefix: The prefix to interpolate
      :param dt: The datetime to interpolate
  
      """
      return dt.strftime(prefix) if prefix else None
  
imports: from __future__ import annotations
  import datetime
  import subprocess
  import sys
  import warnings
  from pathlib import Path
  from tempfile import NamedTemporaryFile, TemporaryDirectory
  from typing import TYPE_CHECKING, Sequence
  import pendulum
  from google.api_core.exceptions import Conflict
  from google.cloud.exceptions import GoogleCloudError
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.google.cloud.hooks.gcs import GCSHook
  from airflow.providers.google.cloud.operators.cloud_base import GoogleCloudBaseOperator
  from airflow.providers.google.common.links.storage import FileDetailsLink, StorageLink
  from airflow.utils import timezone
label_desc: Use image node_id 1 for calling the GCSTimeSpanFileTransformOperator obj's underlying member method code with example usage: obj.interpolate_prefix(prefix, dt) and returns: unknown