Skip to content

Commit e7ec09b

Browse files
committed
add comment on source of Compression
1 parent b86b142 commit e7ec09b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/datafusion/dataframe.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
from enum import Enum
3939

4040

41+
# excerpt from deltalake
42+
# https://github.com/apache/datafusion-python/pull/981#discussion_r1905619163
4143
class Compression(Enum):
4244
UNCOMPRESSED = "uncompressed"
4345
SNAPPY = "snappy"
@@ -58,11 +60,14 @@ def from_str(cls, value: str) -> "Compression":
5860
)
5961

6062
def get_default_level(self) -> int:
63+
# GZIP, BROTLI defaults from deltalake
64+
# https://github.com/apache/datafusion-python/pull/981#discussion_r1905619163
6165
if self == Compression.GZIP:
6266
DEFAULT = 6
6367
elif self == Compression.BROTLI:
6468
DEFAULT = 1
6569
elif self == Compression.ZSTD:
70+
# https://github.com/apache/datafusion-python/pull/981#discussion_r1904789223
6671
DEFAULT = 4
6772
else:
6873
raise KeyError(f"{self.value} does not have a compression level.")

0 commit comments

Comments
 (0)