@@ -937,7 +937,7 @@ def with_script(self, script):
937937 def with_new_output_dataset (self , name , connection ,
938938 type = None , format = None ,
939939 copy_partitioning_from = "FIRST_INPUT" ,
940- append = False ):
940+ append = False , overwrite = False ):
941941 """
942942 Create a new managed dataset as output to the recipe-to-be-created. The dataset is created immediately
943943
@@ -952,6 +952,7 @@ def with_new_output_dataset(self, name, connection,
952952 Use None for not partitioning the output, "FIRST_INPUT" to copy from the first input of the recipe,
953953 "dataset:XXX" to copy from a dataset name, or "folder:XXX" to copy from a folder id
954954 :param append: whether the recipe should append or overwrite the output when running (note: not available for all dataset types)
955+ :param overwrite: If the object being created already exists, overwrite it
955956 """
956957
957958 ch = self .project .new_managed_dataset_creation_helper (name )
@@ -967,7 +968,7 @@ def with_new_output_dataset(self, name, connection,
967968 elif copy_partitioning_from is not None :
968969 self .creation_settings ["partitioningOptionId" ] = "copy:%s" % copy_partitioning_from
969970
970- ch .create ()
971+ ch .create (overwrite = overwrite )
971972
972973 self .with_output (name , append = append )
973974 return self
0 commit comments