dhaanish597 opened a new pull request, #55949:
URL: https://github.com/apache/arrow/pull/55949

   ### Rationale for this change
   
   PyArrow scalars and arrays support operations such as `x + 2`, but the 
equivalent expression `2 + x` raises `TypeError`.
   
   ### What changes are included in this PR?
   
   Add the ten reflected operators listed in the issue to `Scalar` and `Array`, 
with matching type annotations. Dispatch to the existing compute kernels with 
operands in their original order, including for subtraction, division, powers, 
and shifts.
   
   ### Are these changes tested?
   
   On a native macOS arm64 build of the pinned source: 22 new regression tests 
and 24 existing arithmetic tests passed. The focused stub runtime test passed, 
and mypy found no issues in 26 source files. The full suite was not run locally.
   
   ### Are there any user-facing changes?
   
   Python numbers can now appear on the left of the supported operators. 
Unsupported operand types still raise `TypeError`.
   
   ### Was AI used for this PR?
   
   OpenAI ChatGPT (Dot) assisted with reproduction and generated the 
implementation, tests, type-stub changes, and PR draft. The contributor 
personally reviewed the patch before submission.
   
   **PR code and description written by:**
   
   - [ ] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [x] Human
   - [x] AI
   - [ ] Not reviewed
   


-- 
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]

Reply via email to