(self)
| 116 | |
| 117 | class TestPandasIndex: |
| 118 | def test_constructor(self) -> None: |
| 119 | pd_idx = pd.Index([1, 2, 3]) |
| 120 | index = PandasIndex(pd_idx, "x") |
| 121 | |
| 122 | assert index.index.equals(pd_idx) |
| 123 | # makes a shallow copy |
| 124 | assert index.index is not pd_idx |
| 125 | assert index.dim == "x" |
| 126 | |
| 127 | # test no name set for pd.Index |
| 128 | pd_idx.name = None |
| 129 | index = PandasIndex(pd_idx, "x") |
| 130 | assert index.index.name == "x" |
| 131 | |
| 132 | def test_from_variables(self) -> None: |
| 133 | # pandas has only Float64Index but variable dtype should be preserved |
nothing calls this directly
no test coverage detected