Skip to content

Commit a7b118b

Browse files
committed
lint, simplify
1 parent 8fcf6d6 commit a7b118b

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

pyiceberg/partitioning.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ def partition_type(self, schema: Schema) -> StructType:
225225
nested_fields = []
226226
schema_ids = index_by_id(schema)
227227
for field in self.fields:
228-
if field.source_id in schema_ids:
229-
source_field = schema.find_field(field.source_id)
228+
if source_field := schema_ids.get(field.source_id):
230229
result_type = field.transform.result_type(source_field.field_type)
231230
nested_fields.append(NestedField(field.field_id, field.name, result_type, required=source_field.required))
232231
else:

tests/integration/test_reads.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@
4848
from pyiceberg.io.pyarrow import (
4949
pyarrow_to_schema,
5050
)
51-
from pyiceberg.partitioning import PartitionField, PartitionSpec
5251
from pyiceberg.schema import Schema
5352
from pyiceberg.table import Table
54-
from pyiceberg.transforms import IdentityTransform
5553
from pyiceberg.types import (
5654
BinaryType,
5755
BooleanType,

0 commit comments

Comments
 (0)