kevinjqliu commented on code in PR #2178:
URL: https://github.com/apache/iceberg-python/pull/2178#discussion_r2206187346
##########
pyiceberg/table/__init__.py:
##########
@@ -1691,7 +1691,12 @@ def to_polars(self) -> pl.DataFrame: ...
def update(self: S, **overrides: Any) -> S:
"""Create a copy of this table scan with updated fields."""
- return type(self)(**{**self.__dict__, **overrides})
+ from inspect import signature
+
+ params = signature(type(self).__init__).parameters.keys() - {"self"}
# Skip "self" parameter
+ kwargs = {param: getattr(self, param) for param in params} # Assume
parameters are attributes
Review Comment:
LGTM! this is great. lets add some comments to explain why we're doing this
--
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]