greenlaw commented on code in PR #3810:
URL: https://github.com/apache/iceberg-python/pull/3810#discussion_r3849531424


##########
pyiceberg/io/pyarrow.py:
##########
@@ -2349,15 +2423,44 @@ class 
PyArrowStatisticsCollector(PreOrderSchemaVisitor[list[StatisticsCollector]
     _schema: Schema
     _properties: dict[str, str]
     _default_mode: str
+    _inferred_field_ids: set[int] | None
 
     def __init__(self, schema: Schema, properties: dict[str, str]):
         from pyiceberg.table import TableProperties
 
         self._schema = schema
         self._properties = properties
-        self._default_mode = self._properties.get(
-            TableProperties.DEFAULT_WRITE_METRICS_MODE, 
TableProperties.DEFAULT_WRITE_METRICS_MODE_DEFAULT
-        )
+
+        configured_default_mode = 
self._properties.get(TableProperties.DEFAULT_WRITE_METRICS_MODE)
+
+        if configured_default_mode is not None:
+            # An explicitly configured default applies to all columns.
+            self._default_mode = configured_default_mode
+            self._inferred_field_ids = None

Review Comment:
   If `write.metadata.metrics.default` is explicitly set (say, to 'full'), 
wouldn't we still want `write.metadata.metrics.max-inferred-column-defaults` to 
apply? in fact, isn't that when limiting is most important?



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