File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -277,9 +277,20 @@ def write( # noqa: PLR0913
277277 partition_cols = partition_cols if partition_cols else []
278278 dtype = dtype if dtype else {}
279279 partitions_values : dict [str , list [str ]] = {}
280- mode = "append" if mode is None else mode
281280
282- filename_prefix = filename_prefix + uuid .uuid4 ().hex if filename_prefix else uuid .uuid4 ().hex
281+ if mode == "overwrite_files" :
282+ if filename_prefix is None :
283+ filename_prefix = "part"
284+ random_filename_suffix = ""
285+ mode = "append"
286+ else :
287+ random_filename_suffix = uuid .uuid4 ().hex
288+
289+ if filename_prefix is None :
290+ filename_prefix = ""
291+ filename_prefix = filename_prefix + random_filename_suffix
292+
293+ mode = "append" if mode is None else mode
283294 cpus : int = _utils .ensure_cpu_count (use_threads = use_threads )
284295 s3_client = _utils .client (service_name = "s3" , session = boto3_session )
285296
You can’t perform that action at this time.
0 commit comments