anjakefala commented on code in PR #13718:
URL: https://github.com/apache/arrow/pull/13718#discussion_r1012347877


##########
python/pyarrow/tests/test_types.py:
##########
@@ -845,6 +845,11 @@ def test_decimal_overflow():
         with pytest.raises(ValueError):
             pa.decimal256(i, 0)
 
+def test_timedelta_overflow()::
+    d = datetime.timedelta(days=-106751992, seconds=71945, microseconds=224192)
+    with pytest.raises(pa.ArrowInvalid):
+        pa.scalar(d)

Review Comment:
   I agree it is a good idea to add test cases!
   
   I think I am missing something, but it seems like datetime.timedelta is only 
at the microsecond resolution: 
https://docs.python.org/3/library/datetime.html#available-types. Could 
`pa.scalar()` accept a pandas or numpy timedelta? Those have nanosecond 
resolution support.



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