huong8373tt-beep opened a new pull request, #55359:
URL: https://github.com/apache/arrow/pull/55359

   ## What is the problem?
   
   `pyarrow.array(np.array([0, 1, 2]), type=pa.date32())` fails when NumPy 
selects an integer dtype other than `int32`, even though the equivalent Python 
list conversion succeeds. The date32 cast registry only provides the existing 
zero-copy `int32` kernel.
   
   ## What does this change do?
   
   - Register integer-to-date32 kernels for the remaining integer types.
   - Preserve the existing zero-copy `int32` path.
   - Reuse `IntegersCanFit` so safe casts reject values outside the date32 
int32 range.
   - Add C++ coverage for all integer types, including overflow rejection.
   - Add a PyArrow/NumPy regression test covering all integer dtypes.
   
   ## How was this tested?
   
   - `arrow-compute-scalar-cast-test.exe 
--gtest_filter=Cast.IntegerToDate32:Cast.DateZeroCopy` (2 passed)
   - `python -m py_compile python/pyarrow/tests/test_array.py`
   - `git diff --check`
   
   The focused C++ test was built from source on Windows with the build and 
dependencies kept on `D:`.
   
   ## AI disclosure
   
   AI coding assistance was used during investigation and implementation. I 
reviewed the resulting code and tests, reproduced the original failure, and ran 
the focused C++ tests and Python syntax check described above.


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