Skip to content

Commit cdcb4a8

Browse files
Zac Sanchezb-rick
authored andcommitted
Fix creation of Bucket Transforms with pydantic>=2.11.0
When using pydantic>=2.11.0, we get an error when creating bucket transforms. In this version, it's illegal to access self before calling super. To fix this, we just need to ensure we call `super().__init__` before setting field properties on `self`.
1 parent 4d4714a commit cdcb4a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyiceberg/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ class BucketTransform(Transform[S, int]):
234234
_num_buckets: PositiveInt = PrivateAttr()
235235

236236
def __init__(self, num_buckets: int, **data: Any) -> None:
237-
self._num_buckets = num_buckets
238237
super().__init__(f"bucket[{num_buckets}]", **data)
238+
self._num_buckets = num_buckets
239239

240240
@property
241241
def num_buckets(self) -> int:

0 commit comments

Comments
 (0)