Fokko commented on code in PR #2155:
URL: https://github.com/apache/iceberg-python/pull/2155#discussion_r2270225408


##########
tests/io/test_pyarrow_visitor.py:
##########
@@ -313,6 +314,28 @@ def 
test_pyarrow_dictionary_encoded_type_to_iceberg(value_type: pa.DataType, exp
     assert visit_pyarrow(pyarrow_dict, _ConvertToIceberg()) == expected_result
 
 
+def test_schema_check_null_column(table_schema_simple: Schema) -> None:
+    pyarrow_schema: pa.Schema = schema_to_pyarrow(table_schema_simple)
+    new_field = pyarrow_schema.field(0).with_type(pa.null())  # Make the 
optional string field null for testing
+    pyarrow_schema = pyarrow_schema.set(0, new_field)
+    assert pyarrow_schema.field(0).type == pa.null()
+    _check_pyarrow_schema_compatible(table_schema_simple, pyarrow_schema)
+
+
+def test_schema_conversion_null_column(table_schema_simple: Schema) -> None:
+    pyarrow_schema: pa.Schema = schema_to_pyarrow(table_schema_simple)
+    new_field = pyarrow_schema.field(2).with_type(pa.null())  # Make the 
optional boolean field null for testing

Review Comment:
   How about creating a new schema with just a field with a NestedType instead? 
I don't think we want to re-assign fields as that makes the test harder te read.



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