We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b86b142 commit 4d3fd8dCopy full SHA for 4d3fd8d
1 file changed
python/datafusion/dataframe.py
@@ -38,6 +38,8 @@
38
from enum import Enum
39
40
41
+# excerpt from deltalake
42
+# https://github.com/apache/datafusion-python/pull/981#discussion_r1905619163
43
class Compression(Enum):
44
UNCOMPRESSED = "uncompressed"
45
SNAPPY = "snappy"
@@ -58,11 +60,14 @@ def from_str(cls, value: str) -> "Compression":
58
60
)
59
61
62
def get_default_level(self) -> int:
63
+ # GZIP, BROTLI defaults from
64
+ # https://github.com/apache/datafusion-python/pull/981#discussion_r1905619163
65
if self == Compression.GZIP:
66
DEFAULT = 6
67
elif self == Compression.BROTLI:
68
DEFAULT = 1
69
elif self == Compression.ZSTD:
70
+ # https://github.com/apache/datafusion-python/pull/981#discussion_r1904789223
71
DEFAULT = 4
72
else:
73
raise KeyError(f"{self.value} does not have a compression level.")
0 commit comments