Checks for left_index and right_index merge parameters by ivallesp · Pull Request #14434 · pandas-dev/pandas (original) (raw)
Hi,
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.
Tests passed
Thanks!