This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 01b29dd640 Build: Bump datamodel-code-generator from 0.36.0 to 0.41.0 
(#14791)
01b29dd640 is described below

commit 01b29dd6403c8cc1fad084c3e11f2cb4fe88177e
Author: Yuya Ebihara <[email protected]>
AuthorDate: Mon Dec 8 22:57:20 2025 +0900

    Build: Bump datamodel-code-generator from 0.36.0 to 0.41.0 (#14791)
    
    * Build: Bump datamodel-code-generator from 0.36.0 to 0.37.0
    
    * Build: Bump datamodel-code-generator from 0.37.0 to 0.38.0
    
    * Build: Bump datamodel-code-generator from 0.38.0 to 0.39.0
    
    * Build: Bump datamodel-code-generator from 0.39.0 to 0.40.0
    
    * Build: Bump datamodel-code-generator from 0.40.0 to 0.41.0
---
 open-api/requirements.txt         |   2 +-
 open-api/rest-catalog-open-api.py | 295 +++++++++++++++++++++++++++++---------
 2 files changed, 227 insertions(+), 70 deletions(-)

diff --git a/open-api/requirements.txt b/open-api/requirements.txt
index fcc9285b35..7f8a743811 100644
--- a/open-api/requirements.txt
+++ b/open-api/requirements.txt
@@ -16,5 +16,5 @@
 # under the License.
 
 openapi-spec-validator==0.7.2
-datamodel-code-generator==0.36.0
+datamodel-code-generator==0.41.0
 yamllint==1.37.1
diff --git a/open-api/rest-catalog-open-api.py 
b/open-api/rest-catalog-open-api.py
index 6627e4516b..9b4fd0c6a8 100644
--- a/open-api/rest-catalog-open-api.py
+++ b/open-api/rest-catalog-open-api.py
@@ -15,6 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
+
 from __future__ import annotations
 
 from datetime import date, timedelta
@@ -298,22 +299,22 @@ class BaseUpdate(BaseModel):
     action: str
 
 
-class AssignUUIDUpdate(BaseUpdate):
+class AssignUUIDUpdate(BaseModel):
     """
     Assigning a UUID to a table/view should only be done when creating the 
table/view. It is not safe to re-assign the UUID if a table/view already has a 
UUID assigned
     """
 
-    action: str = Field('assign-uuid', const=True)
+    action: str = Field(..., const=True)
     uuid: str
 
 
-class UpgradeFormatVersionUpdate(BaseUpdate):
-    action: str = Field('upgrade-format-version', const=True)
+class UpgradeFormatVersionUpdate(BaseModel):
+    action: str = Field(..., const=True)
     format_version: int = Field(..., alias='format-version')
 
 
-class SetCurrentSchemaUpdate(BaseUpdate):
-    action: str = Field('set-current-schema', const=True)
+class SetCurrentSchemaUpdate(BaseModel):
+    action: str = Field(..., const=True)
     schema_id: int = Field(
         ...,
         alias='schema-id',
@@ -321,13 +322,13 @@ class SetCurrentSchemaUpdate(BaseUpdate):
     )
 
 
-class AddPartitionSpecUpdate(BaseUpdate):
-    action: str = Field('add-spec', const=True)
+class AddPartitionSpecUpdate(BaseModel):
+    action: str = Field(..., const=True)
     spec: PartitionSpec
 
 
-class SetDefaultSpecUpdate(BaseUpdate):
-    action: str = Field('set-default-spec', const=True)
+class SetDefaultSpecUpdate(BaseModel):
+    action: str = Field(..., const=True)
     spec_id: int = Field(
         ...,
         alias='spec-id',
@@ -335,13 +336,13 @@ class SetDefaultSpecUpdate(BaseUpdate):
     )
 
 
-class AddSortOrderUpdate(BaseUpdate):
-    action: str = Field('add-sort-order', const=True)
+class AddSortOrderUpdate(BaseModel):
+    action: str = Field(..., const=True)
     sort_order: SortOrder = Field(..., alias='sort-order')
 
 
-class SetDefaultSortOrderUpdate(BaseUpdate):
-    action: str = Field('set-default-sort-order', const=True)
+class SetDefaultSortOrderUpdate(BaseModel):
+    action: str = Field(..., const=True)
     sort_order_id: int = Field(
         ...,
         alias='sort-order-id',
@@ -349,48 +350,53 @@ class SetDefaultSortOrderUpdate(BaseUpdate):
     )
 
 
-class AddSnapshotUpdate(BaseUpdate):
-    action: str = Field('add-snapshot', const=True)
+class AddSnapshotUpdate(BaseModel):
+    action: str = Field(..., const=True)
     snapshot: Snapshot
 
 
-class SetSnapshotRefUpdate(BaseUpdate, SnapshotReference):
-    action: str = Field('set-snapshot-ref', const=True)
+class SetSnapshotRefUpdate(BaseModel):
+    action: str = Field(..., const=True)
     ref_name: str = Field(..., alias='ref-name')
+    type: Literal['tag', 'branch']
+    snapshot_id: int = Field(..., alias='snapshot-id')
+    max_ref_age_ms: Optional[int] = Field(None, alias='max-ref-age-ms')
+    max_snapshot_age_ms: Optional[int] = Field(None, 
alias='max-snapshot-age-ms')
+    min_snapshots_to_keep: Optional[int] = Field(None, 
alias='min-snapshots-to-keep')
 
 
-class RemoveSnapshotsUpdate(BaseUpdate):
-    action: str = Field('remove-snapshots', const=True)
+class RemoveSnapshotsUpdate(BaseModel):
+    action: str = Field(..., const=True)
     snapshot_ids: List[int] = Field(..., alias='snapshot-ids')
 
 
-class RemoveSnapshotRefUpdate(BaseUpdate):
-    action: str = Field('remove-snapshot-ref', const=True)
+class RemoveSnapshotRefUpdate(BaseModel):
+    action: str = Field(..., const=True)
     ref_name: str = Field(..., alias='ref-name')
 
 
-class SetLocationUpdate(BaseUpdate):
-    action: str = Field('set-location', const=True)
+class SetLocationUpdate(BaseModel):
+    action: str = Field(..., const=True)
     location: str
 
 
-class SetPropertiesUpdate(BaseUpdate):
-    action: str = Field('set-properties', const=True)
+class SetPropertiesUpdate(BaseModel):
+    action: str = Field(..., const=True)
     updates: Dict[str, str]
 
 
-class RemovePropertiesUpdate(BaseUpdate):
-    action: str = Field('remove-properties', const=True)
+class RemovePropertiesUpdate(BaseModel):
+    action: str = Field(..., const=True)
     removals: List[str]
 
 
-class AddViewVersionUpdate(BaseUpdate):
-    action: str = Field('add-view-version', const=True)
+class AddViewVersionUpdate(BaseModel):
+    action: str = Field(..., const=True)
     view_version: ViewVersion = Field(..., alias='view-version')
 
 
-class SetCurrentViewVersionUpdate(BaseUpdate):
-    action: str = Field('set-current-view-version', const=True)
+class SetCurrentViewVersionUpdate(BaseModel):
+    action: str = Field(..., const=True)
     view_version_id: int = Field(
         ...,
         alias='view-version-id',
@@ -398,33 +404,33 @@ class SetCurrentViewVersionUpdate(BaseUpdate):
     )
 
 
-class RemoveStatisticsUpdate(BaseUpdate):
-    action: str = Field('remove-statistics', const=True)
+class RemoveStatisticsUpdate(BaseModel):
+    action: str = Field(..., const=True)
     snapshot_id: int = Field(..., alias='snapshot-id')
 
 
-class RemovePartitionStatisticsUpdate(BaseUpdate):
-    action: str = Field('remove-partition-statistics', const=True)
+class RemovePartitionStatisticsUpdate(BaseModel):
+    action: str = Field(..., const=True)
     snapshot_id: int = Field(..., alias='snapshot-id')
 
 
-class RemovePartitionSpecsUpdate(BaseUpdate):
-    action: str = Field('remove-partition-specs', const=True)
+class RemovePartitionSpecsUpdate(BaseModel):
+    action: str = Field(..., const=True)
     spec_ids: List[int] = Field(..., alias='spec-ids')
 
 
-class RemoveSchemasUpdate(BaseUpdate):
-    action: str = Field('remove-schemas', const=True)
+class RemoveSchemasUpdate(BaseModel):
+    action: str = Field(..., const=True)
     schema_ids: List[int] = Field(..., alias='schema-ids')
 
 
-class AddEncryptionKeyUpdate(BaseUpdate):
-    action: str = Field('add-encryption-key', const=True)
+class AddEncryptionKeyUpdate(BaseModel):
+    action: str = Field(..., const=True)
     encryption_key: EncryptedKey = Field(..., alias='encryption-key')
 
 
-class RemoveEncryptionKeyUpdate(BaseUpdate):
-    action: str = Field('remove-encryption-key', const=True)
+class RemoveEncryptionKeyUpdate(BaseModel):
+    action: str = Field(..., const=True)
     key_id: str = Field(..., alias='key-id')
 
 
@@ -432,7 +438,7 @@ class TableRequirement(BaseModel):
     type: str
 
 
-class AssertCreate(TableRequirement):
+class AssertCreate(BaseModel):
     """
     The table must not already exist; used for create transactions
     """
@@ -440,7 +446,7 @@ class AssertCreate(TableRequirement):
     type: str = Field(..., const=True)
 
 
-class AssertTableUUID(TableRequirement):
+class AssertTableUUID(BaseModel):
     """
     The table UUID must match the requirement's `uuid`
     """
@@ -449,7 +455,7 @@ class AssertTableUUID(TableRequirement):
     uuid: str
 
 
-class AssertRefSnapshotId(TableRequirement):
+class AssertRefSnapshotId(BaseModel):
     """
     The table branch or tag identified by the requirement's `ref` must 
reference the requirement's `snapshot-id`.
     The `snapshot-id` field is required in this object, but in the case of a 
`null`
@@ -457,53 +463,53 @@ class AssertRefSnapshotId(TableRequirement):
 
     """
 
-    type: str = Field('assert-ref-snapshot-id', const=True)
+    type: str = Field(..., const=True)
     ref: str
     snapshot_id: int = Field(..., alias='snapshot-id')
 
 
-class AssertLastAssignedFieldId(TableRequirement):
+class AssertLastAssignedFieldId(BaseModel):
     """
     The table's last assigned column id must match the requirement's 
`last-assigned-field-id`
     """
 
-    type: str = Field('assert-last-assigned-field-id', const=True)
+    type: str = Field(..., const=True)
     last_assigned_field_id: int = Field(..., alias='last-assigned-field-id')
 
 
-class AssertCurrentSchemaId(TableRequirement):
+class AssertCurrentSchemaId(BaseModel):
     """
     The table's current schema id must match the requirement's 
`current-schema-id`
     """
 
-    type: str = Field('assert-current-schema-id', const=True)
+    type: str = Field(..., const=True)
     current_schema_id: int = Field(..., alias='current-schema-id')
 
 
-class AssertLastAssignedPartitionId(TableRequirement):
+class AssertLastAssignedPartitionId(BaseModel):
     """
     The table's last assigned partition id must match the requirement's 
`last-assigned-partition-id`
     """
 
-    type: str = Field('assert-last-assigned-partition-id', const=True)
+    type: str = Field(..., const=True)
     last_assigned_partition_id: int = Field(..., 
alias='last-assigned-partition-id')
 
 
-class AssertDefaultSpecId(TableRequirement):
+class AssertDefaultSpecId(BaseModel):
     """
     The table's default spec id must match the requirement's `default-spec-id`
     """
 
-    type: str = Field('assert-default-spec-id', const=True)
+    type: str = Field(..., const=True)
     default_spec_id: int = Field(..., alias='default-spec-id')
 
 
-class AssertDefaultSortOrderId(TableRequirement):
+class AssertDefaultSortOrderId(BaseModel):
     """
     The table's default sort order id must match the requirement's 
`default-sort-order-id`
     """
 
-    type: str = Field('assert-default-sort-order-id', const=True)
+    type: str = Field(..., const=True)
     default_sort_order_id: int = Field(..., alias='default-sort-order-id')
 
 
@@ -911,7 +917,7 @@ class ContentFile(BaseModel):
     sort_order_id: Optional[int] = Field(None, alias='sort-order-id')
 
 
-class PositionDeleteFile(ContentFile):
+class PositionDeleteFile(BaseModel):
     content: Literal['position-deletes'] = Field(..., const=True)
     content_offset: Optional[int] = Field(
         None,
@@ -923,13 +929,55 @@ class PositionDeleteFile(ContentFile):
         alias='content-size-in-bytes',
         description='Length, in bytes, of the delete content; required if 
content-offset is present',
     )
+    file_path: str = Field(..., alias='file-path')
+    file_format: FileFormat = Field(..., alias='file-format')
+    spec_id: int = Field(..., alias='spec-id')
+    partition: List[PrimitiveTypeValue] = Field(
+        ...,
+        description='A list of partition field values ordered based on the 
fields of the partition spec specified by the `spec-id`',
+        example=[1, 'bar'],
+    )
+    file_size_in_bytes: int = Field(
+        ..., alias='file-size-in-bytes', description='Total file size in bytes'
+    )
+    record_count: int = Field(
+        ..., alias='record-count', description='Number of records in the file'
+    )
+    key_metadata: Optional[BinaryTypeValue] = Field(
+        None, alias='key-metadata', description='Encryption key metadata blob'
+    )
+    split_offsets: Optional[List[int]] = Field(
+        None, alias='split-offsets', description='List of splittable offsets'
+    )
+    sort_order_id: Optional[int] = Field(None, alias='sort-order-id')
 
 
-class EqualityDeleteFile(ContentFile):
+class EqualityDeleteFile(BaseModel):
     content: Literal['equality-deletes'] = Field(..., const=True)
     equality_ids: Optional[List[int]] = Field(
         None, alias='equality-ids', description='List of equality field IDs'
     )
+    file_path: str = Field(..., alias='file-path')
+    file_format: FileFormat = Field(..., alias='file-format')
+    spec_id: int = Field(..., alias='spec-id')
+    partition: List[PrimitiveTypeValue] = Field(
+        ...,
+        description='A list of partition field values ordered based on the 
fields of the partition spec specified by the `spec-id`',
+        example=[1, 'bar'],
+    )
+    file_size_in_bytes: int = Field(
+        ..., alias='file-size-in-bytes', description='Total file size in bytes'
+    )
+    record_count: int = Field(
+        ..., alias='record-count', description='Number of records in the file'
+    )
+    key_metadata: Optional[BinaryTypeValue] = Field(
+        None, alias='key-metadata', description='Encryption key metadata blob'
+    )
+    split_offsets: Optional[List[int]] = Field(
+        None, alias='split-offsets', description='List of splittable offsets'
+    )
+    sort_order_id: Optional[int] = Field(None, alias='sort-order-id')
 
 
 class FieldName(BaseModel):
@@ -946,6 +994,27 @@ class PlanTask(BaseModel):
     )
 
 
+class ResidualFilter1(BaseModel):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
+class ResidualFilter2(TrueExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
+class ResidualFilter3(FalseExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
 class CreateNamespaceRequest(BaseModel):
     namespace: Namespace
     properties: Optional[Dict[str, str]] = Field(
@@ -966,8 +1035,8 @@ class TransformTerm(BaseModel):
     term: Reference
 
 
-class SetPartitionStatisticsUpdate(BaseUpdate):
-    action: str = Field('set-partition-statistics', const=True)
+class SetPartitionStatisticsUpdate(BaseModel):
+    action: str = Field(..., const=True)
     partition_statistics: PartitionStatisticsFile = Field(
         ..., alias='partition-statistics'
     )
@@ -1021,7 +1090,7 @@ class ValueMap(BaseModel):
     )
 
 
-class DataFile(ContentFile):
+class DataFile(BaseModel):
     content: str = Field(..., const=True)
     first_row_id: Optional[int] = Field(
         None,
@@ -1056,6 +1125,27 @@ class DataFile(ContentFile):
         alias='upper-bounds',
         description='Map of column id to upper bound primitive type values',
     )
+    file_path: str = Field(..., alias='file-path')
+    file_format: FileFormat = Field(..., alias='file-format')
+    spec_id: int = Field(..., alias='spec-id')
+    partition: List[PrimitiveTypeValue] = Field(
+        ...,
+        description='A list of partition field values ordered based on the 
fields of the partition spec specified by the `spec-id`',
+        example=[1, 'bar'],
+    )
+    file_size_in_bytes: int = Field(
+        ..., alias='file-size-in-bytes', description='Total file size in bytes'
+    )
+    record_count: int = Field(
+        ..., alias='record-count', description='Number of records in the file'
+    )
+    key_metadata: Optional[BinaryTypeValue] = Field(
+        None, alias='key-metadata', description='Encryption key metadata blob'
+    )
+    split_offsets: Optional[List[int]] = Field(
+        None, alias='split-offsets', description='List of splittable offsets'
+    )
+    sort_order_id: Optional[int] = Field(None, alias='sort-order-id')
 
 
 class DeleteFile(BaseModel):
@@ -1072,8 +1162,8 @@ class Term(BaseModel):
     __root__: Union[Reference, TransformTerm]
 
 
-class SetStatisticsUpdate(BaseUpdate):
-    action: str = Field('set-statistics', const=True)
+class SetStatisticsUpdate(BaseModel):
+    action: str = Field(..., const=True)
     snapshot_id: Optional[int] = Field(
         None,
         alias='snapshot-id',
@@ -1099,6 +1189,27 @@ class SetExpression(BaseModel):
     values: List[PrimitiveTypeValue]
 
 
+class ResidualFilter6(SetExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
+class ResidualFilter7(LiteralExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
+class ResidualFilter8(UnaryExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
 class StructField(BaseModel):
     id: int
     name: str
@@ -1204,8 +1315,8 @@ class ViewMetadata(BaseModel):
     properties: Optional[Dict[str, str]] = None
 
 
-class AddSchemaUpdate(BaseUpdate):
-    action: str = Field('add-schema', const=True)
+class AddSchemaUpdate(BaseModel):
+    action: str = Field(..., const=True)
     schema_: Schema = Field(..., alias='schema')
     last_column_id: Optional[int] = Field(
         None,
@@ -1351,7 +1462,18 @@ class CommitTableRequest(BaseModel):
         None,
         description='Table identifier to update; must be present for 
CommitTransactionRequest',
     )
-    requirements: List[TableRequirement]
+    requirements: List[
+        Union[
+            AssertCreate,
+            AssertTableUUID,
+            AssertRefSnapshotId,
+            AssertLastAssignedFieldId,
+            AssertCurrentSchemaId,
+            AssertLastAssignedPartitionId,
+            AssertDefaultSpecId,
+            AssertDefaultSortOrderId,
+        ]
+    ]
     updates: List[TableUpdate]
 
 
@@ -1476,6 +1598,26 @@ class PlanTableScanRequest(BaseModel):
     )
 
 
+class ResidualFilter(BaseModel):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+    __root__: Union[
+        ResidualFilter2,
+        ResidualFilter3,
+        ResidualFilter4,
+        ResidualFilter5,
+        ResidualFilter6,
+        ResidualFilter7,
+        ResidualFilter8,
+    ] = Field(
+        ...,
+        description='An optional filter to be applied to rows in this file 
scan task.\nIf the residual is not present, the client must produce the 
residual or use the original filter.',
+    )
+
+
 class FileScanTask(BaseModel):
     data_file: DataFile = Field(..., alias='data-file')
     delete_file_references: Optional[List[int]] = Field(
@@ -1483,7 +1625,7 @@ class FileScanTask(BaseModel):
         alias='delete-file-references',
         description='A list of indices in the delete files array (0-based)',
     )
-    residual_filter: Optional[Expression] = Field(
+    residual_filter: Optional[ResidualFilter] = Field(
         None,
         alias='residual-filter',
         description='An optional filter to be applied to rows in this file 
scan task.\nIf the residual is not present, the client must produce the 
residual or use the original filter.',
@@ -1497,6 +1639,20 @@ class Schema(StructType):
     )
 
 
+class ResidualFilter4(AndOrExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
+class ResidualFilter5(NotExpression, ResidualFilter1):
+    """
+    An optional filter to be applied to rows in this file scan task.
+    If the residual is not present, the client must produce the residual or 
use the original filter.
+    """
+
+
 class CompletedPlanningResult(ScanTasks):
     """
     Completed server-side planning result
@@ -1540,6 +1696,7 @@ PlanTableScanResult.update_forward_refs()
 CreateTableRequest.update_forward_refs()
 CreateViewRequest.update_forward_refs()
 ReportMetricsRequest.update_forward_refs()
+ResidualFilter.update_forward_refs()
 CompletedPlanningResult.update_forward_refs()
 FetchScanTasksResult.update_forward_refs()
 CompletedPlanningWithIDResult.update_forward_refs()

Reply via email to