Skip to content

Commit e23e1a8

Browse files
committed
Initial implementation of “overwrite_files”
1 parent 48d9edc commit e23e1a8

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

awswrangler/s3/_write.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ def write( # noqa: PLR0913
279279
partitions_values: dict[str, list[str]] = {}
280280

281281
if mode == "overwrite_files":
282+
assert max_rows_by_file in [None, 0]
283+
282284
if filename_prefix is None:
283285
filename_prefix = "part"
284286
random_filename_suffix = ""

awswrangler/s3/_write_orc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def to_orc(
326326
partition_cols: list[str] | None = None,
327327
bucketing_info: BucketingInfoTuple | None = None,
328328
concurrent_partitioning: bool = False,
329-
mode: Literal["append", "overwrite", "overwrite_partitions"] | None = None,
329+
mode: Literal["append", "overwrite", "overwrite_partitions", "overwrite_files"] | None = None,
330330
catalog_versioning: bool = False,
331331
schema_evolution: bool = True,
332332
database: str | None = None,

awswrangler/s3/_write_parquet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def to_parquet(
353353
partition_cols: list[str] | None = None,
354354
bucketing_info: BucketingInfoTuple | None = None,
355355
concurrent_partitioning: bool = False,
356-
mode: Literal["append", "overwrite", "overwrite_partitions"] | None = None,
356+
mode: Literal["append", "overwrite", "overwrite_partitions", "overwrite_files"] | None = None,
357357
catalog_versioning: bool = False,
358358
schema_evolution: bool = True,
359359
database: str | None = None,

awswrangler/s3/_write_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def to_csv( # noqa: PLR0912,PLR0915
9898
partition_cols: list[str] | None = None,
9999
bucketing_info: BucketingInfoTuple | None = None,
100100
concurrent_partitioning: bool = False,
101-
mode: Literal["append", "overwrite", "overwrite_partitions"] | None = None,
101+
mode: Literal["append", "overwrite", "overwrite_partitions", "overwrite_files"] | None = None,
102102
catalog_versioning: bool = False,
103103
schema_evolution: bool = False,
104104
dtype: dict[str, str] | None = None,
@@ -661,7 +661,7 @@ def to_json( # noqa: PLR0912,PLR0915
661661
partition_cols: list[str] | None = None,
662662
bucketing_info: BucketingInfoTuple | None = None,
663663
concurrent_partitioning: bool = False,
664-
mode: Literal["append", "overwrite", "overwrite_partitions"] | None = None,
664+
mode: Literal["append", "overwrite", "overwrite_partitions", "overwrite_files"] | None = None,
665665
catalog_versioning: bool = False,
666666
schema_evolution: bool = True,
667667
dtype: dict[str, str] | None = None,

0 commit comments

Comments
 (0)