Skip to content

Commit f0f8be7

Browse files
committed
feat: Add overloads for write_parquet method to support various compression options
1 parent 3598637 commit f0f8be7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

python/datafusion/dataframe.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,30 @@ def write_csv(self, path: str | pathlib.Path, with_header: bool = False) -> None
874874
"""
875875
self.df.write_csv(str(path), with_header)
876876

877+
@overload
878+
def write_parquet(
879+
self,
880+
path: str | pathlib.Path,
881+
compression: str,
882+
compression_level: int | None = None,
883+
) -> None: ...
884+
885+
@overload
886+
def write_parquet(
887+
self,
888+
path: str | pathlib.Path,
889+
compression: Compression = Compression.ZSTD,
890+
compression_level: int | None = None,
891+
) -> None: ...
892+
893+
@overload
894+
def write_parquet(
895+
self,
896+
path: str | pathlib.Path,
897+
compression: ParquetWriterOptions,
898+
compression_level: None = None,
899+
) -> None: ...
900+
877901
def write_parquet(
878902
self,
879903
path: str | pathlib.Path,

0 commit comments

Comments
 (0)