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


##########
tests/integration/test_writes/test_writes.py:
##########
@@ -2251,13 +2251,19 @@ def test_branch_py_write_spark_read(session_catalog: 
Catalog, spark: SparkSessio
 @pytest.mark.integration
 def test_nanosecond_support_on_catalog(session_catalog: Catalog) -> None:
     identifier = "default.test_nanosecond_support_on_catalog"
-    # Create a pyarrow table with a nanosecond timestamp column
-    table = pa.Table.from_arrays(
-        [
-            pa.array([datetime.now()], type=pa.timestamp("ns")),
-            pa.array([datetime.now()], type=pa.timestamp("ns", 
tz="America/New_York")),
-        ],
-        names=["timestamp_ns", "timestamptz_ns"],
+
+    catalog = load_catalog("default", type="in-memory")

Review Comment:
   nit can we use `arrow_table_schema_with_nanoseconds_timestamp_precisions` 
here? its pretty comprehensive 



##########
tests/integration/test_writes/test_writes.py:
##########
@@ -2251,13 +2251,19 @@ def test_branch_py_write_spark_read(session_catalog: 
Catalog, spark: SparkSessio
 @pytest.mark.integration
 def test_nanosecond_support_on_catalog(session_catalog: Catalog) -> None:
     identifier = "default.test_nanosecond_support_on_catalog"
-    # Create a pyarrow table with a nanosecond timestamp column
-    table = pa.Table.from_arrays(
-        [
-            pa.array([datetime.now()], type=pa.timestamp("ns")),
-            pa.array([datetime.now()], type=pa.timestamp("ns", 
tz="America/New_York")),
-        ],
-        names=["timestamp_ns", "timestamptz_ns"],
+
+    catalog = load_catalog("default", type="in-memory")
+    catalog.create_namespace("ns")
+
+    table = pa.Table.from_arrays([pa.array([datetime.now()], 
type=pa.timestamp("ns"))], names=["timestamps"])
+    table2 = pa.Table.from_arrays(
+        [pa.array([datetime.now()], type=pa.timestamp("ns", 
tz="America/New_York"))], names=["timestamps"]
     )
 
     _create_table(session_catalog, identifier, {"format-version": "3"}, 
schema=table.schema)
+
+    with pytest.raises(NotImplementedError, match="Writing V3 is not yet 
supported"):
+        catalog.create_table("ns.table1", schema=table.schema, 
properties={"format-version": "3"})
+
+    with pytest.raises(NotImplementedError, match="Writing V3 is not yet 
supported"):
+        catalog.create_table("ns.table2", schema=table2.schema, 
properties={"format-version": "3"})

Review Comment:
   nit can we test that the same code that works for v3 doesnt work for v2. 
something like 
   
   ```
       with pytest.raises(NotImplementedError, match="..."):
           _create_table(session_catalog, identifier, {"format-version": "2"}, 
schema=table.schema)
   ```



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