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

Function test_dataset_join_asof_empty_by

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

Source from the content-addressed store, hash-verified

5439
5440@pytest.mark.dataset
5441def test_dataset_join_asof_empty_by(tempdir):
5442 t1 = pa.table({
5443 "on": [1, 2, 3],
5444 })
5445 ds.write_dataset(t1, tempdir / "t1", format="ipc")
5446 ds1 = ds.dataset(tempdir / "t1", format="ipc")
5447
5448 t2 = pa.table({
5449 "colVals": ["Z", "B", "A"],
5450 "on": [2, 3, 4],
5451 })
5452 ds.write_dataset(t2, tempdir / "t2", format="ipc")
5453 ds2 = ds.dataset(tempdir / "t2", format="ipc")
5454
5455 result = ds1.join_asof(
5456 ds2, on="on", by=[], tolerance=1
5457 )
5458 assert result.to_table() == pa.table({
5459 "on": [1, 2, 3],
5460 "colVals": ["Z", "Z", "B"],
5461 })
5462
5463
5464@pytest.mark.dataset

Callers

nothing calls this directly

Calls 1

to_tableMethod · 0.45

Tested by

no test coverage detected