()
| 1063 | |
| 1064 | |
| 1065 | def test_align_dataframes(): |
| 1066 | df1 = pd.DataFrame({"A": [1, 2, 3, 3, 2, 3], "B": [1, 2, 3, 4, 5, 6]}) |
| 1067 | df2 = pd.DataFrame({"A": [3, 1, 2], "C": [1, 2, 3]}) |
| 1068 | |
| 1069 | ddf1 = dd.from_pandas(df1, npartitions=2) |
| 1070 | ddf2 = dd.from_pandas(df2, npartitions=1) |
| 1071 | |
| 1072 | actual = ddf1.map_partitions( |
| 1073 | pd.merge, df2, align_dataframes=False, left_on="A", right_on="A", how="left" |
| 1074 | ) |
| 1075 | expected = pd.merge(df1, df2, left_on="A", right_on="A", how="left") |
| 1076 | assert_eq(actual, expected, check_index=False, check_divisions=False) |
| 1077 | |
| 1078 | actual = ddf2.map_partitions( |
| 1079 | pd.merge, ddf1, align_dataframes=False, left_on="A", right_on="A", how="right" |
| 1080 | ) |
| 1081 | expected = pd.merge(df2, df1, left_on="A", right_on="A", how="right") |
| 1082 | assert_eq(actual, expected, check_index=False, check_divisions=False) |
| 1083 | |
| 1084 | |
| 1085 | def test_drop_duplicates(shuffle_method): |
nothing calls this directly
no test coverage detected