diff --git a/python/fate/arch/dataframe/ops/_encoder.py b/python/fate/arch/dataframe/ops/_encoder.py index 44693e34ae..07e6127fa5 100644 --- a/python/fate/arch/dataframe/ops/_encoder.py +++ b/python/fate/arch/dataframe/ops/_encoder.py @@ -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) diff --git a/python/fate/arch/dataframe/ops/_replace.py b/python/fate/arch/dataframe/ops/_replace.py index 5a2fa04e97..5125e5dcef 100644 --- a/python/fate/arch/dataframe/ops/_replace.py +++ b/python/fate/arch/dataframe/ops/_replace.py @@ -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: