Repository: pyjanitor-devs/pyjanitor

Issue:
[BUG] pandas 1.5.x `_MergeOperation` doesn't have `copy` keyword anymore
Raised errors from [the latest testing env](https://github.com/pyjanitor-devs/pyjanitor/actions/runs/3255090961/jobs/5344044127#step:5:1909) which pandas version is 1.5.0.

The pandas version of [environment-dev.yml](https://github.com/pyjanitor-devs/pyjanitor/blob/dev/environment-dev.yml#L36) is 1.3.5, so it would raise any errors.

```python
___________________________ test_extension_array_eq ____________________________
[gw1] linux -- Python 3.10.6 /usr/share/miniconda3/envs/test/bin/python

    def test_extension_array_eq():
        """Extension arrays when matching on equality."""
        df1 = pd.DataFrame(
            {"id": [1, 1, 1, 2, 2, 3], "value_1": [2, 5, 7, 1, 3, 4]}
        )
        df1 = df1.astype({"value_1": "Int64"})
        df2 = pd.DataFrame(
            {
                "id": [1, 1, 1, 1, 2, 2, 2, 3],
                "value_2A": [0, 3, 7, 12, 0, 2, 3, 1],
                "value_2B": [1, 5, 9, 15, 1, 4, 6, 3],
            }
        )
        df2 = df2.astype({"value_2A": "Int64"})
>       expected = df1.conditional_join(
            df2,
            ("id", "id", "=="),
            ("value_1", "value_2A", ">"),
            use_numba=False,
            sort_by_appearance=False,
        )

tests/functions/test_conditional_join.py:2962: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/share/miniconda3/envs/test/lib/python3.10/site-packages/pandas_flavor/register.py:29: in __call__
    return method(self._obj, *args, **kwargs)
janitor/functions/conditional_join.py:150: in conditional_join
    return _conditional_join_compute(
janitor/functions/conditional_join.py:419: in _conditional_join_compute
    result = _multiple_conditional_join_eq(df, right, conditions, keep)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

df =    id  value_1
0   1        2
1   1        5
2   1        7
3   2        1
4   2        3
5   3        4
right =    id  value_2A  value_2B
0   1         0         1
1   1         3         5
2   1         7         9
3   1        12        15
4   2         0         1
5   2         2         4
6   2         3         6
7   3         1         3
conditions = (('id', 'id', '=='), ('value_1', 'value_2A', '>')), keep = 'all'

    def _multiple_conditional_join_eq(
        df: pd.DataFrame, right: pd.DataFrame, conditions: list, keep: str
    ) -> tuple:
        """
        Get indices for multiple conditions,
        if any of the conditions has an `==` operator.
    
        Returns a tuple of (df_index, right_index)
        """
        eqs = [
            (left_on, right_on)
            for left_on, right_on, op in conditions
            if op == _JoinOperator.STRICTLY_EQUAL.value
        ]
    
        left_on, right_on = zip(*eqs)
        left_on = [*left_on]
        right_on = [*right_on]
    
        rest = (
            (df[left_on], right[right_on], op)
            for left_on, right_on, op in conditions
            if op != _JoinOperator.STRICTLY_EQUAL.value
        )
    
>       left_index, right_index = _MergeOperation(
            df,
            right,
            left_on=left_on,
            right_on=right_on,
            sort=False,
            copy=False,
        )._get_join_indexers()
E       TypeError: _MergeOperation.__init__() got an unexpected keyword argument 'copy'

janitor/functions/conditional_join.py:899: TypeError
```

closed to #1143 


Discussion:

Resolving patch:
diff --git a/janitor/functions/conditional_join.py b/janitor/functions/conditional_join.py
--- a/janitor/functions/conditional_join.py
+++ b/janitor/functions/conditional_join.py
@@ -902,7 +902,6 @@ def _multiple_conditional_join_eq(
         left_on=left_on,
         right_on=right_on,
         sort=False,
-        copy=False,
     )._get_join_indexers()
 
     if not left_index.size:


Test patch:
diff --git a/tests/functions/test_case_when.py b/tests/functions/test_case_when.py
--- a/tests/functions/test_case_when.py
+++ b/tests/functions/test_case_when.py
@@ -175,7 +175,7 @@ def test_case_when_default_array(df):
     )
     expected = np.where(df.numbers > 1, df.numbers + 10, default)
     expected = df.assign(bleh=expected)
-    assert_frame_equal(result, expected)
+    assert_frame_equal(result, expected, check_dtype=False)
 
 
 @given(df=categoricaldf_strategy())