Skip to content

Commit 9bff326

Browse files
authored
Fix expression tests (#2632)
`test_not_equal_to_invert` should test unbound References, Bound one are tested here: https://github.com/apache/iceberg-python/blob/d99936a6aa1758577c27532eb4f91bd15053ce92/tests/expressions/test_expressions.py#L363-L373 <!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change ## Are these changes tested? ## Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent d99936a commit 9bff326

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

tests/expressions/test_expressions.py

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -427,51 +427,33 @@ def test_bound_less_than_or_equal_invert(table_schema_simple: Schema) -> None:
427427

428428
def test_not_equal_to_invert() -> None:
429429
bound = NotEqualTo(
430-
term=BoundReference( # type: ignore
431-
field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
432-
accessor=Accessor(position=0, inner=None),
433-
),
430+
term=Reference("foo"),
434431
literal="hello",
435432
)
436433
assert ~bound == EqualTo(
437-
term=BoundReference( # type: ignore
438-
field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
439-
accessor=Accessor(position=0, inner=None),
440-
),
434+
term=Reference("foo"),
441435
literal="hello",
442436
)
443437

444438

445439
def test_greater_than_or_equal_invert() -> None:
446440
bound = GreaterThanOrEqual(
447-
term=BoundReference( # type: ignore
448-
field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
449-
accessor=Accessor(position=0, inner=None),
450-
),
441+
term=Reference("foo"),
451442
literal="hello",
452443
)
453444
assert ~bound == LessThan(
454-
term=BoundReference( # type: ignore
455-
field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
456-
accessor=Accessor(position=0, inner=None),
457-
),
445+
term=Reference("foo"),
458446
literal="hello",
459447
)
460448

461449

462450
def test_less_than_or_equal_invert() -> None:
463451
bound = LessThanOrEqual(
464-
term=BoundReference( # type: ignore
465-
field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
466-
accessor=Accessor(position=0, inner=None),
467-
),
452+
term=Reference("foo"),
468453
literal="hello",
469454
)
470455
assert ~bound == GreaterThan(
471-
term=BoundReference( # type: ignore
472-
field=NestedField(field_id=1, name="foo", field_type=StringType(), required=False),
473-
accessor=Accessor(position=0, inner=None),
474-
),
456+
term=Reference("foo"),
475457
literal="hello",
476458
)
477459

0 commit comments

Comments
 (0)