| 3071 | |
| 3072 | @pytest.mark.numpy |
| 3073 | def test_array_string_from_all_null(): |
| 3074 | # ARROW-5682 |
| 3075 | vals = np.array([None, None], dtype=object) |
| 3076 | arr = pa.array(vals, type=pa.string()) |
| 3077 | assert arr.null_count == 2 |
| 3078 | |
| 3079 | vals = np.array([np.nan, np.nan], dtype='float64') |
| 3080 | # by default raises, but accept as all-null when from_pandas=True |
| 3081 | with pytest.raises(TypeError): |
| 3082 | pa.array(vals, type=pa.string()) |
| 3083 | arr = pa.array(vals, type=pa.string(), from_pandas=True) |
| 3084 | assert arr.null_count == 2 |
| 3085 | |
| 3086 | |
| 3087 | @pytest.mark.numpy |