kevinjqliu commented on code in PR #2029:
URL: https://github.com/apache/iceberg-python/pull/2029#discussion_r2243723578
##########
pyiceberg/expressions/visitors.py:
##########
@@ -869,10 +871,14 @@ class
_ColumnNameTranslator(BooleanExpressionVisitor[BooleanExpression]):
file_schema: Schema
case_sensitive: bool
+ projected_field_values: Dict[str, Any]
- def __init__(self, file_schema: Schema, case_sensitive: bool) -> None:
+ def __init__(
+ self, file_schema: Schema, case_sensitive: bool,
projected_field_values: Optional[Dict[str, Any]] = None
Review Comment:
the current way is preferred over
```
projected_field_values: Dict[str, Any] = {}
```
The current way avoids using mutable default (`projected_field_values={}`),
which is considered bad practice because it can lead to unexpected shared state
across multiple calls or instances.
--
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]