()
| 700 | |
| 701 | |
| 702 | def test_from_delayed_misordered_meta(): |
| 703 | df = pd.DataFrame( |
| 704 | columns=["(1)", "(2)", "date", "ent", "val"], |
| 705 | data=[range(i * 5, i * 5 + 5) for i in range(3)], |
| 706 | index=range(3), |
| 707 | ) |
| 708 | |
| 709 | # meta with different order for columns |
| 710 | misordered_meta = pd.DataFrame( |
| 711 | columns=["date", "ent", "val", "(1)", "(2)"], data=[range(5)] |
| 712 | ) |
| 713 | |
| 714 | ddf = dd.from_delayed([delayed(lambda: df)()], meta=misordered_meta) |
| 715 | |
| 716 | with pytest.raises(ValueError) as info: |
| 717 | # produces dataframe which does not match meta |
| 718 | ddf.reset_index().compute(scheduler="sync") |
| 719 | msg = ( |
| 720 | "The columns in the computed data do not match the columns in the" |
| 721 | " provided metadata" |
| 722 | ) |
| 723 | assert msg in str(info.value) |
| 724 | |
| 725 | |
| 726 | def test_to_delayed(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…