Fokko commented on code in PR #7782:
URL: https://github.com/apache/iceberg/pull/7782#discussion_r1252717531
##########
python/pyiceberg/types.py:
##########
@@ -34,27 +34,33 @@
import re
from typing import (
Any,
+ Callable,
ClassVar,
Dict,
Generator,
Literal,
Optional,
Tuple,
+ Type,
+ TypeVar,
)
-from pydantic import Field, PrivateAttr
-from pydantic.typing import AnyCallable
+from pydantic import (
+ Field,
+ PrivateAttr,
+ RootModel,
+ model_validator,
+)
from pyiceberg.typedef import IcebergBaseModel
from pyiceberg.utils.parsing import ParseNumberFromBrackets
-from pyiceberg.utils.singleton import Singleton
DECIMAL_REGEX = re.compile(r"decimal\((\d+),\s*(\d+)\)")
FIXED = "fixed"
FIXED_PARSER = ParseNumberFromBrackets(FIXED)
-class IcebergType(IcebergBaseModel, Singleton):
+class IcebergType(IcebergBaseModel):
Review Comment:
Currently, this is the case. The singleton will hash the arguments and if
there is already an instance with the same arguments, it will be returned. I'm
happy to change this to exclude:
- NestedField
- StructType
- MapType
- ListType
Also, the FixedType, DecimalType, etc could be excluded.
--
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]