Join GitHub today
Checks for left_index and right_index merge parameters #14434
I just committed an error when I was doing an analysis using pandas and this motivated me to implement two checks which in my opinion are necessary.
I was trying to perform a merge and I confused the parameters "left_on" and "right_on" for "left_index" and "right_index". I ran the code and it did not raised me any error. It produced a table which seem to be fine in terms of shape. I suspect that what happened is that the tables got merged by the index of the data frame. I think it would be a great idea to check if right_index and left_index are of type bool, if not, raise an error. This way we will avoid that more people got the same error as mine :D.
Current coverage is 85.25% (diff: 100%)
@@ master #14434 diff @@ ========================================== Files 140 140 Lines 50631 50635 +4 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 43166 43171 +5 + Misses 7465 7464 -1 Partials 0 0