internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: dask/dask

Issue:
Throw a warning on missing `cachey` dependecy
If not failing outright, it should at least throw a warning here: https://github.com/blaze/dask/blob/master/dask/cache.py#L11

I thought at first `cachey` was a typo of `cache` somewhere in the code until I figured out it's a library.



Discussion:
This is probably here to allow `py.test --doctest-modules distributed` to work without hanging on the `cache.py` module.  Some options:
1.  Raise an `ImportError` on creating a `Cache` object instead
2.  Figure out how to optionally skip the doctests in `cache.py` if `cachey` isn't around
3.  Raise a warning


Resolving patch:
diff --git a/dask/cache.py b/dask/cache.py
--- a/dask/cache.py
+++ b/dask/cache.py
@@ -5,11 +5,6 @@
 from numbers import Number
 import sys
 
-try:
-    import cachey
-except ImportError:
-    pass
-
 overhead = sys.getsizeof(1.23) * 4 + sys.getsizeof(()) * 4
 
 
@@ -19,16 +14,28 @@ class Cache(Callback):
     Examples
     --------
 
-    >>> cache = Cache(1e9)  # available bytes
+    >>> cache = Cache(1e9)          # doctest: +SKIP
+
+    The cache can be used locally as a context manager around ``compute`` or
+    ``get`` calls:
+
+    >>> with cache:                 # doctest: +SKIP
+    ...     result = x.compute()
 
-    >>> with cache:         # use as a context manager around get/compute calls
-    ...     result = x.compute()  # doctest: +SKIP
+    You can also register a cache globally, so that it works for all
+    computations:
 
-    >>> cache.register()    # or use globally
-    >>> cache.unregister()
+    >>> cache.register()            # doctest: +SKIP
+    >>> cache.unregister()          # doctest: +SKIP
     """
 
     def __init__(self, cache, *args, **kwargs):
+        try:
+            import cachey
+        except ImportError as ex:
+            raise ImportError('Cache requires cachey, "{ex}" problem '
+                              'importing'.format(ex=str(ex)))
+        self._nbytes = cachey.nbytes
         if isinstance(cache, Number):
             cache = cachey.Cache(cache, *args, **kwargs)
         else:
@@ -51,7 +58,7 @@ def _posttask(self, key, value, dsk, state, id):
         if deps:
             duration += max(self.durations.get(k, 0) for k in deps)
         self.durations[key] = duration
-        nb = cachey.nbytes(value) + overhead + sys.getsizeof(key) * 4
+        nb = self._nbytes(value) + overhead + sys.getsizeof(key) * 4
         self.cache.put(key, value, cost=duration / nb / 1e9, nbytes=nb)
 
     def _finish(self, dsk, state, errored):


Test patch:
Repository: dask/dask

Issue:
DOC: dask.dataframe isnull doesn't really work
Hello, 

Per the [documentation](http://dask.pydata.org/en/latest/dataframe-api.html#dask.dataframe.core.Series.notnull), `series.notnul()`l has a boolean inverse `series.isnull()`. Sadly, however, that's not the case. (Trivial I know.)



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1139,6 +1139,10 @@ def clip(self, lower=None, upper=None):
     def notnull(self):
         return self.map_partitions(pd.Series.notnull)
 
+    @derived_from(pd.Series)
+    def isnull(self):
+        return self.map_partitions(pd.Series.isnull)
+
     def to_bag(self, index=False):
         """Convert to a dask Bag.
 


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -1177,6 +1177,7 @@ def test_embarrassingly_parallel_operations():
     assert eq(a.x.clip(2, 4), df.x.clip(2, 4))
 
     assert eq(a.x.notnull(), df.x.notnull())
+    assert eq(a.x.isnull(), df.x.isnull())
 
     assert len(a.sample(0.5).compute()) < len(df)
Repository: dask/dask

Issue:
Add a dummy .copy() method on dask arrays?
There's no need to copy the data in dask arrays, because they're (currently) immutable. Still, it's common to copy numpy arrays to be on the safe side, so it might be nice to add this for duck-array compatibility.



Discussion:
I would be fine with this.  Might want a pretty explicit note in the docstring about how this is a no-op and only for compatibility reasons.


Resolving patch:
diff --git a/dask/array/core.py b/dask/array/core.py
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -1377,6 +1377,12 @@ def view(self, dtype, order='C'):
         out._chunks = chunks
         return out
 
+    def copy(self):
+        """
+        Copy array.  This is a no-op for dask.arrays, which are immutable
+        """
+        return self
+
     def to_imperative(self):
         """ Convert Array into dask Values
 


Test patch:
diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py
--- a/dask/array/tests/test_array_core.py
+++ b/dask/array/tests/test_array_core.py
@@ -2003,3 +2003,8 @@ def test_atop_names():
 def test_A_property():
     x = da.ones(5, chunks=(2,))
     assert x.A is x
+
+
+def test_copy():
+    x = da.ones(5, chunks=(2,))
+    assert x.copy() is x
Repository: dask/dask

Issue:
from_pandas(..., name='foo')
Data hashing is expensive.  We need a way to turn it off in from_pandas.  This just needs an extra `name=` kwarg.  Came up when I was looking at this comment: https://github.com/pydata/pandas/issues/5751#issuecomment-214501031



Discussion:

Resolving patch:
diff --git a/dask/dataframe/io.py b/dask/dataframe/io.py
--- a/dask/dataframe/io.py
+++ b/dask/dataframe/io.py
@@ -328,7 +328,7 @@ def from_array(x, chunksize=50000, columns=None):
     return _Frame(dsk, name, dummy, divisions)
 
 
-def from_pandas(data, npartitions=None, chunksize=None, sort=True):
+def from_pandas(data, npartitions=None, chunksize=None, sort=True, name=None):
     """Construct a dask object from a pandas object.
 
     If given a ``pandas.Series`` a ``dask.Series`` will be returned. If given a
@@ -403,7 +403,7 @@ def from_pandas(data, npartitions=None, chunksize=None, sort=True):
         divisions = [None] * (npartitions + 1)
         locations = list(range(0, nrows, chunksize)) + [len(data)]
 
-    name = 'from_pandas-' + tokenize(data, chunksize)
+    name = name or ('from_pandas-' + tokenize(data, chunksize))
     dsk = dict(((name, i), data.iloc[start: stop])
                for i, (start, stop) in enumerate(zip(locations[:-1],
                    locations[1:])))


Test patch:
Repository: dask/dask

Issue:
compute node names within delayed functions
I love using `dask.imperative.delayed` as a decorator to hide the daskyness from the driver code, but the names generated for `dask.dot.dot_graph` leave something to be desired.  Its often easy to compute unique names within the delayed function, e.g.:

```
@delayed
def run(config):
    __task_name = "run_" + config["job_name"]
    res = do_stuff(config)
    return res
```

which can be done with a wrapper:

```
def run(config):
    task_name = "run_" + config["job_name"]
    return delayed(_run, name=task_name)(config)

def _run(config)
    res = do_stuff(config)
    return res
```

Any way to get rid of the wrapper step?



Discussion:

Resolving patch:
diff --git a/dask/dot.py b/dask/dot.py
--- a/dask/dot.py
+++ b/dask/dot.py
@@ -52,6 +52,7 @@ def name(x):
 
 
 _HASHPAT = re.compile('([0-9a-z]{32})')
+_UUIDPAT = re.compile('([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})')
 
 
 def label(x, cache=None):
@@ -68,21 +69,30 @@ def label(x, cache=None):
     >>> x
     'x-81dc9bdb52d04dc20036dbd8313ed055-hello'
 
+    >>> label(x)
+    'x-#-hello'
+
+    >>> from uuid import uuid1
+    >>> x = 'x-%s-hello' % uuid1()
+    >>> x  # doctest: +SKIP
+    'x-4c1a3d7e-0b45-11e6-8334-54ee75105593-hello'
+
     >>> label(x)
     'x-#-hello'
     """
     s = str(x)
-    m = re.search(_HASHPAT, s)
-    if m is not None:
-        for h in m.groups():
-            if cache is not None:
-                n = cache.get(h, len(cache))
-                label = '#{0}'.format(n)
-                # cache will be overwritten destructively
-                cache[h] = n
-            else:
-                label = '#'
-            s = s.replace(h, label)
+    for pattern in (_HASHPAT, _UUIDPAT):
+        m = re.search(pattern, s)
+        if m is not None:
+            for h in m.groups():
+                if cache is not None:
+                    n = cache.get(h, len(cache))
+                    label = '#{0}'.format(n)
+                    # cache will be overwritten destructively
+                    cache[h] = n
+                else:
+                    label = '#'
+                s = s.replace(h, label)
     return s
 
 


Test patch:
Repository: dask/dask

Issue:
Callback __init__() overrides subclass callback definitions 
The `__init__` method in `Callback` is:

```
    def __init__(self, start=None, pretask=None, posttask=None, finish=None):
        self._start = start
        self._pretask = pretask
        self._posttask = posttask
        self._finish = finish
```

which overrides callbacks defined in subclasses, e.g.:

```
class TaskCounter(Callback):
    def _pretask(self, key, dask, state):
        count(key, dask, state)
```

which doesn't work, while:

```
class TaskCounter(Callback):
    def __init__(self):
        pass

    def _pretask(self, key, dask, state):
        count(key, dask, state)
```

does.  Not sure quite what desired behavior here is, but the example in the docs:

```
class PrintKeys(Callback):
    def _pretask(self, key, dask, state):
        """Print the key of every task as it's started"""
        print("Computing: {0}!".format(repr(key)))
```

doesn't work.



Discussion:

Resolving patch:
diff --git a/dask/callbacks.py b/dask/callbacks.py
--- a/dask/callbacks.py
+++ b/dask/callbacks.py
@@ -44,10 +44,14 @@ class Callback(object):
     """
 
     def __init__(self, start=None, pretask=None, posttask=None, finish=None):
-        self._start = start
-        self._pretask = pretask
-        self._posttask = posttask
-        self._finish = finish
+        if start:
+            self._start = start
+        if pretask:
+            self._pretask = pretask
+        if posttask:
+            self._posttask = posttask
+        if finish:
+            self._finish = finish
 
     @property
     def _callback(self):


Test patch:
diff --git a/dask/tests/test_callbacks.py b/dask/tests/test_callbacks.py
new file mode 100644
--- /dev/null
+++ b/dask/tests/test_callbacks.py
@@ -0,0 +1,14 @@
+from dask.async import get_sync
+from dask.callbacks import Callback
+
+def test_callback():
+    flag = [False]
+
+    class MyCallback(Callback):
+        def _start(self, dsk):
+            flag[0] = True
+
+    with MyCallback():
+        get_sync({'x': 1}, 'x')
+
+    assert flag[0] is True
Repository: dask/dask

Issue:
Array astype breaks when given a type instead of a dtype object
The code below fails in dask 0.9.0, numpy 1.11.0, toolz 0.7.4, Python 2.7:

``` py
import numpy as np
import dask.array as da

a = np.arange(5).astype(np.int32)
d = da.from_array(a, (1,))
print(d.dtype)
e = d.astype(np.int16)
print(e.dtype)
print(e.compute())
```

with the exception

```
Traceback (most recent call last):
  File "./dask-astype.py", line 8, in <module>
    e = d.astype(np.int16)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/dask/array/core.py", line 1091, in astype
    return elemwise(_astype, self, dtype, name=name)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/dask/array/core.py", line 2159, in elemwise
    out_ndim = len(broadcast_shapes(*shapes))   # Raises ValueError if dimensions mismatch
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/dask/array/core.py", line 2131, in broadcast_shapes
    for sizes in zip_longest(*map(reversed, shapes), fillvalue=1):
TypeError: type object argument after * must be a sequence, not itertools.imap
```

If one passes `np.dtype(np.int16)` instead of just `np.int16`, then it works. The problem seems to be that the `np.int16.shape` attribute exists, but isn't a sequence. Possibly this can be fixed by adding `dtype = np.dtype(dtype) to the start of`Array.astype`.



Discussion:

Resolving patch:
diff --git a/dask/array/core.py b/dask/array/core.py
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -2062,7 +2062,7 @@ def asarray(array):
     """
     if not isinstance(array, Array):
         name = 'asarray-' + tokenize(array)
-        if not hasattr(array, 'shape'):
+        if isinstance(getattr(array, 'shape', None), Iterable):
             array = np.asarray(array)
         array = from_array(array, chunks=array.shape, name=name)
     return array
@@ -2103,7 +2103,7 @@ def is_scalar_for_elemwise(arg):
     True
     """
     return (np.isscalar(arg)
-            or not hasattr(arg, 'shape')
+            or not isinstance(getattr(arg, 'shape', None), Iterable)
             or isinstance(arg, np.dtype)
             or (isinstance(arg, np.ndarray) and arg.ndim == 0))
 
@@ -2156,6 +2156,7 @@ def elemwise(op, *args, **kwargs):
             (op.__name__, str(sorted(set(kwargs) - set(['name', 'dtype'])))))
 
     shapes = [getattr(arg, 'shape', ()) for arg in args]
+    shapes = [s if isinstance(s, Iterable) else () for s in shapes]
     out_ndim = len(broadcast_shapes(*shapes))   # Raises ValueError if dimensions mismatch
     expr_inds = tuple(range(out_ndim))[::-1]
 


Test patch:
diff --git a/dask/array/tests/test_array_core.py b/dask/array/tests/test_array_core.py
--- a/dask/array/tests/test_array_core.py
+++ b/dask/array/tests/test_array_core.py
@@ -2010,3 +2010,9 @@ def test_copy():
 def test_npartitions():
     assert da.ones(5, chunks=(2,)).npartitions == 3
     assert da.ones((5, 5), chunks=(2, 3)).npartitions == 6
+
+
+def test_astype_gh1151():
+    a = np.arange(5).astype(np.int32)
+    b = da.from_array(a, (1,))
+    assert_eq(a.astype(np.int16), b.astype(np.int16))
Repository: dask/dask

Issue:
support eval as in DataFrame.eval
Is there a plan of supporting 'http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.eval.html' in dask data frame? 

this looks like a highly parallelizable operation.



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1522,6 +1522,14 @@ def query(self, expr, **kwargs):
         return self._constructor(merge(dsk, self.dask), name,
                                  dummy, self.divisions)
 
+    @derived_from(pd.DataFrame)
+    def eval(self, expr, inplace=None, **kwargs):
+        if '=' in expr and inplace in (True, None):
+            raise NotImplementedError("Inplace eval not supported."
+            " Please use inplace=False")
+        meta = self._pd.eval(expr, inplace=inplace, **kwargs)
+        return self.map_partitions(_eval, meta, expr, inplace=inplace, **kwargs)
+
     @derived_from(pd.DataFrame)
     def dropna(self, how='any', subset=None):
         # for cloudpickle
@@ -2702,3 +2710,7 @@ def set_sorted_index(df, index, drop=True, **kwargs):
 
 def _set_sorted_index(df, idx, drop):
     return df.set_index(idx, drop=drop)
+
+
+def _eval(df, expr, **kwargs):
+    return df.eval(expr, **kwargs)


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -1344,6 +1344,24 @@ def test_query():
         assert eq(q, df.query('x**2 > y'))
 
 
+@pytest.mark.skipif(LooseVersion(pd.__version__) <= '0.18.0',
+                    reason="eval inplace not supported")
+def test_eval():
+    p = pd.DataFrame({'x': [1, 2, 3, 4], 'y': [5, 6, 7, 8]})
+    d = dd.from_pandas(p, npartitions=2)
+    with ignoring(ImportError):
+        assert eq(p.eval('x + y'), d.eval('x + y'))
+        assert eq(p.eval('z = x + y', inplace=False),
+                  d.eval('z = x + y', inplace=False))
+        with pytest.raises(NotImplementedError):
+            d.eval('z = x + y', inplace=True)
+
+        if p.eval('z = x + y', inplace=None) is None:
+            with pytest.raises(NotImplementedError):
+                d.eval('z = x + y', inplace=None)
+
+
+
 def test_deterministic_arithmetic_names():
     df = pd.DataFrame({'x': [1, 2, 3, 4], 'y': [5, 6, 7, 8]})
     a = dd.from_pandas(df, npartitions=2)
Repository: dask/dask

Issue:
set_sorted_index fails for simple one partition df 
Given simple one partition dataframe from csv, set_sorted_index fails with error:

```
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dask/dataframe/core.py", line 1438, in set_index
    return set_sorted_index(self, other, drop=drop, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dask/dataframe/core.py", line 2690, in set_sorted_index
    if (sorted(mins) != list(mins) or
TypeError: 'Timestamp' object is not iterable
```

Line 'mins, maxes = compute(mins, maxes, **kwargs)' returns single timestamps, not sequences, to mins and maxs vars.



Discussion:
Yup.  That's an issue.  This descends from a slightly deeper issue.  Fixing.


Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -43,8 +43,6 @@ def _concat(args, **kwargs):
         return args
     if isinstance(first(core.flatten(args)), np.ndarray):
         return da.core.concatenate3(args)
-    if len(args) == 1:
-        return args[0]
     if isinstance(args[0], (pd.DataFrame, pd.Series)):
         args2 = [arg for arg in args if len(arg)]
         if not args2:
@@ -73,7 +71,7 @@ class Scalar(Base):
 
     _optimize = staticmethod(optimize)
     _default_get = staticmethod(threaded.get)
-    _finalize = staticmethod(finalize)
+    _finalize = staticmethod(first)
 
     def __init__(self, dsk, _name, name=None, divisions=None):
         self.dask = dsk


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -1733,3 +1733,10 @@ def test_methods_tokenize_differently():
     df = dd.from_pandas(df, npartitions=1)
     assert (df.x.map_partitions(pd.Series.min)._name !=
             df.x.map_partitions(pd.Series.max)._name)
+
+
+def test_sorted_index_single_partition():
+    df = pd.DataFrame({'x': [1, 2, 3, 4], 'y': [1, 0, 1, 0]})
+    ddf = dd.from_pandas(df, npartitions=1)
+    eq(ddf.set_index('x', sorted=True),
+        df.set_index('x'))
Repository: dask/dask

Issue:
Tab completion of invalid python variable names in a notebook
In dask, on both a DataFrame and a GroupBy object, I see tab-completions pop-up with spaces in them.

Relevant (at one time?) pandas code on how they implemented this without using the old ipython completer.

https://github.com/pydata/pandas/pull/5050



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1394,7 +1394,7 @@ def __getattr__(self, key):
 
     def __dir__(self):
         return sorted(set(dir(type(self)) + list(self.__dict__) +
-                      list(self.columns)))
+                      list(filter(pd.compat.isidentifier, self.columns))))
 
     @property
     def ndim(self):
diff --git a/dask/dataframe/groupby.py b/dask/dataframe/groupby.py
--- a/dask/dataframe/groupby.py
+++ b/dask/dataframe/groupby.py
@@ -371,7 +371,7 @@ def __getitem__(self, key):
 
     def __dir__(self):
         return sorted(set(dir(type(self)) + list(self.__dict__) +
-                      list(self.obj.columns)))
+                      list(filter(pd.compat.isidentifier, self.obj.columns))))
 
     def __getattr__(self, key):
         try:


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -109,6 +109,9 @@ def test_attributes():
     assert 'foo' not in dir(d)
     assert raises(AttributeError, lambda: d.foo)
 
+    df = dd.from_pandas(pd.DataFrame({'a b c': [1, 2, 3]}), npartitions=2)
+    assert 'a b c' not in dir(df)
+
 
 def test_column_names():
     tm.assert_index_equal(d.columns, pd.Index(['a', 'b']))
diff --git a/dask/dataframe/tests/test_groupby.py b/dask/dataframe/tests/test_groupby.py
--- a/dask/dataframe/tests/test_groupby.py
+++ b/dask/dataframe/tests/test_groupby.py
@@ -110,6 +110,14 @@ def func(df):
     assert eq(d.groupby('a').apply(func), full.groupby('a').apply(func))
 
 
+def test_groupby_dir():
+    df = pd.DataFrame({'a': range(10), 'b c d e': range(10)})
+    ddf = dd.from_pandas(df, npartitions=2)
+    g = ddf.groupby('a')
+    assert 'a' in dir(g)
+    assert 'b c d e' not in dir(g)
+
+
 def test_groupby_on_index():
     dsk = {('x', 0): pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]},
                                   index=[0, 1, 3]),
Repository: dask/dask

Issue:
`.notnull()` and `.isnull()` methods not defined on DataFrames
Pandas DataFrames proved methods for computing [`isnull()`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.isnull.html) and [`notnull()`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.notnull.html), however Dask currently only provides these methods for Series objects.



Discussion:

Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -1410,6 +1410,14 @@ def dtypes(self):
             self._pd, self._known_dtype = self._build_pd(self.head())
             return self._pd.dtypes
 
+    @derived_from(pd.DataFrame)
+    def notnull(self):
+        return self.map_partitions(pd.DataFrame.notnull)
+
+    @derived_from(pd.DataFrame)
+    def isnull(self):
+        return self.map_partitions(pd.DataFrame.isnull)
+
     def set_index(self, other, drop=True, sorted=False, **kwargs):
         """ Set the DataFrame index (row labels) using an existing column
 


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -1244,6 +1244,8 @@ def test_embarrassingly_parallel_operations():
 
     assert eq(a.x.notnull(), df.x.notnull())
     assert eq(a.x.isnull(), df.x.isnull())
+    assert eq(a.notnull(), df.notnull())
+    assert eq(a.isnull(), df.isnull())
 
     assert len(a.sample(0.5).compute()) < len(df)
Repository: dask/dask

Issue:
Remove iloc from dataframe
This just raises `NotImplemented`.  Should we remove it?



Discussion:
Fine by me.


Resolving patch:
diff --git a/dask/dataframe/core.py b/dask/dataframe/core.py
--- a/dask/dataframe/core.py
+++ b/dask/dataframe/core.py
@@ -455,13 +455,8 @@ def loc(self):
         >>> df.loc["b":"d"]  # doctest: +SKIP"""
         return IndexCallable(self._loc)
 
-    @property
-    def iloc(self):
-        """ Not implemented """
-
-        # not implemented because of performance concerns.
-        # see https://github.com/dask/dask/pull/507
-        raise NotImplementedError("Dask Dataframe does not support iloc")
+    # NOTE: `iloc` is not implemented because of performance concerns.
+    # see https://github.com/dask/dask/pull/507
 
     def repartition(self, divisions=None, npartitions=None, force=False):
         """ Repartition dataframe along new divisions


Test patch:
diff --git a/dask/dataframe/tests/test_dataframe.py b/dask/dataframe/tests/test_dataframe.py
--- a/dask/dataframe/tests/test_dataframe.py
+++ b/dask/dataframe/tests/test_dataframe.py
@@ -711,10 +711,6 @@ def test_loc_with_series():
     assert sorted(d.loc[d.a % 2].dask) != sorted(d.loc[d.a % 3].dask)
 
 
-def test_iloc_raises():
-    assert raises(NotImplementedError, lambda: d.iloc[:5])
-
-
 def test_getitem():
     df = pd.DataFrame({'A': [1, 2, 3, 4, 5, 6, 7, 8, 9],
                        'B': [9, 8, 7, 6, 5, 4, 3, 2, 1],