(fmt, blocksize)
| 768 | @pytest.mark.parametrize("blocksize", [None, 10]) |
| 769 | @pytest.mark.parametrize("fmt", compression_fmts) |
| 770 | def test_read_csv_compression(fmt, blocksize): |
| 771 | if fmt and fmt not in compress: |
| 772 | pytest.skip("compress function not provided for %s" % fmt) |
| 773 | |
| 774 | expected = read_files() |
| 775 | suffix = {"gzip": ".gz", "bz2": ".bz2", "zip": ".zip", "xz": ".xz"}.get(fmt, "") |
| 776 | files2 = valmap(compress[fmt], csv_files) if fmt else csv_files |
| 777 | renamed_files = {k + suffix: v for k, v in files2.items()} |
| 778 | with filetexts(renamed_files, mode="b"): |
| 779 | # This test is using `compression="infer"` (the default) for |
| 780 | # read_csv. The paths must have the appropriate extension. |
| 781 | if fmt and blocksize: |
| 782 | with pytest.warns(UserWarning): |
| 783 | df = dd.read_csv("2014-01-*.csv" + suffix, blocksize=blocksize) |
| 784 | else: |
| 785 | df = dd.read_csv("2014-01-*.csv" + suffix, blocksize=blocksize) |
| 786 | assert_eq( |
| 787 | df.compute(scheduler="sync").reset_index(drop=True), |
| 788 | expected.reset_index(drop=True), |
| 789 | check_dtype=False, |
| 790 | ) |
| 791 | |
| 792 | |
| 793 | @pytest.mark.skip |
nothing calls this directly
no test coverage detected