MCPcopy Create free account
hub / github.com/apache/arrow / test_table_join_asof

Function test_table_join_asof

python/pyarrow/tests/test_table.py:3329–3349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3327
3328@pytest.mark.dataset
3329def test_table_join_asof():
3330 t1 = pa.Table.from_pydict({
3331 "colA": [1, 1, 5, 6, 7],
3332 "col2": ["a", "b", "a", "b", "f"]
3333 })
3334
3335 t2 = pa.Table.from_pydict({
3336 "colB": [2, 9, 15],
3337 "col3": ["a", "b", "g"],
3338 "colC": [1., 3., 5.]
3339 })
3340
3341 r = t1.join_asof(
3342 t2, on="colA", by="col2", tolerance=1,
3343 right_on="colB", right_by="col3",
3344 )
3345 assert r.combine_chunks() == pa.table({
3346 "colA": [1, 1, 5, 6, 7],
3347 "col2": ["a", "b", "a", "b", "f"],
3348 "colC": [1., None, None, None, None],
3349 })
3350
3351
3352@pytest.mark.dataset

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected