This is an automated email from the ASF dual-hosted git repository.

jorisvandenbossche pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 5b17b8402e GH-38712: [Python] Remove dead code in _reconstruct_block 
(#38714)
5b17b8402e is described below

commit 5b17b8402e0444f1a9b9ce1fb4dc2b7b92e9aede
Author: Alenka Frim <[email protected]>
AuthorDate: Wed Nov 15 09:21:22 2023 +0100

    GH-38712: [Python] Remove dead code in _reconstruct_block (#38714)
    
    ### Rationale for this change
    
    It seems the object case in `_reconstruct_block` is a dead code and is not 
needed anymore so therefore could be removed.
    
    ### What changes are included in this PR?
    
    Removal of the object case in `_reconstruct_block` code. Was also looking 
at the `arrow_to_pandas.cc` code to see if there is any dead code present and I 
couldn't find any.
    
    ### Are these changes tested?
    
    The change in this PR should not make any of the existing tests fail.
    
    ### Are there any user-facing changes?
    
    There shouldn't be.
    * Closes: #38712
    
    Authored-by: AlenkaF <[email protected]>
    Signed-off-by: Joris Van den Bossche <[email protected]>
---
 python/pyarrow/pandas_compat.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/python/pyarrow/pandas_compat.py b/python/pyarrow/pandas_compat.py
index e232603ba4..be29f68a13 100644
--- a/python/pyarrow/pandas_compat.py
+++ b/python/pyarrow/pandas_compat.py
@@ -26,7 +26,6 @@ from copy import deepcopy
 from itertools import zip_longest
 import json
 import operator
-import pickle
 import re
 import warnings
 
@@ -721,9 +720,6 @@ def _reconstruct_block(item, columns=None, 
extension_columns=None):
         block = _int.make_block(block_arr, placement=placement,
                                 klass=_int.DatetimeTZBlock,
                                 dtype=dtype)
-    elif 'object' in item:
-        block = _int.make_block(pickle.loads(block_arr),
-                                placement=placement)
     elif 'py_array' in item:
         # create ExtensionBlock
         arr = item['py_array']

Reply via email to