Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 389584b

Browse files
committed
Add test for #63
1 parent 6372119 commit 389584b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_issues.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
3+
import pandas as pd
4+
import root_pandas
5+
6+
7+
def test_issue_63():
8+
df = pd.DataFrame({'a': [], 'b': []})
9+
root_pandas.to_root(df, 'tmp_1.root', 'my_tree')
10+
df = pd.DataFrame({'a': list(range(10)), 'b': list(range(10))})
11+
root_pandas.to_root(df, 'tmp_2.root', 'my_tree')
12+
result = list(root_pandas.read_root(['tmp_1.root', 'tmp_2.root'], 'my_tree', where='a > 2', chunksize=1))
13+
assert len(result) == 7
14+
assert all(len(df) == 1 for df in result)
15+
os.remove('tmp_1.root')
16+
os.remove('tmp_2.root')

0 commit comments

Comments
 (0)