kevinjqliu commented on PR #2178:
URL: https://github.com/apache/iceberg-python/pull/2178#issuecomment-3057713704
interesting! good catch.
I think implicitly the `update` function only allows updating the
constructor parameters. the `cached_property` is a side-effect of using
`self.__dict__`
what if we just filter for only the constructor params? wdyt?
```
import inspect
def update(self: S, **overrides: Any) -> S:
"""Create a copy of this table scan with updated fields."""
init_params = inspect.signature(type(self).__init__).parameters
valid_keys = set(init_params) - {"self"}
filtered_dict = {k: v for k, v in self.__dict__.items() if k in
valid_keys}
return type(self)(**{**filtered_dict, **overrides})
```
--
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]