<!-- Please include a self-contained copy-pastable example that generates the issue if possible. Please be concise with code posted. See guidelines below on how to provide a good bug report: - Craft Minimal Bug Reports http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports - Minimal Complete Verifiable Examples https://stackoverflow.com/help/mcve Bug reports that follow these guidelines are easier to diagnose, and so are often handled much more quickly. --> **What happened**: Running `dd.merge(left, right, how="cross")` fails with ``` MergeError: Can not pass on, right_on, left_on or set right_index=True or left_index=True ``` **What you expected to happen**: **Minimal Complete Verifiable Example**: ```python left = pd.DataFrame( { "key": ["K0", "K1", "K2", "K3"], "A": ["A0", "A1", "A2", "A3"], "B": ["B0", "B1", "B2", "B3"], } ) right = pd.DataFrame( { "key": ["K0", "K1", "K2", "K3"], "A": ["C0", "C1", "C2", "C3"], "B": ["D0", "D1", "D2", "D3"], } ) dd.merge(left, right, how="cross") ``` **Anything else we need to know?**: **Environment**: - Dask version: '2021.09.0' - Python version: 3.7.10 - Operating System: MacOS - Install method (conda, pip, source): pip
Activity
ncclementi commentedon Sep 10, 2021
Hi @johanbog for what I'm reading in the docs the reason why
dd.merge()withhow="cross"does not work, it's because it's not supported.dd.mergedocumentationmerge source code
If what you want is a feature request, you might want to open an issue requesting this feature.
jsignell commentedon Sep 13, 2021
In the meantime we could raise a clearer exception.
ncclementi commentedon Sep 13, 2021
@jsignell that sounds like a great idea. I can take a crack at that but I have few questions
Looking at the code where
mergeis defined more explicitly heredask/dask/dataframe/core.py
Lines 4614 to 4634 in 9f0b00f
Should the raise go in the definition in
.multi, like somewhere in here?dask/dask/dataframe/multi.py
Line 466 in 9f0b00f
probably right before
dask/dask/dataframe/multi.py
Line 496 in 9f0b00f
Would that be a good place?
jsignell commentedon Sep 13, 2021
Cool! Yeah I think it should go in multi right above the line that you are pointing to.