Skip to content

Commit

Permalink
dataframe: fix partial columns bucketize
Browse files Browse the repository at this point in the history
Signed-off-by: mgqa34 <mgq3374541@163.com>
Signed-off-by: sagewe <wbwmat@gmail.com>
  • Loading branch information
mgqa34 authored and sagewe committed Jul 21, 2023
1 parent ea7a1f2 commit 1cf1b3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/fate/arch/dataframe/ops/_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def _mapper(blocks, boundaries_list: list = None, narrow_loc: list = None,
block_indexes = data_manager.infer_operable_blocks()
if len(block_indexes) > 1:
to_promote_types = []
for bid in block_indexes:
to_promote_types.append((bid, BlockType.get_block_type(BUCKETIZE_RESULT_TYPE)))
for _bid in block_indexes:
to_promote_types.append((_bid, data_manager.get_block(_bid).block_type))

data_manager.promote_types(to_promote_types)
block_table, data_manager = compress_blocks(block_table, data_manager)
Expand Down
2 changes: 1 addition & 1 deletion python/fate/arch/dataframe/ops/_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def replace(df: "DataFrame", to_replace: dict):
_to_replace_list = []
for name, (_bid, _) in zip(field_names, blocks_loc):
block_type = data_manager.get_block(_bid).block_type
for _, v in to_replace[name].items():
for k, v in to_replace[name].items():
v_type = BlockType.get_block_type(type(v))

if block_type < v_type:
Expand Down

0 comments on commit 1cf1b3e

Please sign in to comment.