Skip to content

Restore one-sided return_input options in overlap#240

Open
OfficialBishal wants to merge 1 commit into
open2c:mainfrom
OfficialBishal:fix-overlap-return-input
Open

Restore one-sided return_input options in overlap#240
OfficialBishal wants to merge 1 commit into
open2c:mainfrom
OfficialBishal:fix-overlap-return-input

Conversation

@OfficialBishal

Copy link
Copy Markdown

Closes #197.

overlap(..., return_input=...) used to accept 1/"1"/"left" to return only df1's columns and 2/"2"/"right" to return only df2's, but a refactor reduced return_input to a plain truthiness check, so any non-False value silently returned both sides. This restores the documented options and makes unsupported values raise instead of failing silently.

Changes:

  • overlap resolves return_input into left/right flags and raises ValueError for values outside {True, False, 1, 2, "1", "2", "left", "right"}.
  • Documented the accepted values in the docstring.
  • Added test_overlap_return_input covering both / neither / left-only / right-only and the error case.
  • Changelog note under the upcoming release.
return_input columns returned
True (default) both sides
False neither
1 / "1" / "left" df1 only
2 / "2" / "right" df2 only

pytest tests/test_ops.py passes (17 tests).

overlap() historically accepted 1/"1"/"left" and 2/"2"/"right" to return only one side's columns, but a refactor reduced return_input to a plain truthiness check, so every non-False value returned both sides. Restore the documented values, raise ValueError on unsupported input, and add tests.

Closes open2c#197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore and document additional return_input args for overlap

1 participant