Fokko commented on code in PR #4435:
URL: https://github.com/apache/iceberg-python/pull/4435#discussion_r4769104891
##########
pyiceberg/types.py:
##########
@@ -469,6 +471,11 @@ def __init__(
data["initial-default"] = data["initial-default"] if "initial-default"
in data else initial_default
data["write-default"] = data["write-default"] if "write-default" in
data else write_default
super().__init__(**data)
+ self._initial_default_value = self.initial_default
+ if self.initial_default is not None and isinstance(self.field_type,
(DateType, TimeType, TimestampType, TimestamptzType)):
+ from pyiceberg.expressions.literals import literal
+
+ self._initial_default_value =
literal(self.initial_default).to(self.field_type).value
Review Comment:
I think this was my suggestion, wouldn't that work?
```suggestion
self._initial_default_value =
literal(self.initial_default).to(self.field_type).value
```
--
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]