# Buggy code
def create_pool(self, *args, **kwargs):
    # here we create necessary actors on worker
    # and distribute them over processes

    cuda_devices = [self.args.cuda_device] if self.args.cuda_device else None
    self._service = WorkerService(
        advertise_addr=self.args.advertise,
        n_cpu_process=self.args.cpu_procs,
        n_net_process=self.args.net_procs or self.args.io_procs,
        cuda_devices=cuda_devices,
        spill_dirs=self.args.spill_dir,
        lock_free_fileio=self.args.lock_free_fileio,
        total_mem=self.args.phy_mem,
        cache_mem_limit=self.args.cache_mem,
        ignore_avail_mem=self.args.ignore_avail_mem,
        min_mem_size=self.args.min_mem,
        disk_compression=self.args.disk_compression.lower(),
        transfer_compression=self.args.transfer_compression.lower(),
        plasma_dir=self.args.plasma_dir,
        use_ext_plasma_dir=bool(self.args.plasma_dir),
    )
    # start plasma
    self._service.start_plasma()

    self.n_process = self._service.n_process
    kwargs["distributor"] = MarsDistributor(self.n_process, "w:0:")
    return super().create_pool(*args, **kwargs)


# Traceback (ModuleNotFoundError)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/wenjun.swj/Code/mars/mars/core.py", line 129, in __repr__
return self._data.__repr__()
File "/Users/wenjun.swj/Code/mars/mars/dataframe/core.py", line 1083, in __repr__
return self._to_str(representation=True)
File "/Users/wenjun.swj/Code/mars/mars/dataframe/core.py", line 1053, in _to_str
self, session=self._executed_sessions[-1])
File "/Users/wenjun.swj/Code/mars/mars/dataframe/utils.py", line 773, in fetch_corner_data
return df_or_series.fetch(session=session)
File "/Users/wenjun.swj/Code/mars/mars/core.py", line 376, in fetch
return session.fetch(self, **kw)
File "/Users/wenjun.swj/Code/mars/mars/session.py", line 491, in fetch
result = self._sess.fetch(*tileables, **kw)
File "/Users/wenjun.swj/Code/mars/mars/web/session.py", line 265, in fetch
result_data = dataserializer.loads(resp.content)
File "/Users/wenjun.swj/Code/mars/mars/serialize/dataserializer.py", line 259, in loads
return pickle.loads(data)
ModuleNotFoundError: No module named 'pyarrow'

# Fixed code
def create_pool(self, *args, **kwargs):
    # here we create necessary actors on worker
    # and distribute them over processes

    cuda_devices = [self.args.cuda_device] if self.args.cuda_device else None
    self._service = WorkerService(
        advertise_addr=self.args.advertise,
        n_cpu_process=self.args.cpu_procs,
        n_net_process=self.args.net_procs or self.args.io_procs,
        cuda_devices=cuda_devices,
        spill_dirs=self.args.spill_dir,
        io_parallel_num=self.args.io_parallel_num,
        total_mem=self.args.phy_mem,
        cache_mem_limit=self.args.cache_mem,
        ignore_avail_mem=self.args.ignore_avail_mem,
        min_mem_size=self.args.min_mem,
        disk_compression=self.args.disk_compression.lower(),
        transfer_compression=self.args.transfer_compression.lower(),
        plasma_dir=self.args.plasma_dir,
        use_ext_plasma_dir=bool(self.args.plasma_dir),
        disable_proc_recover=self.args.disable_proc_recover,
    )
    # start plasma
    self._service.start_plasma()

    self.n_process = self._service.n_process
    kwargs["distributor"] = MarsDistributor(self.n_process, "w:0:")
    return super().create_pool(*args, **kwargs)