diff --git a/pyiceberg/partitioning.py b/pyiceberg/partitioning.py index df07f94342..ba4b3c5ded 100644 --- a/pyiceberg/partitioning.py +++ b/pyiceberg/partitioning.py @@ -59,6 +59,7 @@ UUIDType, ) from pyiceberg.utils.datetime import date_to_days, datetime_to_micros, time_to_micros +from pyiceberg.utils.deprecated import deprecation_message INITIAL_PARTITION_SPEC_ID = 0 PARTITION_FIELD_ID_START: int = 1000 @@ -101,6 +102,13 @@ def __init__( if name is not None: data["name"] = name + if data["source-id"]: + deprecation_message( + deprecated_in="0.10.0", + removed_in="0.11.0", + help_message="source-id is not allowed for Iceberg v3. Please use source-ids instead.", + ) + super().__init__(**data) @model_validator(mode="before") diff --git a/pyiceberg/table/sorting.py b/pyiceberg/table/sorting.py index 244c8ba867..e3543f2abc 100644 --- a/pyiceberg/table/sorting.py +++ b/pyiceberg/table/sorting.py @@ -30,6 +30,7 @@ from pyiceberg.transforms import IdentityTransform, Transform, parse_transform from pyiceberg.typedef import IcebergBaseModel from pyiceberg.types import IcebergType +from pyiceberg.utils.deprecated import deprecation_message class SortDirection(Enum): @@ -85,6 +86,14 @@ def __init__( data["direction"] = direction if null_order is not None: data["null-order"] = null_order + + if data["source-id"]: + deprecation_message( + deprecated_in="0.10.0", + removed_in="0.11.0", + help_message="source-id is not allowed for Iceberg v3. Please use source-ids instead.", + ) + super().__init__(**data) @model_validator(mode="before")