amogh-jahagirdar commented on code in PR #1770: URL: https://github.com/apache/iceberg-python/pull/1770#discussion_r2054153800
########## tests/integration/test_rest_schema.py: ########## @@ -1091,16 +1095,94 @@ def test_add_required_column(catalog: Catalog) -> None: ) +@pytest.mark.integration +@pytest.mark.parametrize( + "iceberg_type, default_value, write_default", Review Comment: Nit: `default_value` -> `initial_default` ########## pyiceberg/avro/resolver.py: ########## @@ -290,7 +290,7 @@ def struct(self, file_schema: StructType, record_struct: Optional[IcebergType], # There is a default value if file_field.write_default is not None: # The field is not in the record, but there is a write default value - results.append((None, DefaultWriter(writer=writer, value=file_field.write_default))) # type: ignore + results.append((None, DefaultWriter(writer=writer, value=file_field.write_default))) elif file_field.required: Review Comment: Are there tests for the round trip writing/reading of default values? Or are we doing that separately, and we're just focusing on the schema update changes in this PR ########## tests/integration/test_rest_schema.py: ########## @@ -1091,16 +1095,94 @@ def test_add_required_column(catalog: Catalog) -> None: ) +@pytest.mark.integration +@pytest.mark.parametrize( + "iceberg_type, default_value, write_default", + [ + (BooleanType(), True, False), + (IntegerType(), 123, 456), + (LongType(), 123, 456), + (FloatType(), 19.25, 22.27), + (DoubleType(), 19.25, 22.27), + (DecimalType(10, 2), Decimal("19.25"), Decimal("22.27")), Review Comment: Test with a nested field? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org