refactor: move _binop() util function to be near ir.Value, not ir.Expr #11697
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This function is only uses with Values, not general Expr,
so it should be co-located there.
This adds a runtime assert to verify we are using this correctly internally.
It also improves the docstring to not be misleading about ops.Binary,
and to give some more examples of the edge cases.
I found this in https://github.com/ibis-project/ibis/actions/runs/18572797607/job/52950629575?pr=11613
after I started deep diving as to why
ibis.table({"a": int}) == ibis.table({"b": str}).bdidn't error (it returns False), when I expected it to error. I might think that we should adjust this behavior so that this does error, but that is for a different PR. This is just a nice refactor.