|
67 | 67 | from pyiceberg.schema import Accessor, Schema |
68 | 68 | from pyiceberg.typedef import Record |
69 | 69 | from pyiceberg.types import ( |
| 70 | + DateType, |
70 | 71 | DecimalType, |
71 | 72 | DoubleType, |
72 | 73 | FloatType, |
@@ -1150,6 +1151,26 @@ def test_above_int_bounds_greater_than_or_equal( |
1150 | 1151 | assert GreaterThanOrEqual("a", below_int_min).bind(int_schema) is AlwaysTrue() |
1151 | 1152 |
|
1152 | 1153 |
|
| 1154 | +@pytest.fixture |
| 1155 | +def date_schema() -> Schema: |
| 1156 | + return Schema(NestedField(field_id=1, name="a", field_type=DateType(), required=False)) |
| 1157 | + |
| 1158 | + |
| 1159 | +def test_above_date_bounds_equal_to(date_schema: Schema, above_int_max: Literal[int], below_int_min: Literal[int]) -> None: |
| 1160 | + assert EqualTo("a", above_int_max).bind(date_schema) is AlwaysFalse() |
| 1161 | + assert EqualTo("a", below_int_min).bind(date_schema) is AlwaysFalse() |
| 1162 | + |
| 1163 | + |
| 1164 | +def test_above_date_bounds_less_than(date_schema: Schema, above_int_max: Literal[int], below_int_min: Literal[int]) -> None: |
| 1165 | + assert LessThan("a", above_int_max).bind(date_schema) is AlwaysTrue() |
| 1166 | + assert LessThan("a", below_int_min).bind(date_schema) is AlwaysFalse() |
| 1167 | + |
| 1168 | + |
| 1169 | +def test_above_date_bounds_greater_than(date_schema: Schema, above_int_max: Literal[int], below_int_min: Literal[int]) -> None: |
| 1170 | + assert GreaterThan("a", above_int_max).bind(date_schema) is AlwaysFalse() |
| 1171 | + assert GreaterThan("a", below_int_min).bind(date_schema) is AlwaysTrue() |
| 1172 | + |
| 1173 | + |
1153 | 1174 | @pytest.fixture |
1154 | 1175 | def float_schema() -> Schema: |
1155 | 1176 | return Schema(NestedField(field_id=1, name="a", field_type=FloatType(), required=False)) |
|
0 commit comments