code: def _try_to_compress_table(
      block_table, data_manager: DataManager, force_compress=False
  ):
      block_indexes = data_manager.infer_operable_blocks()
      if len(block_indexes) == 1:
          return block_table, data_manager
  
      block_type = None
      for block_id in block_indexes:
          _type = data_manager.get_block(block_id).block_type
          if not BlockType.is_integer(_type):
              raise ValueError(
                  "To use hist interface, indexes type should be integer >= 0"
              )
  
          if not block_type:
              block_type = _type
          elif block_type < _type:
              block_type = _type
  
      to_promote_types = []
      for bid in block_indexes:
          to_promote_types.append((bid, block_type))
  
      data_manager.promote_types(to_promote_types)
      block_table, data_manager = compress_blocks(
          block_table, data_manager, force_compress=force_compress
      )
  
      return block_table, data_manager
  
file_path: FATE/python/fate/arch/dataframe/ops/_histogram.py
imports: import functools
  import typing
  from typing import Union
  from .._dataframe import DataFrame
  from ..manager import BlockType, DataManager
  from ._compress_block import compress_blocks
label_desc: Use image node_id 2 for calling a global function with example usage: _try_to_compress_table(block_table, data_manager, force_compress) and returns: block_table,  data_manager, block_table,  data_manager