Repository: ibis-project/ibis

Issue:
Resolve deprecation warnings
We use deprecated parts of the `abc` and `imp` modules:

```=================================================================================== warnings summary ===================================================================================
/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/google/protobuf/descriptor.py:47
  /home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/google/protobuf/descriptor.py:47: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'c
ollections.abc' is deprecated, and in 3.8 it will stop working
    from google.protobuf.pyext import _message

/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/cachetools/abc.py:7
  /home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/cachetools/abc.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.ab
c' is deprecated, and in 3.8 it will stop working
    class DefaultMapping(collections.MutableMapping):

/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/pyspark/cloudpickle.py:47
  /home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/pyspark/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's do
cumentation for alternative uses
    import imp

/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/py4j/java_collections.py:13
/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/py4j/java_collections.py:13
/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/py4j/java_collections.py:13
  /home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/py4j/java_collections.py:13: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collec
tions.abc' is deprecated, and in 3.8 it will stop working
    from collections import (

/home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/pyspark/resultiterable.py:23
  /home/tory/anaconda3/envs/ibis-dev/lib/python3.7/site-packages/pyspark/resultiterable.py:23: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'colle
ctions.abc' is deprecated, and in 3.8 it will stop working
    class ResultIterable(collections.Iterable):

-- Docs: https://docs.pytest.org/en/latest/warnings.html```


Discussion:
Ha, well, I didn't look close enough that all of these are generated from packages we depend on. So there may be nothing to do here.
There are some that we can fix:

```ibis/pandas/execution/generic.py:1015
  /ibis/ibis/pandas/execution/generic.py:1015: FutureWarning: `item` has been deprecated and will be removed in a future version
    return result.item()
```

```ibis/pandas/execution/generic.py:164
  /ibis/ibis/pandas/execution/generic.py:164: FutureWarning: the 'box' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'box'
    pd.to_datetime(data.values, box=False, unit='D')```

Resolving patch:
diff --git a/ibis/pandas/execution/generic.py b/ibis/pandas/execution/generic.py
--- a/ibis/pandas/execution/generic.py
+++ b/ibis/pandas/execution/generic.py
@@ -161,7 +161,7 @@ def execute_cast_series_date(op, data, type, **kwargs):
 
     if isinstance(from_type, dt.Integer):
         return pd.Series(
-            pd.to_datetime(data.values, box=False, unit='D'),
+            pd.to_datetime(data.values, unit='D').values,
             index=data.index,
             name=data.name,
         )
@@ -1012,7 +1012,7 @@ def wrap_case_result(raw, expr):
             raw_1d, dtype=constants.IBIS_TYPE_TO_PANDAS_TYPE[expr.type()]
         )
     if result.size == 1 and isinstance(expr, ir.ScalarExpr):
-        return result.item()
+        return result.iloc[0].item()
     return result
 
 


Test patch: