Skip to content

Commit

Permalink
Fixes compatiblity bug for pandas 1.2.0. (#115)
Browse files Browse the repository at this point in the history
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
  • Loading branch information
sighingnow authored Dec 31, 2020
1 parent a40180d commit 3f8a69c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/vineyard/data/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def dataframe_resolver(obj, resolver):
index_size = 0
for idx, name in enumerate(columns):
np_value = resolver.run(obj.member('__values_-value-%d' % idx))
blocks.append(Block(np.expand_dims(np_value, 0), slice(idx, idx + 1, 1)))
# ndim: 1 for SingleBlockManager/Series, 2 for BlockManager/DataFrame
blocks.append(Block(np.expand_dims(np_value, 0), slice(idx, idx + 1, 1), ndim=2))
index_size = len(np_value)
return pd.DataFrame(BlockManager(blocks, [columns, np.arange(index_size)]))

Expand Down
4 changes: 3 additions & 1 deletion setup.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ version = @VINEYARD_VERSION@
[options]
install_requires =
numpy
pandas < 1.2.0
pandas<1.0.0; python_version<'3.6'
pandas<1.2.0; python_version<'3.7'
pandas>=1.0.0; python_version>='3.7'
pyarrow
sortedcontainers
setuptools
Expand Down

0 comments on commit 3f8a69c

Please sign in to comment.