Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

[BUG] Pymars failed to execute loc function when index is repeated. #16

Open
ChengjieLi28 opened this issue Sep 5, 2022 · 0 comments
Open

Comments

@ChengjieLi28
Copy link

Describe the bug
mars.DataFrame failed to execute loc function when its index has repeated indexing.

To Reproduce
To help us reproducing this bug, please provide information below:

  1. Your Python version: 3.9.12
  2. The version of Mars you use: 0.9.0
  3. Versions of crucial packages, such as numpy, scipy and pandas: follow pymars
  4. Full stack of the error.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/lichengjie/Projects/mars/mars/core/entity/tileables.py", line 462, in execute
    result = self.data.execute(session=session, **kw)
  File "/Users/lichengjie/Projects/mars/mars/core/entity/executable.py", line 144, in execute
    return execute(self, session=session, **kw)
  File "/Users/lichengjie/Projects/mars/mars/deploy/oscar/session.py", line 1890, in execute
    return session.execute(
  File "/Users/lichengjie/Projects/mars/mars/deploy/oscar/session.py", line 1684, in execute
    execution_info: ExecutionInfo = fut.result(
  File "/Users/lichengjie/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/Users/lichengjie/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/Users/lichengjie/Projects/mars/mars/deploy/oscar/session.py", line 1870, in _execute
    await execution_info
  File "/Users/lichengjie/Projects/mars/mars/deploy/oscar/session.py", line 105, in wait
    return await self._aio_task
  File "/Users/lichengjie/Projects/mars/mars/deploy/oscar/session.py", line 953, in _run_in_background
    raise task_result.error.with_traceback(task_result.traceback)
  File "/Users/lichengjie/Projects/mars/mars/services/task/supervisor/processor.py", line 369, in run
    await self._process_stage_chunk_graph(*stage_args)
  File "/Users/lichengjie/Projects/mars/mars/services/task/supervisor/processor.py", line 247, in _process_stage_chunk_graph
    chunk_to_result = await self._executor.execute_subtask_graph(
  File "/Users/lichengjie/Projects/mars/mars/services/task/execution/mars/executor.py", line 196, in execute_subtask_graph
    return await stage_processor.run()
  File "/Users/lichengjie/Projects/mars/mars/services/task/execution/mars/stage.py", line 240, in run
    raise self.result.error.with_traceback(self.result.traceback)
  File "/Users/lichengjie/Projects/mars/mars/services/scheduling/worker/execution.py", line 392, in internal_run_subtask
    subtask_info.result = await self._retry_run_subtask(
  File "/Users/lichengjie/Projects/mars/mars/services/scheduling/worker/execution.py", line 497, in _retry_run_subtask
    return await _retry_run(subtask, subtask_info, _run_subtask_once)
  File "/Users/lichengjie/Projects/mars/mars/services/scheduling/worker/execution.py", line 107, in _retry_run
    raise ex
  File "/Users/lichengjie/Projects/mars/mars/services/scheduling/worker/execution.py", line 69, in _retry_run
    return await target_async_func(*args)
  File "/Users/lichengjie/Projects/mars/mars/services/scheduling/worker/execution.py", line 439, in _run_subtask_once
    return await asyncio.shield(aiotask)
  File "/Users/lichengjie/Projects/mars/mars/services/subtask/api.py", line 68, in run_subtask_in_slot
    return await ref.run_subtask.options(profiling_context=profiling_context).send(
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/context.py", line 196, in send
    return self._process_result_message(result)
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/context.py", line 76, in _process_result_message
    raise message.as_instanceof_cause()
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/pool.py", line 586, in send
    result = await self._run_coro(message.message_id, coro)
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/pool.py", line 343, in _run_coro
    return await coro
  File "/Users/lichengjie/Projects/mars/mars/oscar/api.py", line 120, in __on_receive__
    return await super().__on_receive__(message)
  File "mars/oscar/core.pyx", line 523, in __on_receive__
  File "mars/oscar/core.pyx", line 516, in mars.oscar.core._BaseActor.__on_receive__
  File "mars/oscar/core.pyx", line 401, in _handle_actor_result
  File "mars/oscar/core.pyx", line 444, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "mars/oscar/core.pyx", line 445, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "mars/oscar/core.pyx", line 450, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "/Users/lichengjie/Projects/mars/mars/services/subtask/worker/runner.py", line 125, in run_subtask
    result = yield self._running_processor.run(subtask)
  File "mars/oscar/core.pyx", line 455, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "mars/oscar/core.pyx", line 375, in _handle_actor_result
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/context.py", line 196, in send
    return self._process_result_message(result)
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/context.py", line 76, in _process_result_message
    raise message.as_instanceof_cause()
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/pool.py", line 586, in send
    result = await self._run_coro(message.message_id, coro)
  File "/Users/lichengjie/Projects/mars/mars/oscar/backends/pool.py", line 343, in _run_coro
    return await coro
  File "/Users/lichengjie/Projects/mars/mars/oscar/api.py", line 120, in __on_receive__
    return await super().__on_receive__(message)
  File "mars/oscar/core.pyx", line 523, in __on_receive__
  File "mars/oscar/core.pyx", line 516, in mars.oscar.core._BaseActor.__on_receive__
  File "mars/oscar/core.pyx", line 401, in _handle_actor_result
  File "mars/oscar/core.pyx", line 444, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "mars/oscar/core.pyx", line 445, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "mars/oscar/core.pyx", line 450, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "/Users/lichengjie/Projects/mars/mars/services/subtask/worker/processor.py", line 638, in run
    result = yield self._running_aio_task
  File "mars/oscar/core.pyx", line 455, in mars.oscar.core._BaseActor._run_actor_async_generator
  File "mars/oscar/core.pyx", line 375, in _handle_actor_result
  File "/Users/lichengjie/Projects/mars/mars/services/subtask/worker/processor.py", line 483, in run
    ) = await self._store_data(chunk_graph)
  File "/Users/lichengjie/Projects/mars/mars/services/subtask/worker/processor.py", line 297, in _store_data
    for key, data, _ in iter_output_data(chunk_graph, self._processor_context):
  File "/Users/lichengjie/Projects/mars/mars/services/subtask/utils.py", line 68, in iter_output_data
    result_chunk.params = result_chunk.get_params_from_data(data)
  File "/Users/lichengjie/Projects/mars/mars/dataframe/core.py", line 1223, in get_params_from_data
    "dtype": data.dtype,
  File "/Users/lichengjie/miniconda3/lib/python3.9/site-packages/pandas/core/generic.py", line 5575, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: [address=127.0.0.1:54116, pid=21198] 'DataFrame' object has no attribute 'dtype'
  1. Minimized code to reproduce the error.
import mars.dataframe as md
df =  md.DataFrame([[1, 2], [1, 3], [2, 3], [2, 4], [2, 5]])
df.columns = ['A', 'B']
df.index = [0, 1, 2, 2, 4]
df.loc[2].execute()
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant