Skip to content

Commit 08720a6

Browse files
author
Yftach Zur
committed
Fix typing import
1 parent d5bad11 commit 08720a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -815,12 +815,12 @@ class _ConvertToArrowExpression(BoundBooleanExpressionVisitor[pc.Expression]):
815815
If not provided, only the field name will be used (not dotted path).
816816
"""
817817

818-
_schema: Optional[Schema]
818+
_schema: Schema | None
819819

820-
def __init__(self, schema: Optional[Schema] = None):
820+
def __init__(self, schema: Schema | None = None):
821821
self._schema = schema
822822

823-
def _get_field_name(self, term: BoundTerm[Any]) -> Union[str, Tuple[str, ...]]:
823+
def _get_field_name(self, term: BoundTerm[Any]) -> str | Tuple[str, ...]:
824824
"""Get the field name or nested field path for a bound term.
825825
826826
For nested struct fields, returns a tuple of field names (e.g., ("mazeMetadata", "run_id")).
@@ -1020,7 +1020,7 @@ def collect(
10201020
boolean_expression_visit(expr, self)
10211021

10221022

1023-
def expression_to_pyarrow(expr: BooleanExpression, schema: Optional[Schema] = None) -> pc.Expression:
1023+
def expression_to_pyarrow(expr: BooleanExpression, schema: Schema | None = None) -> pc.Expression:
10241024
"""Convert an Iceberg boolean expression to a PyArrow expression.
10251025
10261026
Args:
@@ -1034,7 +1034,7 @@ def expression_to_pyarrow(expr: BooleanExpression, schema: Optional[Schema] = No
10341034
return boolean_expression_visit(expr, _ConvertToArrowExpression(schema))
10351035

10361036

1037-
def _expression_to_complementary_pyarrow(expr: BooleanExpression, schema: Optional[Schema] = None) -> pc.Expression:
1037+
def _expression_to_complementary_pyarrow(expr: BooleanExpression, schema: Schema | None = None) -> pc.Expression:
10381038
"""Complementary filter conversion function of expression_to_pyarrow.
10391039
10401040
Could not use expression_to_pyarrow(Not(expr)) to achieve this complementary effect because ~ in pyarrow.compute.Expression does not handle null.

0 commit comments

Comments
 (0)