Open arunpersaud opened 2 years ago
Well.. i can admit that this is technically a bug.. but this is also you abusing the system..
In principle selection = [None]
should the be same as selection=None
I suppose.
Edit: although I see that count
crashes for any list of selections without limits.. ok let's see if we can fix it. Thank you for the report!
I just used selection=[None]
as an example, a more realistic one would perhaps be
# works
df.count("*", binby="x", shape=1024, selection=[df.x>0, df.x<0], limits=[-10,10])
# doesn't work
df.count("*", binby="x", shape=1024, selection=[df.x>0, df.x<0])
The error for the second one that I'm getting is:
>>> df.count("*", binby="x", shape=1024, selection=[df.x>0, df.x<0])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arun/.local/lib/python3.8/site-packages/vaex/dataframe.py", line 962, in count
return self._compute_agg('count', expression, binby, limits, shape, selection, delay, edges, progress, array_type=array_type)
File "/home/arun/.local/lib/python3.8/site-packages/vaex/dataframe.py", line 936, in _compute_agg
return self._delay(delay, progressbar.exit_on(var))
File "/home/arun/.local/lib/python3.8/site-packages/vaex/dataframe.py", line 1775, in _delay
self.execute()
File "/home/arun/.local/lib/python3.8/site-packages/vaex/dataframe.py", line 417, in execute
self.executor.execute()
File "/home/arun/.local/lib/python3.8/site-packages/vaex/execution.py", line 308, in execute
for _ in self.execute_generator():
File "/home/arun/.local/lib/python3.8/site-packages/vaex/execution.py", line 345, in execute_generator
tasks = _merge(tasks)
File "/home/arun/.local/lib/python3.8/site-packages/vaex/execution.py", line 137, in _merge
tasks_merged.extend(_merge_tasks_for_df(tasks_df, df))
File "/home/arun/.local/lib/python3.8/site-packages/vaex/execution.py", line 151, in _merge_tasks_for_df
tasks_agg_per_grid[task.binners].append(task)
File "/home/arun/.local/lib/python3.8/site-packages/vaex/dataframe.py", line 7199, in __hash__
return hash((self.__class__.__name__, self.expression, self.minimum, self.maximum, self.count, self.dtype))
TypeError: unhashable type: 'numpy.ndarray'
Description df.count results in an error when called with a list of selections and no limits, but works when limits are given.
Software information
import vaex; vaex.__version__)
: {'vaex': '4.11.1', 'vaex-core': '4.11.1', 'vaex-viz': '0.5.2', 'vaex-hdf5': '0.12.3', 'vaex-server': '0.8.1', 'vaex-astro': '0.9.1', 'vaex-jupyter': '0.8.0', 'vaex-ml': '0.18.0'}Additional information Here is some example code:
The error I'm getting is: