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

Function test_dataset_join_asof_collisions

python/pyarrow/tests/test_dataset.py:5465–5493  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

5463
5464@pytest.mark.dataset
5465def test_dataset_join_asof_collisions(tempdir):
5466 t1 = pa.table({
5467 "colA": [1, 2, 6],
5468 "colB": [10, 20, 60],
5469 "on": [1, 2, 3],
5470 "colVals": ["a", "b", "f"]
5471 })
5472 ds.write_dataset(t1, tempdir / "t1", format="ipc")
5473 ds1 = ds.dataset(tempdir / "t1", format="ipc")
5474
5475 t2 = pa.table({
5476 "colB": [99, 20, 10],
5477 "colVals": ["Z", "B", "A"],
5478 "colUniq": [100, 200, 300],
5479 "colA": [99, 2, 1],
5480 "on": [2, 3, 4],
5481 })
5482 ds.write_dataset(t2, tempdir / "t2", format="ipc")
5483 ds2 = ds.dataset(tempdir / "t2", format="ipc")
5484
5485 msg = (
5486 "Columns {'colVals'} present in both tables. "
5487 "AsofJoin does not support column collisions."
5488 )
5489 with pytest.raises(ValueError, match=msg):
5490 ds1.join_asof(
5491 ds2, on="on", by=["colA", "colB"], tolerance=1,
5492 right_on="on", right_by=["colA", "colB"],
5493 )
5494
5495
5496@pytest.mark.parametrize('dstype', [

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected