Skip to content

Commit 5acca48

Browse files
authored
Remove deprecated code for 0.10 (#2345)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change [AddSchemaUpdate openapi spec](https://github.com/apache/iceberg/blob/6017fec2b67884424f152e497424e48414c4a4f3/open-api/rest-catalog-open-api.yaml#L2759-L2767) # Are these changes tested? # Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent 610a154 commit 5acca48

File tree

5 files changed

+3
-16
lines changed

5 files changed

+3
-16
lines changed

pyiceberg/table/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def _initial_changes(self, table_metadata: TableMetadata) -> None:
957957

958958
schema: Schema = table_metadata.schema()
959959
self._updates += (
960-
AddSchemaUpdate(schema_=schema, last_column_id=schema.highest_field_id),
960+
AddSchemaUpdate(schema_=schema),
961961
SetCurrentSchemaUpdate(schema_id=-1),
962962
)
963963

pyiceberg/table/update/__init__.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
transform_dict_value_to_str,
5050
)
5151
from pyiceberg.utils.datetime import datetime_to_millis
52-
from pyiceberg.utils.deprecated import deprecation_notice
5352
from pyiceberg.utils.properties import property_as_int
5453

5554
if TYPE_CHECKING:
@@ -92,16 +91,6 @@ class UpgradeFormatVersionUpdate(IcebergBaseModel):
9291
class AddSchemaUpdate(IcebergBaseModel):
9392
action: Literal["add-schema"] = Field(default="add-schema")
9493
schema_: Schema = Field(alias="schema")
95-
# This field is required: https://github.com/apache/iceberg/pull/7445
96-
last_column_id: Optional[int] = Field(
97-
alias="last-column-id",
98-
default=None,
99-
deprecated=deprecation_notice(
100-
deprecated_in="0.9.0",
101-
removed_in="0.10.0",
102-
help_message="last-field-id is handled internally, and should not be part of the update.",
103-
),
104-
)
10594

10695

10796
class SetCurrentSchemaUpdate(IcebergBaseModel):

pyiceberg/table/update/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,8 @@ def _commit(self) -> UpdatesAndRequirements:
634634
if existing_schema_id != self._schema.schema_id:
635635
requirements += (AssertCurrentSchemaId(current_schema_id=self._schema.schema_id),)
636636
if existing_schema_id is None:
637-
last_column_id = max(self._transaction.table_metadata.last_column_id, new_schema.highest_field_id)
638637
updates += (
639-
AddSchemaUpdate(schema=new_schema, last_column_id=last_column_id),
638+
AddSchemaUpdate(schema=new_schema),
640639
SetCurrentSchemaUpdate(schema_id=-1),
641640
)
642641
else:

tests/catalog/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def test_commit_table(catalog: InMemoryCatalog) -> None:
486486
response = given_table.catalog.commit_table(
487487
given_table,
488488
updates=(
489-
AddSchemaUpdate(schema=new_schema, last_column_id=new_schema.highest_field_id),
489+
AddSchemaUpdate(schema=new_schema),
490490
SetCurrentSchemaUpdate(schema_id=-1),
491491
),
492492
requirements=(),

tests/catalog/test_rest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,6 @@ def test_create_staged_table_200(
11221122
"schema-id": 0,
11231123
"identifier-field-ids": [],
11241124
},
1125-
"last-column-id": 2,
11261125
},
11271126
{"action": "set-current-schema", "schema-id": -1},
11281127
{"action": "add-spec", "spec": {"spec-id": 0, "fields": []}},

0 commit comments

Comments
 (0)