AlenkaF commented on code in PR #49845: URL: https://github.com/apache/arrow/pull/49845#discussion_r3987708592
########## python/pyarrow/scalar.pxi: ########## @@ -21,6 +21,25 @@ from uuid import UUID from collections.abc import Sequence, Mapping +def _is_valid_compute_operand(value): + if isinstance(value, (Scalar, Array, ChunkedArray, RecordBatch, Table, + list, tuple)): + return True + if np is not None and isinstance(value, np.ndarray): + return True + try: + scalar(value) + except Exception: + return False + return True + + +def _compute_binary_op(func_name, left, right): Review Comment: Closing this as not relevant. There are other examples of helper functions reused in different `.pxi` files, for example `_normalize_slice` and `_empty_array`. I might move it to array.pxi though. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
