Skip to content

Commit 2d00362

Browse files
committed
Updated implementation of “overwrite_files” mode
1 parent 3206a2b commit 2d00362

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

awswrangler/s3/_write.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ def _validate_args(
107107
raise exceptions.InvalidArgumentCombination("Please, pass dataset=True to be able to use bucketing_info.")
108108
if mode is not None:
109109
raise exceptions.InvalidArgumentCombination("Please pass dataset=True to be able to use mode.")
110-
if mode == "overwrite_files" and (max_rows_by_file or bucketing_info):
111-
raise exceptions.InvalidArgumentValue(
112-
"When mode is set to 'overwrite_files', the "
113-
"`max_rows_by_file` and `bucketing_info` arguments cannot be set."
114-
)
115110
if any(arg is not None for arg in (table, description, parameters, columns_comments, columns_parameters)):
116111
raise exceptions.InvalidArgumentCombination(
117112
"Please pass dataset=True to be able to use any one of these "
@@ -131,6 +126,11 @@ def _validate_args(
131126
raise exceptions.InvalidArgumentValue(
132127
"Please pass a value greater than 1 for the number of buckets for bucketing."
133128
)
129+
elif mode == "overwrite_files" and (max_rows_by_file or bucketing_info):
130+
raise exceptions.InvalidArgumentValue(
131+
"When mode is set to 'overwrite_files', the "
132+
"`max_rows_by_file` and `bucketing_info` arguments cannot be set."
133+
)
134134

135135

136136
class _SanitizeResult(NamedTuple):

0 commit comments

Comments
 (0)