kszucs commented on a change in pull request #10717:
URL: https://github.com/apache/arrow/pull/10717#discussion_r672331156



##########
File path: python/pyarrow/ipc.pxi
##########
@@ -158,9 +160,14 @@ cdef class IpcWriteOptions(_Weakrefable):
     def compression(self, value):
         if value is None:
             self.c_options.codec.reset()
-        else:
+        elif isinstance(value, str):
             self.c_options.codec = shared_ptr[CCodec](GetResultValue(
                 CCodec.Create(_ensure_compression(value))).release())
+        elif isinstance(value, Codec):
+            self.c_options.codec = (<Codec>value).wrapped

Review comment:
       Just a nit, but we could use `.unwrap()` here.

##########
File path: python/pyarrow/tests/test_feather.py
##########
@@ -599,6 +602,9 @@ def test_v2_set_chunksize():
 
 
 @pytest.mark.pandas
[email protected]
[email protected]
[email protected]

Review comment:
       Could we expand this as:
   
   ```
   pytest.mark.parametrize("codec", [
       pytest.param("lz4", marks=pytest.mark.lz4),
       pytest.param("snappy", marks=pytest.mark.snappy),
       pytest.param("zstd", marks=pytest.mark.zstd),
   ])
   ```
   
   By letting pytest to iterate through the cases rather than doing it 
ourselves?
   
   This would enable us to run this case just for the available plugins.

##########
File path: python/pyarrow/tests/test_feather.py
##########
@@ -599,6 +602,9 @@ def test_v2_set_chunksize():
 
 
 @pytest.mark.pandas
[email protected]
[email protected]
[email protected]

Review comment:
       Could we expand this as:
   
   ```python
   pytest.mark.parametrize("codec", [
       pytest.param("lz4", marks=pytest.mark.lz4),
       pytest.param("snappy", marks=pytest.mark.snappy),
       pytest.param("zstd", marks=pytest.mark.zstd),
   ])
   ```
   
   By letting pytest to iterate through the cases rather than doing it 
ourselves?
   
   This would enable us to run this case just for the available plugins.




-- 
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