(s, type_=None, expected_pa_type=None)
| 129 | |
| 130 | |
| 131 | def _check_series_roundtrip(s, type_=None, expected_pa_type=None): |
| 132 | arr = pa.array(s, from_pandas=True, type=type_) |
| 133 | |
| 134 | if type_ is not None and expected_pa_type is None: |
| 135 | expected_pa_type = type_ |
| 136 | |
| 137 | if expected_pa_type is not None: |
| 138 | assert arr.type == expected_pa_type |
| 139 | |
| 140 | result = pd.Series(arr.to_pandas(), name=s.name) |
| 141 | tm.assert_series_equal(s, result) |
| 142 | |
| 143 | |
| 144 | def _check_array_roundtrip(values, expected=None, mask=None, |
no test coverage detected