Nishuuzz opened a new pull request, #51753:
URL: https://github.com/apache/arrow/pull/51753

   `pa.show_info()` prints its Compression Codecs section from a hardcoded list:
   
   ```python
   codecs = ["brotli", "bz2", "gzip", "lz4_frame", "lz4", "snappy", "zstd"]
   ```
   
   That list has drifted from `_ensure_compression()` in io.pxi, which is what 
actually decides which names work. Two things fall out of it:
   
   - `lz4` and `lz4_frame` both map to `CCompressionType_LZ4_FRAME`, so the 
same codec is reported twice under two names.
   - `lz4_raw` maps to `CCompressionType_LZ4` and is a separate codec, but it 
is not listed at all, even though `pa.Codec.is_available('lz4_raw')` is True.
   
   So seven lines get printed for six codecs, and the one codec that is missing 
is a real one. Before:
   
   ```
   Compression Codecs:
     brotli              : Enabled
     bz2                 : Enabled
     gzip                : Enabled
     lz4_frame           : Enabled
     lz4                 : Enabled
     snappy              : Enabled
     zstd                : Enabled
   ```
   
   After:
   
   ```
   Compression Codecs:
     brotli              : Enabled
     bz2                 : Enabled
     gzip                : Enabled
     lz4                 : Enabled
     lz4_raw             : Enabled
     snappy              : Enabled
     zstd                : Enabled
   ```
   
   `lz4` is kept as the name for the frame codec since that is the one the 
docstrings lead with (`'lz4' (or 'lz4_frame')`).
   
   I checked this by applying the same change to an installed pyarrow and 
reading the output back, and by walking every name `_ensure_compression()` 
accepts to confirm which map onto the same C++ enum value. `show_info()` has no 
test coverage today and its output is a diagnostic print, so I have not added 
one, but I am happy to if you would prefer it pinned.
   
   Found while comparing hardcoded Python lists against their C++ counterparts, 
the same way GH-50847 turned up.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to