File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -171,15 +171,14 @@ def __repr__(self) -> str:
171171 return f"SortOrder({ fields } order_id={ self .order_id } )"
172172
173173 def check_compatible (self , schema : Schema ) -> None :
174- schema_ids = schema ._lazy_id_to_field
175174 for field in self .fields :
176- if source_field := schema_ids .get (field .source_id ):
177- if not source_field .field_type .is_primitive :
178- raise ValidationError (f"Cannot sort by non-primitive source field: { source_field } " )
179- if not field .transform .can_transform (source_field .field_type ):
180- raise ValidationError (f"Invalid source type { source_field .field_type } for transform: { field .transform } " )
181- else :
175+ source_field = schema ._lazy_id_to_field .get (field .source_id )
176+ if source_field is None :
182177 raise ValidationError (f"Cannot find source column for sort field: { field } " )
178+ if not source_field .field_type .is_primitive :
179+ raise ValidationError (f"Cannot sort by non-primitive source field: { source_field } " )
180+ if not field .transform .can_transform (source_field .field_type ):
181+ raise ValidationError (f"Invalid source type { source_field .field_type } for transform: { field .transform } " )
183182
184183
185184UNSORTED_SORT_ORDER_ID = 0
You can’t perform that action at this time.
0 commit comments