From cdcb4a857573167d009d8e2a2a34795f4d67baa0 Mon Sep 17 00:00:00 2001 From: Zac Sanchez Date: Fri, 4 Apr 2025 10:37:25 +1100 Subject: [PATCH] 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`. --- pyiceberg/transforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyiceberg/transforms.py b/pyiceberg/transforms.py index 32a4233c67..7833215d09 100644 --- a/pyiceberg/transforms.py +++ b/pyiceberg/transforms.py @@ -234,8 +234,8 @@ class BucketTransform(Transform[S, int]): _num_buckets: PositiveInt = PrivateAttr() def __init__(self, num_buckets: int, **data: Any) -> None: - self._num_buckets = num_buckets super().__init__(f"bucket[{num_buckets}]", **data) + self._num_buckets = num_buckets @property def num_buckets(self) -> int: