()
| 210 | |
| 211 | |
| 212 | def test_json_get_array_index(): |
| 213 | input = _json_table( |
| 214 | index=[0, 1, 2], |
| 215 | data=[{"field": [1, 2, 3]}, {"field": [4, 5, 6]}, {"field": [7, 8, 9]}], |
| 216 | ) |
| 217 | |
| 218 | result = input.select(result=pw.this.data["field"][pw.this.index.as_int()]) |
| 219 | |
| 220 | assert_table_equality( |
| 221 | _json_table(result=[1, 5, 9]), |
| 222 | result, |
| 223 | ) |
| 224 | |
| 225 | |
| 226 | @pytest.mark.parametrize("index", [-1, -4, 3]) |
nothing calls this directly
no test coverage detected