in python/datafusion/dataframe.py [0:0]
def get_default_level(self) -> Optional[int]:
"""Get the default compression level for the compression type.
Returns:
The default compression level for the compression type.
"""
# GZIP, BROTLI default values from deltalake repo
# https://github.com/apache/datafusion-python/pull/981#discussion_r1905619163
# ZSTD default value from delta-rs
# https://github.com/apache/datafusion-python/pull/981#discussion_r1904789223
if self == Compression.GZIP:
return 6
if self == Compression.BROTLI:
return 1
if self == Compression.ZSTD:
return 4
return None