kevinjqliu commented on code in PR #3142:
URL: https://github.com/apache/iceberg-python/pull/3142#discussion_r2926245104


##########
tests/io/test_pyarrow_visitor.py:
##########
@@ -226,6 +227,18 @@ def test_pyarrow_timestamp_tz_invalid_tz() -> None:
         visit_pyarrow(pyarrow_type, _ConvertToIceberg())
 
 
+def test_pyarrow_timestamp_ns_tz_invalid_tz() -> None:
+    pyarrow_type = pa.timestamp(unit="ns", tz="US/Pacific")
+    with pytest.raises(TypeError, match=re.escape("Unsupported type: 
timestamp[ns, tz=US/Pacific]")):
+        visit_pyarrow(pyarrow_type, _ConvertToIceberg(format_version=3))
+
+
+def test_pyarrow_timestamp_ns_no_tz_accepted() -> None:
+    pyarrow_type = pa.timestamp(unit="ns")
+    converted = visit_pyarrow(pyarrow_type, 
_ConvertToIceberg(format_version=3))
+    assert converted == TimestampNanoType()

Review Comment:
   `pa.timestamp` defaults `tz` to `None`
   https://arrow.apache.org/docs/python/generated/pyarrow.timestamp.html
   
   makes sense that it maps to `TimestampNanoType`



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to