rahulsmahadev commented on code in PR #4430:
URL: https://github.com/apache/iceberg-python/pull/4430#discussion_r4733983233


##########
tests/table/test_inspect.py:
##########
@@ -104,6 +105,26 @@ def 
test_inspect_entries_and_files_with_data_file_without_metrics(catalog: InMem
     assert files[0]["column_sizes"] is None
 
 
[email protected]("ignore:Falling back to pure Python Avro decoder")
+def test_manifests_render_decimal_bounds_in_plain_notation(catalog: 
InMemoryCatalog) -> None:
+    schema = Schema(NestedField(1, "amount", DecimalType(20, 8), 
required=True))
+    spec = PartitionSpec(PartitionField(source_id=1, field_id=1000, 
transform=IdentityTransform(), name="amount"))
+    tbl = catalog.create_table("default.dec_bounds", schema, 
partition_spec=spec)
+    tbl.append(
+        pa.table(
+            {"amount": pa.array([Decimal("0.00000012"), 
Decimal("100.00000000")], type=pa.decimal128(20, 8))},
+            schema=tbl.schema().as_arrow(),
+        )
+    )
+
+    summaries = tbl.inspect.manifests().to_pydict()["partition_summaries"][0]
+
+    # Plain notation per the decimal JSON convention (#4420): str() would 
render
+    # the small magnitude as 1.2E-7
+    assert summaries[0]["lower_bound"] == "0.00000012"
+    assert summaries[0]["upper_bound"] == "100.00000000"

Review Comment:
   Minor: `100.00000000` renders the same with `str()`, so this test still 
passes if the upper bound keeps `to_human_string`, and nothing covers truncate. 
Small bounds such as `-0.00000012` and `0.00000012` on an identity and a 
`truncate[10]` column would pin both.



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