Repository: pandas-dev/pandas

Issue:
Support None in integer_array
It mostly works

```python
In [1]: import pandas as pd

In [2]: pd.core.arrays.integer_array([0, 1, None])
Out[2]: IntegerArray([0, 1, nan], dtype='Int64')
```

aside from 

```pytb
In [3]: pd.core.arrays.integer_array([None])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-1010251caa97> in <module>
----> 1 pd.core.arrays.integer_array([None])

~/sandbox/pandas/pandas/core/arrays/integer.py in integer_array(values, dtype, copy)
    104     TypeError if incompatible types
    105     """
--> 106     values, mask = coerce_to_array(values, dtype=dtype, copy=copy)
    107     return IntegerArray(values, mask)
    108

~/sandbox/pandas/pandas/core/arrays/integer.py in coerce_to_array(values, dtype, mask, copy)
    177                                  'mixed-integer', 'mixed-integer-float']:
    178             raise TypeError("{} cannot be converted to an IntegerDtype".format(
--> 179                 values.dtype))
    180
    181     elif not (is_integer_dtype(values) or is_float_dtype(values)):

TypeError: object cannot be converted to an IntegerDtype
```


Discussion:

Resolving patch:
diff --git a/pandas/core/arrays/integer.py b/pandas/core/arrays/integer.py
--- a/pandas/core/arrays/integer.py
+++ b/pandas/core/arrays/integer.py
@@ -173,8 +173,11 @@ def coerce_to_array(values, dtype, mask=None, copy=False):
     values = np.array(values, copy=copy)
     if is_object_dtype(values):
         inferred_type = lib.infer_dtype(values)
-        if inferred_type not in ['floating', 'integer',
-                                 'mixed-integer', 'mixed-integer-float']:
+        if inferred_type is 'mixed' and isna(values).any():
+            values = np.empty(len(values))
+            values.fill(np.nan)
+        elif inferred_type not in ['floating', 'integer',
+                                   'mixed-integer', 'mixed-integer-float']:
             raise TypeError("{} cannot be converted to an IntegerDtype".format(
                 values.dtype))
 


Test patch:
diff --git a/pandas/tests/arrays/test_integer.py b/pandas/tests/arrays/test_integer.py
--- a/pandas/tests/arrays/test_integer.py
+++ b/pandas/tests/arrays/test_integer.py
@@ -527,9 +527,9 @@ def test_integer_array_constructor():
 
 @pytest.mark.parametrize('a, b', [
     ([1, None], [1, np.nan]),
-    pytest.param([None], [np.nan],
-                 marks=pytest.mark.xfail(reason='GH-23224',
-                                         strict=True)),
+    ([None], [np.nan]),
+    ([None, np.nan], [np.nan, np.nan]),
+    ([np.nan, np.nan], [np.nan, np.nan]),
 ])
 def test_integer_array_constructor_none_is_nan(a, b):
     result = integer_array(a)
@@ -559,7 +559,8 @@ def test_integer_array_constructor_copy():
         1,
         1.0,
         pd.date_range('20130101', periods=2),
-        np.array(['foo'])])
+        np.array(['foo']),
+        [[1, 2], [3, 4]]])
 def test_to_integer_array_error(values):
     # error in converting existing arrays to IntegerArrays
     with pytest.raises(TypeError):