r"""Operate on an argument. This is the lowest level of operation, raises :class:`NotImplementedError` by default. Overriding this on a subclass can allow common behavior to be applied to all operations. For example, overriding :class:`.ColumnOperators`
(
self, op: OperatorType, *other: Any, **kwargs: Any
)
| 425 | ) |
| 426 | |
| 427 | def operate( |
| 428 | self, op: OperatorType, *other: Any, **kwargs: Any |
| 429 | ) -> Operators: |
| 430 | r"""Operate on an argument. |
| 431 | |
| 432 | This is the lowest level of operation, raises |
| 433 | :class:`NotImplementedError` by default. |
| 434 | |
| 435 | Overriding this on a subclass can allow common |
| 436 | behavior to be applied to all operations. |
| 437 | For example, overriding :class:`.ColumnOperators` |
| 438 | to apply ``func.lower()`` to the left and right |
| 439 | side:: |
| 440 | |
| 441 | class MyComparator(ColumnOperators): |
| 442 | def operate(self, op, other, **kwargs): |
| 443 | return op(func.lower(self), func.lower(other), **kwargs) |
| 444 | |
| 445 | :param op: Operator callable. |
| 446 | :param \*other: the 'other' side of the operation. Will |
| 447 | be a single scalar for most operations. |
| 448 | :param \**kwargs: modifiers. These may be passed by special |
| 449 | operators such as :meth:`ColumnOperators.contains`. |
| 450 | |
| 451 | |
| 452 | """ |
| 453 | raise NotImplementedError(str(op)) |
| 454 | |
| 455 | __sa_operate__ = operate |
| 456 |
no outgoing calls
no test coverage detected