after_merge stringlengths 28 79.6k | before_merge stringlengths 20 79.6k | url stringlengths 38 71 | full_traceback stringlengths 43 922k | traceback_type stringclasses 555
values |
|---|---|---|---|---|
def get_tileable_nsplits(self, tileable, chunk_result=None):
chunk_idx_to_shape = OrderedDict()
tiled = get_tiled(tileable, mapping=tileable_optimized)
chunk_result = chunk_result if chunk_result is not None else self._chunk_result
for chunk in tiled.chunks:
chunk_idx_to_shape[chunk.index] = sel... | def get_tileable_nsplits(self, tileable, chunk_result=None):
chunk_idx_to_shape = OrderedDict()
tiled = get_tiled(tileable, mapping=tileable_optimized)
chunk_result = chunk_result if chunk_result is not None else self._chunk_result
for chunk in tiled.chunks:
chunk_idx_to_shape[chunk.index] = chu... | https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def operand_deserializer(value):
graph = DAG.from_json(value)
if len(graph) == 1:
chunks = [list(graph)[0]]
else:
chunks = [c for c in graph if not isinstance(c.op, Fetch)]
op = chunks[0].op
return _OperandWrapper(op, chunks)
| def operand_deserializer(value):
graph = DAG.from_json(value)
if len(graph) == 1:
chunks = [list(graph)[0]]
else:
chunks = [c for c in graph if not isinstance(c.op, Fetch)]
op = chunks[0].op
op._extra_params["outputs_ref"] = chunks
return op
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __init__(self):
self._store = dict()
| def __init__(self):
self._dict = dict()
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __getitem__(self, item):
meta: ChunkMeta = ray.get(self.meta_store.get_meta.remote(item))
return ray.get(meta.object_id)
| def __getitem__(self, item):
return ray.get(self.ray_dict_ref.getitem.remote(item))
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __setitem__(self, key, value):
object_id = ray.put(value)
shape = getattr(value, "shape", None)
meta = ChunkMeta(shape=shape, object_id=object_id)
set_meta = self.meta_store.set_meta.remote(key, meta)
ray.wait([object_id, set_meta])
| def __setitem__(self, key, value):
ray.get(self.ray_dict_ref.setitem.remote(key, value))
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def copy(self):
return RayStorage(meta_store=self.meta_store)
| def copy(self):
return RayStorage(ray_dict_ref=self.ray_dict_ref)
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def update(self, mapping: Dict):
tasks = []
for k, v in mapping.items():
object_id = ray.put(v)
tasks.append(object_id)
shape = getattr(v, "shape", None)
meta = ChunkMeta(shape=shape, object_id=object_id)
set_meta = self.meta_store.set_meta.remote(k, meta)
tasks.a... | def update(self, mapping):
self._dict.update(mapping)
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __iter__(self):
return iter(ray.get(self.meta_store.chunk_keys.remote()))
| def __iter__(self):
return iter(ray.get(self.ray_dict_ref.keys.remote()))
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __delitem__(self, key):
ray.wait([self.meta_store.delete_keys.remote(key)])
| def __delitem__(self, key):
ray.get(self.ray_dict_ref.delitem.remote(key))
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def handle(cls, op, results, mock=False):
method_name, mapper = (
("execute", cls._op_runners)
if not mock
else ("estimate_size", cls._op_size_estimators)
)
try:
runner = mapper[type(op)]
except KeyError:
runner = getattr(op, method_name)
# register a custom ... | def handle(cls, op, results, mock=False):
method_name, mapper = (
("execute", cls._op_runners)
if not mock
else ("estimate_size", cls._op_size_estimators)
)
try:
runner = mapper[type(op)]
except KeyError:
runner = getattr(op, method_name)
# register a custom ... | https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __init__(self, **kwargs):
# as we cannot serialize fuse chunk for now,
# we just disable numexpr for ray executor
engine = kwargs.pop("engine", ["numpy", "dataframe"])
if not ray.is_initialized():
ray.init(**kwargs)
self._session_id = uuid.uuid4()
self._executor = RayExecutor(engine=... | def __init__(self, **kwargs):
if not ray.is_initialized():
ray.init(**kwargs)
self._session_id = uuid.uuid4()
self._executor = RayExecutor(storage=RayStorage())
| https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def __init__(self, **kwargs):
engine = kwargs.pop("engine", None)
self._endpoint = None
self._session_id = uuid.uuid4()
self._context = LocalContext(self)
self._executor = Executor(engine=engine, storage=self._context)
self._mut_tensor = dict()
self._mut_tensor_data = dict()
if kwargs:... | def __init__(self, **kwargs):
self._endpoint = None
self._session_id = uuid.uuid4()
self._context = LocalContext(self)
self._executor = Executor(storage=self._context)
self._mut_tensor = dict()
self._mut_tensor_data = dict()
if kwargs:
unexpected_keys = ", ".join(list(kwargs.keys()... | https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def _init(self):
endpoint, kwargs = self._endpoint, self._kws
if self._backend is None:
if endpoint is not None:
if "http" in endpoint:
# connect to web
self._init_web_session(endpoint, **kwargs)
else:
# connect to local cluster
... | def _init(self):
endpoint, kwargs = self._endpoint, self._kws
if self._backend is None:
if endpoint is not None:
if "http" in endpoint:
# connect to web
self._init_web_session(endpoint, **kwargs)
else:
# connect to local cluster
... | https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def estimate_fuse_size(ctx, op):
from ...graph import DAG
from ...executor import Executor
from ...utils import build_fetch_chunk
chunk = op.outputs[0]
dag = DAG()
size_ctx = dict()
keys = set(c.key for c in chunk.composed)
for c in chunk.composed:
dag.add_node(c)
for in... | def estimate_fuse_size(ctx, op):
from ...graph import DAG
from ...executor import Executor
chunk = op.outputs[0]
dag = DAG()
size_ctx = dict()
keys = set(c.key for c in chunk.composed)
for c in chunk.composed:
dag.add_node(c)
for inp in c.inputs:
if inp.key not i... | https://github.com/mars-project/mars/issues/1542 | In [1]: from mars.session import new_session
In [2]: import mars.dataframe as md
In [3]: new_session(backend='ray').as_default()
2020-09-01 20:05:51,291 INFO resource_spec.py:231 -- Starting Ray with 5.08 GiB memory available for workers and up to 2.56 GiB for objects. You can adjust these settings with ray.init(memo... | TypeError |
def execute(cls, ctx, op):
def _base_concat(chunk, inputs):
# auto generated concat when executing a DataFrame, Series or Index
if chunk.op.output_types[0] == OutputType.dataframe:
return _auto_concat_dataframe_chunks(chunk, inputs)
elif chunk.op.output_types[0] == OutputType.ser... | def execute(cls, ctx, op):
def _base_concat(chunk, inputs):
# auto generated concat when executing a DataFrame, Series or Index
if chunk.op.output_types[0] == OutputType.dataframe:
return _auto_concat_dataframe_chunks(chunk, inputs)
elif chunk.op.output_types[0] == OutputType.ser... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _auto_concat_dataframe_chunks(chunk, inputs):
xdf = pd if isinstance(inputs[0], (pd.DataFrame, pd.Series)) else cudf
if chunk.op.axis is not None:
return xdf.concat(inputs, axis=op.axis)
# auto generated concat when executing a DataFrame
if len(inputs) == 1:
ret = inputs[0]
els... | def _auto_concat_dataframe_chunks(chunk, inputs):
if chunk.op.axis is not None:
return pd.concat(inputs, axis=op.axis)
# auto generated concat when executing a DataFrame
if len(inputs) == 1:
ret = inputs[0]
else:
max_rows = max(inp.index[0] for inp in chunk.inputs)
min_r... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _execute_without_count(cls, ctx, op, reduction_func=None):
# Execution for normal reduction operands.
# For dataframe, will keep dimensions for intermediate results.
xdf = cudf if op.gpu else pd
in_data = ctx[op.inputs[0].key]
r = cls._execute_reduction(
in_data, op, min_count=op.min_co... | def _execute_without_count(cls, ctx, op, reduction_func=None):
# Execution for normal reduction operands.
# For dataframe, will keep dimensions for intermediate results.
xdf = cudf if op.gpu else pd
in_data = ctx[op.inputs[0].key]
r = cls._execute_reduction(
in_data, op, min_count=op.min_co... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def allocate_top_resources(self, fetch_requests=False):
"""
Allocate resources given the order in AssignerActor
"""
t = time.time()
if self._worker_metrics is None or self._worker_metric_time + 1 < time.time():
# update worker metrics from ResourceActor
self._worker_metrics = self._r... | def allocate_top_resources(self, fetch_requests=False):
"""
Allocate resources given the order in AssignerActor
"""
t = time.time()
if self._worker_metrics is None or self._worker_metric_time + 1 < time.time():
# update worker metrics from ResourceActor
self._worker_metrics = self._r... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _on_ready(self):
self.worker = None
self._execution_ref = None
def _apply_fail(*exc_info):
if issubclass(exc_info[0], DependencyMissing):
logger.warning(
"DependencyMissing met, operand %s will be back to UNSCHEDULED.",
self._op_key,
)
... | def _on_ready(self):
self.worker = None
self._execution_ref = None
def _apply_fail(*exc_info):
if issubclass(exc_info[0], DependencyMissing):
logger.warning(
"DependencyMissing met, operand %s will be back to UNSCHEDULED.",
self._op_key,
)
... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _apply_fail(*exc_info):
if issubclass(exc_info[0], DependencyMissing):
logger.warning(
"DependencyMissing met, operand %s will be back to UNSCHEDULED.",
self._op_key,
)
self.worker = None
self.ref().start_operand(OperandState.UNSCHEDULED, _tell=True)
e... | def _apply_fail(*exc_info):
if issubclass(exc_info[0], DependencyMissing):
logger.warning(
"DependencyMissing met, operand %s will be back to UNSCHEDULED.",
self._op_key,
)
self.worker = None
self.ref().start_operand(OperandState.UNSCHEDULED, _tell=True)
e... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _on_running(self):
self._execution_ref = self._get_execution_ref()
# notify successors to propagate priority changes
for out_key in self._succ_keys:
self._get_operand_actor(out_key).add_running_predecessor(
self._op_key, self.worker, _tell=True, _wait=False
)
@log_unhan... | def _on_running(self):
self._execution_ref = self._get_execution_ref()
# notify successors to propagate priority changes
for out_key in self._succ_keys:
self._get_operand_actor(out_key).add_running_predecessor(
self._op_key, self.worker, _tell=True, _wait=False
)
@log_unhan... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _rejecter(*exc):
self._allocated = False
# handling exception occurrence of operand execution
exc_type = exc[0]
self._resource_ref.deallocate_resource(
self._session_id, self._op_key, self.worker, _tell=True, _wait=False
)
if self.state == OperandState.CANCELLING:
logger.war... | def _rejecter(*exc):
self._allocated = False
# handling exception occurrence of operand execution
exc_type = exc[0]
self._resource_ref.deallocate_resource(
self._session_id, self._op_key, self.worker, _tell=True, _wait=False
)
if self.state == OperandState.CANCELLING:
logger.war... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def run(self, *tileables, **kw):
with self.context:
if self._executor is None:
raise RuntimeError("Session has closed")
dest_gpu = all(tileable.op.gpu for tileable in tileables)
if dest_gpu:
self._executor._engine = "cupy"
else:
self._executor._eng... | def run(self, *tileables, **kw):
with self.context:
if self._executor is None:
raise RuntimeError("Session has closed")
dest_gpu = all(tileable.op.gpu for tileable in tileables)
if dest_gpu:
self._executor._engine = "cupy"
else:
self._executor._eng... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def lazy_import(name, package=None, globals=None, locals=None, rename=None):
rename = rename or name
prefix_name = name.split(".", 1)[0]
class LazyModule(object):
def __getattr__(self, item):
if item.startswith("_pytest") or item in ("__bases__", "__test__"):
raise Attri... | def lazy_import(name, package=None, globals=None, locals=None, rename=None):
rename = rename or name
prefix_name = name.split(".", 1)[0]
class LazyModule(object):
def __getattr__(self, item):
real_mod = importlib.import_module(name, package=package)
if globals is not None an... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def __getattr__(self, item):
if item.startswith("_pytest") or item in ("__bases__", "__test__"):
raise AttributeError(item)
real_mod = importlib.import_module(name, package=package)
if globals is not None and rename in globals:
globals[rename] = real_mod
elif locals is not None:
... | def __getattr__(self, item):
real_mod = importlib.import_module(name, package=package)
if globals is not None and rename in globals:
globals[rename] = real_mod
elif locals is not None:
locals[rename] = real_mod
return getattr(real_mod, item)
| https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _main(self):
if pyarrow is None:
self._serial_type = dataserializer.SerialType.PICKLE
else:
self._serial_type = dataserializer.SerialType(
options.client.serial_type.lower()
)
args = self._args.copy()
args["pyver"] = ".".join(str(v) for v in sys.version_info[:3])... | def _main(self):
try:
import pyarrow
self._serial_type = dataserializer.SerialType(
options.client.serial_type.lower()
)
except ImportError:
pyarrow = None
self._serial_type = dataserializer.SerialType.PICKLE
args = self._args.copy()
args["pyver"] = ... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def _calc_results(self, session_id, graph_key, graph, context_dict, chunk_targets):
_, op_name = concat_operand_keys(graph, "_")
logger.debug("Start calculating operand %s in %s.", graph_key, self.uid)
start_time = time.time()
for chunk in graph:
for inp, prepare_inp in zip(chunk.inputs, chunk... | def _calc_results(self, session_id, graph_key, graph, context_dict, chunk_targets):
_, op_name = concat_operand_keys(graph, "_")
logger.debug("Start calculating operand %s in %s.", graph_key, self.uid)
start_time = time.time()
for chunk in graph:
for inp, prepare_inp in zip(chunk.inputs, chunk... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def start_plasma(self):
from pyarrow import plasma
self._plasma_store = plasma.start_plasma_store(
self._cache_mem_limit, plasma_directory=self._plasma_dir
)
options.worker.plasma_socket, _ = self._plasma_store.__enter__()
| def start_plasma(self):
self._plasma_store = plasma.start_plasma_store(
self._cache_mem_limit, plasma_directory=self._plasma_dir
)
options.worker.plasma_socket, _ = self._plasma_store.__enter__()
| https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def get_actual_capacity(self, store_limit):
"""
Get actual capacity of plasma store
:return: actual storage size in bytes
"""
try:
store_limit = min(store_limit, self._plasma_client.store_capacity())
except AttributeError: # pragma: no cover
pass
if self._size_limit is None... | def get_actual_capacity(self, store_limit):
"""
Get actual capacity of plasma store
:return: actual storage size in bytes
"""
try:
store_limit = min(store_limit, self._plasma_client.store_capacity())
except AttributeError: # pragma: no cover
pass
if self._size_limit is None... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def create(self, session_id, data_key, size):
obj_id = self._new_object_id(session_id, data_key)
try:
self._plasma_client.evict(size)
buffer = self._plasma_client.create(obj_id, size)
return buffer
except plasma_errors.PlasmaStoreFull:
exc_type = plasma_errors.PlasmaStoreFull... | def create(self, session_id, data_key, size):
obj_id = self._new_object_id(session_id, data_key)
try:
self._plasma_client.evict(size)
buffer = self._plasma_client.create(obj_id, size)
return buffer
except PlasmaStoreFull:
exc_type = PlasmaStoreFull
self._mapper_ref.de... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def seal(self, session_id, data_key):
obj_id = self._get_object_id(session_id, data_key)
try:
self._plasma_client.seal(obj_id)
except plasma_errors.PlasmaObjectNotFound:
self._mapper_ref.delete(session_id, data_key)
raise KeyError((session_id, data_key))
| def seal(self, session_id, data_key):
obj_id = self._get_object_id(session_id, data_key)
try:
self._plasma_client.seal(obj_id)
except PlasmaObjectNotFound:
self._mapper_ref.delete(session_id, data_key)
raise KeyError((session_id, data_key))
| https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def put(self, session_id, data_key, value):
"""
Put a Mars object into plasma store
:param session_id: session id
:param data_key: chunk key
:param value: Mars object to be put
"""
data_size = None
try:
obj_id = self._new_object_id(session_id, data_key)
except StorageDataExi... | def put(self, session_id, data_key, value):
"""
Put a Mars object into plasma store
:param session_id: session id
:param data_key: chunk key
:param value: Mars object to be put
"""
data_size = None
try:
obj_id = self._new_object_id(session_id, data_key)
except StorageDataExi... | https://github.com/mars-project/mars/issues/1533 | AttributeError Traceback (most recent call last)
<ipython-input-3-a85925f048d0> in <module>
1 start=time.time()
2 df_mars=df_mars.to_gpu()
----> 3 print(df_mars.sum().to_frame(name="sum").execute())
/opt/conda/envs/rapids/lib/python3.6/site-packages/mars/core.py in execute(self, session, **k... | AttributeError |
def __init__(self, values, dtype: ArrowDtype = None, copy=False):
pandas_only = self._pandas_only()
if pa is not None and not pandas_only:
self._init_by_arrow(values, dtype=dtype, copy=copy)
elif not is_kernel_mode():
# not in kernel mode, allow to use numpy handle data
# just for i... | def __init__(self, values, dtype: ArrowDtype = None, copy=False):
if isinstance(values, (pd.Index, pd.Series)):
# for pandas Index and Series,
# convert to PandasArray
values = values.array
if isinstance(values, type(self)):
arrow_array = values._arrow_array
elif isinstance(... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __repr__(self):
return f"{type(self).__name__}({repr(self._array)})"
| def __repr__(self):
return f"{type(self).__name__}({repr(self._arrow_array)})"
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def nbytes(self) -> int:
if self._use_arrow:
return sum(
x.size
for chunk in self._arrow_array.chunks
for x in chunk.buffers()
if x is not None
)
else:
return self._ndarray.nbytes
| def nbytes(self) -> int:
return sum(
x.size
for chunk in self._arrow_array.chunks
for x in chunk.buffers()
if x is not None
)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def shape(self):
if self._use_arrow:
return (self._arrow_array.length(),)
else:
return self._ndarray.shape
| def shape(self):
return (self._arrow_array.length(),)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def memory_usage(self, deep=True) -> int:
if self._use_arrow:
return self.nbytes
else:
return pd.Series(self._ndarray).memory_usage(index=False, deep=deep)
| def memory_usage(self, deep=True) -> int:
return self.nbytes
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _from_sequence(cls, scalars, dtype=None, copy=False):
if pa is None or cls._pandas_only():
# pyarrow not installed, just return numpy
ret = np.empty(len(scalars), dtype=object)
ret[:] = scalars
return cls(ret)
if pa_null is not None and isinstance(scalars, type(pa_null)):
... | def _from_sequence(cls, scalars, dtype=None, copy=False):
if not hasattr(scalars, "dtype"):
ret = np.empty(len(scalars), dtype=object)
for i, s in enumerate(scalars):
ret[i] = s
scalars = ret
if isinstance(scalars, cls):
if copy:
scalars = scalars.copy()
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __getitem__(self, item):
cls = type(self)
if pa is None or self._force_use_pandas:
# pyarrow not installed
result = self._ndarray[item]
if pd.api.types.is_scalar(item):
return result
else:
return type(self)(result)
has_take = hasattr(self._arrow_... | def __getitem__(self, item):
cls = type(self)
has_take = hasattr(self._arrow_array, "take")
if not self._force_use_pandas and has_take:
if pd.api.types.is_scalar(item):
item = item + len(self) if item < 0 else item
return self._post_scalar_getitem(self._arrow_array.take([item... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _concat_same_type(cls, to_concat: Sequence["ArrowArray"]) -> "ArrowArray":
if pa is None or cls._pandas_only():
# pyarrow not installed
return cls(np.concatenate([x._array for x in to_concat]))
chunks = list(
itertools.chain.from_iterable(x._arrow_array.chunks for x in to_concat)
... | def _concat_same_type(cls, to_concat: Sequence["ArrowArray"]) -> "ArrowArray":
chunks = list(
itertools.chain.from_iterable(x._arrow_array.chunks for x in to_concat)
)
if len(chunks) == 0:
chunks = [pa.array([], type=to_concat[0].dtype.arrow_type)]
return cls(pa.chunked_array(chunks))
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __len__(self):
return len(self._array)
| def __len__(self):
return len(self._arrow_array)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def to_numpy(self, dtype=None, copy=False, na_value=lib.no_default):
if self._use_arrow:
array = np.asarray(self._arrow_array.to_pandas())
else:
array = self._ndarray
if copy or na_value is not lib.no_default:
array = array.copy()
if na_value is not lib.no_default:
array[... | def to_numpy(self, dtype=None, copy=False, na_value=lib.no_default):
array = np.asarray(self._arrow_array.to_pandas())
if copy or na_value is not lib.no_default:
array = array.copy()
if na_value is not lib.no_default:
array[self.isna()] = na_value
return array
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def fillna(self, value=None, method=None, limit=None):
cls = type(self)
if pa is None or self._force_use_pandas:
# pyarrow not installed
return cls(
pd.Series(self.to_numpy()).fillna(value=value, method=method, limit=limit)
)
chunks = []
for chunk_array in self._arr... | def fillna(self, value=None, method=None, limit=None):
chunks = []
for chunk_array in self._arrow_array.chunks:
array = chunk_array.to_pandas()
if method is None:
result_array = self._array_fillna(array, value)
else:
result_array = array.fillna(value=value, method... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def astype(self, dtype, copy=True):
dtype = pandas_dtype(dtype)
if isinstance(dtype, ArrowStringDtype):
if copy:
return self.copy()
return self
if pa is None or self._force_use_pandas:
# pyarrow not installed
if isinstance(dtype, ArrowDtype):
dtype = ... | def astype(self, dtype, copy=True):
dtype = pandas_dtype(dtype)
if isinstance(dtype, ArrowStringDtype):
if copy:
return self.copy()
return self
# try to slice 1 record to get the result dtype
test_array = self._arrow_array.slice(0, 1).to_pandas()
test_result_array = test... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def isna(self):
if (
not self._force_use_pandas
and self._use_arrow
and hasattr(self._arrow_array, "is_null")
):
return self._arrow_array.is_null().to_pandas().to_numpy()
elif self._use_arrow:
return pd.isna(self._arrow_array.to_pandas()).to_numpy()
else:
... | def isna(self):
if not self._force_use_pandas and hasattr(self._arrow_array, "is_null"):
return self._arrow_array.is_null().to_pandas().to_numpy()
else:
return pd.isna(self._arrow_array.to_pandas()).to_numpy()
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def take(self, indices, allow_fill=False, fill_value=None):
if (
allow_fill is False or (allow_fill and fill_value is self.dtype.na_value)
) and len(self) > 0:
return type(self)(self[indices], dtype=self._dtype)
if self._use_arrow:
array = self._arrow_array.to_pandas().to_numpy()
... | def take(self, indices, allow_fill=False, fill_value=None):
if allow_fill is False or (allow_fill and fill_value is self.dtype.na_value):
return type(self)(self[indices], dtype=self._dtype)
array = self._arrow_array.to_pandas().to_numpy()
replace = False
if allow_fill and fill_value is None:
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def copy(self):
if self._use_arrow:
return type(self)(copy_obj(self._arrow_array))
else:
return type(self)(self._ndarray.copy())
| def copy(self):
return type(self)(copy_obj(self._arrow_array))
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def value_counts(self, dropna=False):
if self._use_arrow:
series = self._arrow_array.to_pandas()
else:
series = pd.Series(self._ndarray)
return type(self)(series.value_counts(dropna=dropna), dtype=self._dtype)
| def value_counts(self, dropna=False):
series = self._arrow_array.to_pandas()
return type(self)(series.value_counts(dropna=dropna), dtype=self._dtype)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __mars_tokenize__(self):
if self._use_arrow:
return [
memoryview(x)
for chunk in self._arrow_array.chunks
for x in chunk.buffers()
if x is not None
]
else:
return self._ndarray
| def __mars_tokenize__(self):
return [
memoryview(x)
for chunk in self._arrow_array.chunks
for x in chunk.buffers()
if x is not None
]
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def from_scalars(cls, values):
if pa is None or cls._pandas_only():
return cls._from_sequence(values)
else:
arrow_array = pa.chunked_array([cls._to_arrow_array(values)])
return cls(arrow_array)
| def from_scalars(cls, values):
arrow_array = pa.chunked_array([cls._to_arrow_array(values)])
return cls(arrow_array)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __setitem__(self, key, value):
if isinstance(value, (pd.Index, pd.Series)):
value = value.to_numpy()
if isinstance(value, type(self)):
value = value.to_numpy()
key = check_array_indexer(self, key)
scalar_key = is_scalar(key)
scalar_value = is_scalar(value)
if scalar_key and ... | def __setitem__(self, key, value):
if isinstance(value, (pd.Index, pd.Series)):
value = value.to_numpy()
if isinstance(value, type(self)):
value = value.to_numpy()
key = check_array_indexer(self, key)
scalar_key = is_scalar(key)
scalar_value = is_scalar(value)
if scalar_key and ... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _create_arithmetic_method(cls, op):
# Note: this handles both arithmetic and comparison methods.
def method(self, other):
is_arithmetic = True if op.__name__ in ops.ARITHMETIC_BINOPS else False
pandas_only = cls._pandas_only()
is_other_array = False
if not is_scalar(other):
... | def _create_arithmetic_method(cls, op):
# Note: this handles both arithmetic and comparison methods.
def method(self, other):
is_arithmetic = True if op.__name__ in ops.ARITHMETIC_BINOPS else False
is_other_array = False
if not is_scalar(other):
is_other_array = True
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def method(self, other):
is_arithmetic = True if op.__name__ in ops.ARITHMETIC_BINOPS else False
pandas_only = cls._pandas_only()
is_other_array = False
if not is_scalar(other):
is_other_array = True
other = np.asarray(other)
self_is_na = self.isna()
other_is_na = pd.isna(other... | def method(self, other):
is_arithmetic = True if op.__name__ in ops.ARITHMETIC_BINOPS else False
is_other_array = False
if not is_scalar(other):
is_other_array = True
other = np.asarray(other)
self_is_na = self.isna()
other_is_na = pd.isna(other)
mask = self_is_na | other_is_na... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __init__(self, values, dtype: ArrowListDtype = None, copy=False):
if dtype is None:
if isinstance(values, type(self)):
dtype = values.dtype
elif pa is not None:
if isinstance(values, pa.Array):
dtype = ArrowListDtype(values.type.value_type)
eli... | def __init__(self, values, dtype: ArrowListDtype = None, copy=False):
if dtype is None:
if isinstance(values, type(self)):
dtype = values.dtype
elif isinstance(values, pa.Array):
dtype = ArrowListDtype(values.type.value_type)
elif isinstance(values, pa.ChunkedArray):
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def to_numpy(self, dtype=None, copy=False, na_value=lib.no_default):
if self._use_arrow:
s = self._arrow_array.to_pandas()
else:
s = pd.Series(self._ndarray)
s = s.map(lambda x: x.tolist() if hasattr(x, "tolist") else x)
if copy or na_value is not lib.no_default:
s = s.copy()
... | def to_numpy(self, dtype=None, copy=False, na_value=lib.no_default):
s = self._arrow_array.to_pandas().map(lambda x: x.tolist() if x is not None else x)
if copy or na_value is not lib.no_default:
s = s.copy()
if na_value is not lib.no_default:
s[self.isna()] = na_value
return np.asarray(... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __setitem__(self, key, value):
if isinstance(value, (pd.Index, pd.Series)):
value = value.to_numpy()
key = check_array_indexer(self, key)
scalar_key = is_scalar(key)
# validate new items
if scalar_key:
if pd.isna(value):
value = None
elif not is_list_like(va... | def __setitem__(self, key, value):
if isinstance(value, (pd.Index, pd.Series)):
value = value.to_numpy()
key = check_array_indexer(self, key)
scalar_key = is_scalar(key)
# validate new items
if scalar_key:
if pd.isna(value):
value = None
elif not is_list_like(va... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def astype(self, dtype, copy=True):
msg = f"cannot astype from {self.dtype} to {dtype}"
dtype = pandas_dtype(dtype)
if isinstance(dtype, ArrowListDtype):
if self.dtype == dtype:
if copy:
return self.copy()
return self
else:
if self._use_arr... | def astype(self, dtype, copy=True):
msg = f"cannot astype from {self.dtype} to {dtype}"
dtype = pandas_dtype(dtype)
if isinstance(dtype, ArrowListDtype):
if self.dtype == dtype:
if copy:
return self.copy()
return self
else:
try:
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _infer_df_func_returns(self, df, dtypes, index):
if isinstance(self._func, np.ufunc):
output_type, new_dtypes, index_value, new_elementwise = (
OutputType.dataframe,
None,
"inherit",
True,
)
else:
output_type, new_dtypes, index_value, n... | def _infer_df_func_returns(self, in_dtypes, dtypes, index):
if isinstance(self._func, np.ufunc):
output_type, new_dtypes, index_value, new_elementwise = (
OutputType.dataframe,
None,
"inherit",
True,
)
else:
output_type, new_dtypes, index_v... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _infer_series_func_returns(self, df):
try:
empty_series = build_series(df, size=2, name=df.name)
with np.errstate(all="ignore"):
infer_series = empty_series.apply(self._func, args=self.args, **self.kwds)
new_dtype = infer_series.dtype
name = infer_series.name
exce... | def _infer_series_func_returns(self, in_dtype):
try:
empty_series = build_empty_series(in_dtype, index=pd.RangeIndex(2))
with np.errstate(all="ignore"):
infer_series = empty_series.apply(self._func, args=self.args, **self.kwds)
new_dtype = infer_series.dtype
except: # noqa: ... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _call_dataframe(self, df, dtypes=None, index=None):
dtypes, index_value = self._infer_df_func_returns(df, dtypes, index)
for arg, desc in zip(
(self.output_types, dtypes, index_value), ("output_types", "dtypes", "index")
):
if arg is None:
raise TypeError(
f"C... | def _call_dataframe(self, df, dtypes=None, index=None):
dtypes, index_value = self._infer_df_func_returns(df.dtypes, dtypes, index)
for arg, desc in zip(
(self.output_types, dtypes, index_value), ("output_types", "dtypes", "index")
):
if arg is None:
raise TypeError(
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _call_series(self, series):
if self._convert_dtype:
dtype, name = self._infer_series_func_returns(series)
else:
dtype, name = np.dtype("object"), None
return self.new_series(
[series],
dtype=dtype,
shape=series.shape,
index_value=series.index_value,
... | def _call_series(self, series):
if self._convert_dtype:
dtype = self._infer_series_func_returns(series.dtype)
else:
dtype = np.dtype("object")
return self.new_series(
[series], dtype=dtype, shape=series.shape, index_value=series.index_value
)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _infer_df_func_returns(self, df, dtypes):
if self.output_types[0] == OutputType.dataframe:
test_df = build_df(df, fill_value=1, size=2)
try:
with np.errstate(all="ignore"):
if self.call_agg:
infer_df = test_df.agg(
self._fun... | def _infer_df_func_returns(self, in_dtypes, dtypes):
if self.output_types[0] == OutputType.dataframe:
empty_df = build_empty_df(in_dtypes, index=pd.RangeIndex(2))
try:
with np.errstate(all="ignore"):
if self.call_agg:
infer_df = empty_df.agg(
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __call__(self, df, dtypes=None, index=None):
axis = getattr(self, "axis", None) or 0
self._axis = validate_axis(axis, df)
dtypes = self._infer_df_func_returns(df, dtypes)
for arg, desc in zip((self.output_types, dtypes), ("output_types", "dtypes")):
if arg is None:
raise TypeEr... | def __call__(self, df, dtypes=None, index=None):
axis = getattr(self, "axis", None) or 0
self._axis = validate_axis(axis, df)
if self.output_types[0] == OutputType.dataframe:
dtypes = self._infer_df_func_returns(df.dtypes, dtypes)
else:
dtypes = self._infer_df_func_returns((df.name, df.... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def to_pandas(self):
data = getattr(self, "_data", None)
if data is None:
sortorder = getattr(self, "_sortorder", None)
return pd.MultiIndex.from_arrays(
[np.array([], dtype=dtype) for dtype in self._dtypes],
sortorder=sortorder,
names=self._names,
)
... | def to_pandas(self):
data = getattr(self, "_data", None)
if data is None:
sortorder = getattr(self, "_sortorder", None)
return pd.MultiIndex.from_arrays(
[[] for _ in range(len(self._names))],
sortorder=sortorder,
names=self._names,
)
return pd.Mul... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _infer_df_func_returns(self, in_groupby, in_df, dtypes, index):
index_value, output_type, new_dtypes = None, None, None
try:
if in_df.op.output_types[0] == OutputType.dataframe:
test_df = build_df(in_df, size=2)
else:
test_df = build_series(in_df, size=2, name=in_df.... | def _infer_df_func_returns(self, in_groupby, in_df, dtypes, index):
index_value, output_type, new_dtypes = None, None, None
try:
if in_df.op.output_types[0] == OutputType.dataframe:
empty_df = build_empty_df(in_df.dtypes, index=pd.RangeIndex(2))
else:
empty_df = build_em... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def build_mock_groupby(self, **kwargs):
in_df = self.inputs[0]
if self.is_dataframe_obj:
empty_df = build_df(in_df, size=2)
obj_dtypes = in_df.dtypes[in_df.dtypes == np.dtype("O")]
empty_df[obj_dtypes.index] = "O"
else:
if in_df.dtype == np.dtype("O"):
empty_df = ... | def build_mock_groupby(self, **kwargs):
in_df = self.inputs[0]
if self.is_dataframe_obj:
empty_df = build_empty_df(in_df.dtypes, index=pd.RangeIndex(2))
obj_dtypes = in_df.dtypes[in_df.dtypes == np.dtype("O")]
empty_df[obj_dtypes.index] = "O"
else:
if in_df.dtype == np.dtype(... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _calc_renamed_df(self, df, errors="ignore"):
empty_df = build_df(df)
return empty_df.rename(
columns=self._columns_mapper,
index=self._index_mapper,
level=self._level,
errors=errors,
)
| def _calc_renamed_df(self, dtypes, index, errors="ignore"):
empty_df = build_empty_df(dtypes, index=index)
return empty_df.rename(
columns=self._columns_mapper,
index=self._index_mapper,
level=self._level,
errors=errors,
)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _calc_renamed_series(self, df, errors="ignore"):
empty_series = build_series(df, name=df.name)
new_series = empty_series.rename(
index=self._index_mapper, level=self._level, errors=errors
)
if self._new_name:
new_series.name = self._new_name
return new_series
| def _calc_renamed_series(self, name, dtype, index, errors="ignore"):
empty_series = build_empty_series(dtype, index=index, name=name)
new_series = empty_series.rename(
index=self._index_mapper, level=self._level, errors=errors
)
if self._new_name:
new_series.name = self._new_name
ret... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __call__(self, df):
params = df.params
raw_index = df.index_value.to_pandas()
if df.ndim == 2:
new_df = self._calc_renamed_df(df, errors=self.errors)
new_index = new_df.index
elif isinstance(df, SERIES_TYPE):
new_df = self._calc_renamed_series(df, errors=self.errors)
... | def __call__(self, df):
params = df.params
raw_index = df.index_value.to_pandas()
if df.ndim == 2:
new_df = self._calc_renamed_df(df.dtypes, raw_index, errors=self.errors)
new_index = new_df.index
elif isinstance(df, SERIES_TYPE):
new_df = self._calc_renamed_series(
d... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def tile(cls, op: "DataFrameRename"):
inp = op.inputs[0]
out = op.outputs[0]
chunks = []
dtypes_cache = dict()
for c in inp.chunks:
params = c.params
new_op = op.copy().reset_key()
if op.columns_mapper is not None:
try:
new_dtypes = dtypes_cache[... | def tile(cls, op: "DataFrameRename"):
inp = op.inputs[0]
out = op.outputs[0]
chunks = []
dtypes_cache = dict()
for c in inp.chunks:
params = c.params
new_op = op.copy().reset_key()
if op.columns_mapper is not None:
try:
new_dtypes = dtypes_cache[... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _calc_result_shape(self, df):
if self.output_types[0] == OutputType.dataframe:
test_obj = build_df(df, size=10)
else:
test_obj = build_series(df, size=10, name=df.name)
result_df = test_obj.agg(self.func, axis=self.axis)
if isinstance(result_df, pd.DataFrame):
self.output_t... | def _calc_result_shape(self, df):
if self.output_types[0] == OutputType.dataframe:
empty_obj = build_empty_df(df.dtypes, index=pd.RangeIndex(0, 10))
else:
empty_obj = build_empty_series(
df.dtype, index=pd.RangeIndex(0, 10), name=df.name
)
result_df = empty_obj.agg(self.... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def parse_index(index_value, *args, store_data=False, key=None):
from .core import IndexValue
def _extract_property(index, tp, ret_data):
kw = {
"_min_val": _get_index_min(index),
"_max_val": _get_index_max(index),
"_min_val_close": True,
"_max_val_close"... | def parse_index(index_value, *args, store_data=False, key=None):
from .core import IndexValue
def _extract_property(index, tp, ret_data):
kw = {
"_min_val": _get_index_min(index),
"_max_val": _get_index_max(index),
"_min_val_close": True,
"_max_val_close"... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _serialize_multi_index(index):
kw = _extract_property(index, IndexValue.MultiIndex, store_data)
kw["_sortorder"] = index.sortorder
kw["_dtypes"] = [lev.dtype for lev in index.levels]
return IndexValue.MultiIndex(**kw)
| def _serialize_multi_index(index):
kw = _extract_property(index, IndexValue.MultiIndex, store_data)
kw["_sortorder"] = index.sortorder
return IndexValue.MultiIndex(**kw)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def _generate_value(dtype, fill_value):
# special handle for datetime64 and timedelta64
dispatch = {
np.datetime64: pd.Timestamp,
np.timedelta64: pd.Timedelta,
pd.CategoricalDtype.type: lambda x: pd.CategoricalDtype([x]),
# for object, we do not know the actual dtype,
# j... | def _generate_value(dtype, fill_value):
# special handle for datetime64 and timedelta64
dispatch = {
np.datetime64: pd.Timestamp,
np.timedelta64: pd.Timedelta,
}
# otherwise, just use dtype.type itself to convert
convert = dispatch.get(dtype.type, dtype.type)
return convert(fill_... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def build_empty_df(dtypes, index=None):
columns = dtypes.index
# duplicate column may exist,
# so use RangeIndex first
df = pd.DataFrame(columns=pd.RangeIndex(len(columns)), index=index)
length = len(index) if index is not None else 0
for i, d in enumerate(dtypes):
df[i] = pd.Series(
... | def build_empty_df(dtypes, index=None):
columns = dtypes.index
# duplicate column may exist,
# so use RangeIndex first
df = pd.DataFrame(columns=pd.RangeIndex(len(columns)), index=index)
for i, d in enumerate(dtypes):
df[i] = pd.Series(dtype=d, index=index)
df.columns = columns
retur... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def build_df(df_obj, fill_value=1, size=1):
empty_df = build_empty_df(df_obj.dtypes, index=df_obj.index_value.to_pandas()[:0])
dtypes = empty_df.dtypes
record = [_generate_value(dtype, fill_value) for dtype in dtypes]
if isinstance(empty_df.index, pd.MultiIndex):
index = tuple(
_gene... | def build_df(df_obj, fill_value=1, size=1):
empty_df = build_empty_df(df_obj.dtypes, index=df_obj.index_value.to_pandas()[:0])
dtypes = empty_df.dtypes
record = [_generate_value(dtype, fill_value) for dtype in empty_df.dtypes]
if isinstance(empty_df.index, pd.MultiIndex):
index = tuple(
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def build_empty_series(dtype, index=None, name=None):
length = len(index) if index is not None else 0
return pd.Series(
[_generate_value(dtype, 1) for _ in range(length)],
dtype=dtype,
index=index,
name=name,
)
| def build_empty_series(dtype, index=None, name=None):
return pd.Series(dtype=dtype, index=index, name=name)
| https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def build_series(series_obj, fill_value=1, size=1, name=None):
empty_series = build_empty_series(
series_obj.dtype, name=name, index=series_obj.index_value.to_pandas()[:0]
)
record = _generate_value(series_obj.dtype, fill_value)
if isinstance(empty_series.index, pd.MultiIndex):
index = t... | def build_series(series_obj, fill_value=1, size=1):
empty_series = build_empty_series(
series_obj.dtype, index=series_obj.index_value.to_pandas()[:0]
)
record = _generate_value(series_obj.dtype, fill_value)
if isinstance(empty_series.index, pd.MultiIndex):
index = tuple(
_gen... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __call__(self, expanding):
inp = expanding.input
raw_func = self.func
self._normalize_funcs()
if isinstance(inp, DATAFRAME_TYPE):
empty_df = build_df(inp)
for c, t in empty_df.dtypes.items():
if t == np.dtype("O"):
empty_df[c] = "O"
test_df = exp... | def __call__(self, expanding):
inp = expanding.input
raw_func = self.func
self._normalize_funcs()
if isinstance(inp, DATAFRAME_TYPE):
pd_index = inp.index_value.to_pandas()
empty_df = build_empty_df(inp.dtypes, index=pd_index[:1])
for c, t in empty_df.dtypes.items():
... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __new__(mcs, name, bases, kv):
if "__call__" in kv:
# if __call__ is specified for an operand,
# make sure that entering user space
kv["__call__"] = enter_mode(kernel=False)(kv["__call__"])
cls = super().__new__(mcs, name, bases, kv)
for base in bases:
if OP_TYPE_KEY no... | def __new__(mcs, name, bases, kv):
cls = super().__new__(mcs, name, bases, kv)
for base in bases:
if OP_TYPE_KEY not in kv and hasattr(base, OP_TYPE_KEY):
kv[OP_TYPE_KEY] = getattr(base, OP_TYPE_KEY)
if OP_MODULE_KEY not in kv and hasattr(base, OP_MODULE_KEY):
kv[OP_MODU... | https://github.com/mars-project/mars/issues/1514 | In [1]: import mars.dataframe as md
In [2]: df = md.DataFrame({'a': [1, 2, 3], 'b': ['a', 'b', 'c']})
In [3]: df['b'] = df['b'].astype(md.ArrowStringDtype())
In [6]: df.groupby('b').count()
---------------------------------------------------------------------------
TypeError Traceback... | TypeError |
def __init__(self, discoverer, distributed=True):
if isinstance(discoverer, list):
discoverer = StaticSchedulerDiscoverer(discoverer)
self._discoverer = discoverer
self._distributed = distributed
self._hash_ring = None
self._watcher = None
self._schedulers = []
self._observer_refs =... | def __init__(self, discoverer, distributed=True):
if isinstance(discoverer, list):
discoverer = StaticSchedulerDiscoverer(discoverer)
self._discoverer = discoverer
self._distributed = distributed
self._hash_ring = None
self._watcher = None
self._schedulers = []
self._observer_refs =... | https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def register_observer(self, observer, fun_name):
self._observer_refs[(observer.uid, observer.address)] = (
self.ctx.actor_ref(observer),
fun_name,
)
| def register_observer(self, observer, fun_name):
self._observer_refs.append((self.ctx.actor_ref(observer), fun_name))
| https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def set_schedulers(self, schedulers):
logger.debug("Setting schedulers %r", schedulers)
self._schedulers = schedulers
self._hash_ring = create_hash_ring(self._schedulers)
for observer_ref, fun_name in self._observer_refs.values():
# notify the observers to update the new scheduler list
... | def set_schedulers(self, schedulers):
logger.debug("Setting schedulers %r", schedulers)
self._schedulers = schedulers
self._hash_ring = create_hash_ring(self._schedulers)
for observer_ref, fun_name in self._observer_refs:
# notify the observers to update the new scheduler list
getattr(o... | https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def take(self, indices, allow_fill=False, fill_value=None):
if allow_fill is False or (allow_fill and fill_value is self.dtype.na_value):
return type(self)(self[indices], dtype=self._dtype)
array = self._arrow_array.to_pandas().to_numpy()
replace = False
if allow_fill and fill_value is None:
... | def take(self, indices, allow_fill=False, fill_value=None):
if allow_fill is False:
return type(self)(self[indices], dtype=self._dtype)
array = self._arrow_array.to_pandas().to_numpy()
replace = False
if allow_fill and fill_value is None:
fill_value = self.dtype.na_value
replac... | https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def pre_destroy(self):
self._actual_ref.destroy()
self.unset_cluster_info_ref()
| def pre_destroy(self):
self._actual_ref.destroy()
| https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def pre_destroy(self):
super().pre_destroy()
self.unset_cluster_info_ref()
self._graph_meta_ref.destroy()
| def pre_destroy(self):
super().pre_destroy()
self._graph_meta_ref.destroy()
| https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def pre_destroy(self):
self._heartbeat_ref.destroy()
self.unset_cluster_info_ref()
super().pre_destroy()
| def pre_destroy(self):
self._heartbeat_ref.destroy()
super().pre_destroy()
| https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def pre_destroy(self):
super().pre_destroy()
self.unset_cluster_info_ref()
self._manager_ref.delete_session(self._session_id, _tell=True)
self.ctx.destroy_actor(self._assigner_ref)
for graph_ref in self._graph_refs.values():
self.ctx.destroy_actor(graph_ref)
for mut_tensor_ref in self._... | def pre_destroy(self):
super().pre_destroy()
self._manager_ref.delete_session(self._session_id, _tell=True)
self.ctx.destroy_actor(self._assigner_ref)
for graph_ref in self._graph_refs.values():
self.ctx.destroy_actor(graph_ref)
for mut_tensor_ref in self._mut_tensor_refs.values():
s... | https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def post_create(self):
super().post_create()
from .status import StatusActor
self._status_ref = self.ctx.actor_ref(StatusActor.default_uid())
if not self.ctx.has_actor(self._status_ref):
self._status_ref = None
| def post_create(self):
super().post_create()
try:
self.set_cluster_info_ref()
except ActorNotExist:
pass
from .status import StatusActor
self._status_ref = self.ctx.actor_ref(StatusActor.default_uid())
if not self.ctx.has_actor(self._status_ref):
self._status_ref = None... | https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def post_create(self):
from .daemon import WorkerDaemonActor
from .dispatcher import DispatchActor
from .quota import MemQuotaActor
from .status import StatusActor
super().post_create()
self._dispatch_ref = self.promise_ref(DispatchActor.default_uid())
self._mem_quota_ref = self.promise_re... | def post_create(self):
from .daemon import WorkerDaemonActor
from .dispatcher import DispatchActor
from .quota import MemQuotaActor
from .status import StatusActor
super().post_create()
self.set_cluster_info_ref()
self._dispatch_ref = self.promise_ref(DispatchActor.default_uid())
self.... | https://github.com/mars-project/mars/issues/1524 | Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "mars/actors/pool/gevent_pool.pyx", line 70, in mars.actors.pool.gevent_pool.MessageContext.result
cpdef result(self):
File "mars/actors/pool/gevent_pool.pyx", line 71, in mars.actors.pool.gevent_po... | mars.actors.errors.ActorNotExist |
def decide_dataframe_chunk_sizes(shape, chunk_size, memory_usage):
"""
Decide how a given DataFrame can be split into chunk.
:param shape: DataFrame's shape
:param chunk_size: if dict provided, it's dimension id to chunk size;
if provided, it's the chunk size for each dimension.
... | def decide_dataframe_chunk_sizes(shape, chunk_size, memory_usage):
"""
Decide how a given DataFrame can be split into chunk.
:param shape: DataFrame's shape
:param chunk_size: if dict provided, it's dimension id to chunk size;
if provided, it's the chunk size for each dimension.
... | https://github.com/mars-project/mars/issues/1521 | In [1]: import pandas as pd
In [2]: a = pd.DataFrame(columns=list('ab'))
In [3]: import mars.dataframe as md
In [4]: md.DataFrame(a).iloc[:2].execute()
---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
<ipython-inpu... | TilesError |
def decide_series_chunk_size(shape, chunk_size, memory_usage):
from ..config import options
chunk_size = dictify_chunk_size(shape, chunk_size)
average_memory_usage = memory_usage / shape[0] if shape[0] != 0 else memory_usage
if len(chunk_size) == len(shape):
return normalize_chunk_sizes(shape,... | def decide_series_chunk_size(shape, chunk_size, memory_usage):
from ..config import options
chunk_size = dictify_chunk_size(shape, chunk_size)
average_memory_usage = memory_usage / shape[0]
if len(chunk_size) == len(shape):
return normalize_chunk_sizes(shape, chunk_size[0])
max_chunk_size... | https://github.com/mars-project/mars/issues/1521 | In [1]: import pandas as pd
In [2]: a = pd.DataFrame(columns=list('ab'))
In [3]: import mars.dataframe as md
In [4]: md.DataFrame(a).iloc[:2].execute()
---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
<ipython-inpu... | TilesError |
def normalize_chunk_sizes(shape, chunk_size):
shape = normalize_shape(shape)
if not isinstance(chunk_size, tuple):
if isinstance(chunk_size, Iterable):
chunk_size = tuple(chunk_size)
elif isinstance(chunk_size, int):
chunk_size = (chunk_size,) * len(shape)
if len(sha... | def normalize_chunk_sizes(shape, chunk_size):
shape = normalize_shape(shape)
if not isinstance(chunk_size, tuple):
if isinstance(chunk_size, Iterable):
chunk_size = tuple(chunk_size)
elif isinstance(chunk_size, int):
chunk_size = (chunk_size,) * len(shape)
if len(sha... | https://github.com/mars-project/mars/issues/1521 | In [1]: import pandas as pd
In [2]: a = pd.DataFrame(columns=list('ab'))
In [3]: import mars.dataframe as md
In [4]: md.DataFrame(a).iloc[:2].execute()
---------------------------------------------------------------------------
StopIteration Traceback (most recent call last)
<ipython-inpu... | TilesError |
def _is_sparse(cls, x1, x2):
if hasattr(x1, "issparse") and x1.issparse():
# if x1 is sparse, will be sparse always
return True
elif np.isscalar(x1) and x1 == 0:
# x1 == 0, return sparse if x2 is
return x2.issparse() if hasattr(x2, "issparse") else False
return False
| def _is_sparse(cls, x1, x2):
# x2 is sparse or not does not matter
if hasattr(x1, "issparse") and x1.issparse() and np.isscalar(x2):
return True
elif x1 == 0:
return True
return False
| https://github.com/mars-project/mars/issues/1500 | vx = mt.dot((1,0,0),(0,1,0))
vy = mt.dot((1,0,0),(0,0,1))
t = mt.arctan2(vx, vy)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/mars/core.py in __len__(self)
533 try:
... | IndexError |
def execute(cls, ctx, op):
inputs, device_id, xp = as_same_device(
[ctx[c.key] for c in op.inputs], device=op.device, ret_extra=True
)
with device(device_id):
a = op.lhs if np.isscalar(op.lhs) else inputs[0]
b = op.rhs if np.isscalar(op.rhs) else inputs[-1]
ctx[op.outputs[0... | def execute(cls, ctx, op):
(a, b), device_id, xp = as_same_device(
[ctx[c.key] for c in op.inputs], device=op.device, ret_extra=True
)
with device(device_id):
ctx[op.outputs[0].key] = xp.isclose(
a, b, atol=op.atol, rtol=op.rtol, equal_nan=op.equal_nan
)
| https://github.com/mars-project/mars/issues/1497 | In []: mt.isclose((0,0), (0,0)).execute()
Out[]: array([True, True])
In []: mt.isclose((0,0), (0,)).execute()
Out[]: arary([True, True])
In []: np.isclose((0,0), (0))
Out[]: array([True, True])
In []: mt.isclose((0,0), (0)).execute()
---------------------------------------------------------------------------
ValueError... | ValueError |
def arrow_array_to_objects(obj):
from .dataframe.arrays import ArrowDtype
if isinstance(obj, pd.DataFrame):
out_cols = dict()
for col_name, dtype in obj.dtypes.items():
if isinstance(dtype, ArrowDtype):
out_cols[col_name] = pd.Series(
obj[col_name... | def arrow_array_to_objects(obj):
from .dataframe.arrays import ArrowDtype
if isinstance(obj, pd.DataFrame):
out_cols = dict()
for col_name, dtype in obj.dtypes.items():
if isinstance(dtype, ArrowDtype):
out_cols[col_name] = pd.Series(
obj[col_name... | https://github.com/mars-project/mars/issues/1497 | In []: mt.isclose((0,0), (0,0)).execute()
Out[]: array([True, True])
In []: mt.isclose((0,0), (0,)).execute()
Out[]: arary([True, True])
In []: np.isclose((0,0), (0))
Out[]: array([True, True])
In []: mt.isclose((0,0), (0)).execute()
---------------------------------------------------------------------------
ValueError... | ValueError |
def fetch_chunks_data(
self,
session_id,
chunk_indexes,
chunk_keys,
nsplits,
index_obj=None,
serial=True,
serial_type=None,
compressions=None,
pickle_protocol=None,
):
chunk_index_to_key = dict(
(index, key) for index, key in zip(chunk_indexes, chunk_keys)
)
i... | def fetch_chunks_data(
self,
session_id,
chunk_indexes,
chunk_keys,
nsplits,
index_obj=None,
serial=True,
serial_type=None,
compressions=None,
pickle_protocol=None,
):
chunk_index_to_key = dict(
(index, key) for index, key in zip(chunk_indexes, chunk_keys)
)
i... | https://github.com/mars-project/mars/issues/1479 | 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/Co... | ModuleNotFoundError |
def parse_args(self, parser, argv, environ=None):
environ = environ or os.environ
args = parser.parse_args(argv)
args.host = args.host or environ.get("MARS_BIND_HOST")
args.port = args.port or environ.get("MARS_BIND_PORT")
args.endpoint = args.endpoint or environ.get("MARS_BIND_ENDPOINT")
args.... | def parse_args(self, parser, argv, environ=None):
environ = environ or os.environ
args = parser.parse_args(argv)
args.advertise = args.advertise or environ.get("MARS_CONTAINER_IP")
load_modules = []
for mods in tuple(args.load_modules or ()) + (environ.get("MARS_LOAD_MODULES"),):
load_modul... | https://github.com/mars-project/mars/issues/1479 | 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/Co... | ModuleNotFoundError |
def _get_ready_pod_count(self, label_selector):
query = self._core_api.list_namespaced_pod(
namespace=self._namespace, label_selector=label_selector
).to_dict()
cnt = 0
for el in query["items"]:
if el["status"]["phase"] in ("Error", "Failed"):
logger.warning(
... | def _get_ready_pod_count(self, label_selector):
query = self._core_api.list_namespaced_pod(
namespace=self._namespace, label_selector=label_selector
).to_dict()
cnt = 0
for el in query["items"]:
if el["status"]["phase"] in ("Error", "Failed"):
raise SystemError(el["status"]["... | https://github.com/mars-project/mars/issues/1479 | 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/Co... | ModuleNotFoundError |
def config_args(self, parser):
super().config_args(parser)
parser.add_argument("--nproc", help="number of processes")
parser.add_argument(
"--disable-failover", action="store_true", help="disable fail-over"
)
| def config_args(self, parser):
super().config_args(parser)
parser.add_argument("--nproc", help="number of processes")
| https://github.com/mars-project/mars/issues/1479 | 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/Co... | ModuleNotFoundError |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.