Fokko commented on code in PR #8082:
URL: https://github.com/apache/iceberg/pull/8082#discussion_r1267903671


##########
python/pyiceberg/typedef.py:
##########
@@ -127,18 +127,23 @@ def json(self, exclude_none: bool = True, exclude: 
Optional[Set[str]] = None, by
         )
 
 
+CACHED_STRUCT_TO_FIELD_NAME_POSITIONS: Dict[StructType, List[str]] = {}

Review Comment:
   How would you feel about a `lru_cache`? This way the dict doesn't grow until 
infinity
   ```suggestion
   @lru_cache
   def _get_struct_fields(struct_type: StructType) -> List[str]:
       return [field.name for field in struct_type.fields]
   ```



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