File tree 1 file changed +12
-5
lines changed 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -1100,13 +1100,20 @@ def py_fallback(bvalues: ArrayLike) -> ArrayLike:
1100
1100
# in the operation. We un-split here.
1101
1101
result = result ._consolidate ()
1102
1102
assert isinstance (result , (Series , DataFrame )) # for mypy
1103
- mgr = result ._mgr
1104
- assert isinstance (mgr , BlockManager )
1105
- assert len (mgr .blocks ) == 1
1106
1103
1107
1104
# unwrap DataFrame to get array
1108
- result = mgr .blocks [0 ].values
1109
- return result
1105
+ mgr = result ._mgr
1106
+ assert isinstance (mgr , BlockManager )
1107
+ if len (mgr .blocks ) != 1 :
1108
+ # We've split an object block! Everything we've assumed
1109
+ # about a single block input returning a single block output
1110
+ # is a lie. To keep the code-path for the typical non-split case
1111
+ # clean, we choose to clean up this mess later on.
1112
+ return mgr .as_array ()
1113
+ else :
1114
+ assert len (mgr .blocks ) == 1
1115
+ result = mgr .blocks [0 ].values
1116
+ return result
1110
1117
1111
1118
def blk_func (bvalues : ArrayLike ) -> ArrayLike :
1112
1119
You can’t perform that action at this time.
0 commit comments