pitrou commented on code in PR #12863: URL: https://github.com/apache/arrow/pull/12863#discussion_r850464777
########## python/pyarrow/tests/test_dataset.py: ########## @@ -391,6 +393,26 @@ def test_dataset(dataset, dataset_reader): assert sorted(result['group']) == [1, 2] assert sorted(result['key']) == ['xxx', 'yyy'] + condition = ds.field(('struct', 'b')) == '1' + result = dataset.to_table(use_threads=True, filter=condition).to_pydict() + + assert result['i64'] == [1, 4, 1, 4] Review Comment: This one could be in another order, you should probably sort the result table before (using `Table.sort_by` perhaps). ########## python/pyarrow/tests/test_dataset.py: ########## @@ -391,6 +393,26 @@ def test_dataset(dataset, dataset_reader): assert sorted(result['group']) == [1, 2] assert sorted(result['key']) == ['xxx', 'yyy'] + condition = ds.field(('struct', 'b')) == '1' + result = dataset.to_table(use_threads=True, filter=condition).to_pydict() + + assert result['i64'] == [1, 4, 1, 4] + assert result['f64'] == [1.0, 4.0, 1.0, 4.0] + assert sorted(result['group']) == [1, 1, 2, 2] + assert sorted(result['key']) == ['xxx', 'xxx', 'yyy', 'yyy'] + + projection = { + 'i64': ds.field('i64'), + 'f64': ds.field('f64'), + "new": ds.field(('struct', 'b')) == '1', + } + result = dataset.to_table(use_threads=True, columns=projection).to_pydict() + + assert result['i64'] == [0, 1, 2, 3, 4, 0, 1, 2, 3, 4] Review Comment: Same here (sort the results)? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org