(join)
| 562 | |
| 563 | @pytest.mark.parametrize("join", ["inner", "outer"]) |
| 564 | def test_concat(join): |
| 565 | pdf1 = pd.DataFrame( |
| 566 | {"x": [1, 2, 3, 4, 6, 7], "y": list("abcdef")}, index=[1, 2, 3, 4, 6, 7] |
| 567 | ) |
| 568 | ddf1 = dd.from_pandas(pdf1, 2) |
| 569 | pdf2 = pd.DataFrame( |
| 570 | {"x": [1, 2, 3, 4, 6, 7], "y": list("abcdef")}, index=[8, 9, 10, 11, 12, 13] |
| 571 | ) |
| 572 | ddf2 = dd.from_pandas(pdf2, 2) |
| 573 | |
| 574 | # different columns |
| 575 | pdf3 = pd.DataFrame( |
| 576 | {"x": [1, 2, 3, 4, 6, 7], "z": list("abcdef")}, index=[8, 9, 10, 11, 12, 13] |
| 577 | ) |
| 578 | ddf3 = dd.from_pandas(pdf3, 2) |
| 579 | |
| 580 | kwargs = {"sort": False} |
| 581 | |
| 582 | for dd1, dd2, pd1, pd2 in [ |
| 583 | (ddf1, ddf2, pdf1, pdf2), |
| 584 | (ddf1, ddf3, pdf1, pdf3), |
| 585 | ]: |
| 586 | expected = pd.concat([pd1, pd2], join=join, **kwargs) |
| 587 | result = dd.concat([dd1, dd2], join=join, **kwargs) |
| 588 | assert_eq(result, expected) |
| 589 | |
| 590 | |
| 591 | @pytest.mark.parametrize("join", ["inner", "outer"]) |
nothing calls this directly
no test coverage detected