rdblue commented on code in PR #5923:
URL: https://github.com/apache/iceberg/pull/5923#discussion_r988333750
##########
python/tests/expressions/test_expressions_base.py:
##########
@@ -300,138 +337,289 @@ def test_strs(op, string):
assert str(op) == string
-def test_ref_binding_case_sensitive(request):
- schema = request.getfixturevalue("table_schema_simple")
- ref = base.Reference("foo")
- bound = base.BoundReference(schema.find_field(1),
schema.accessor_for_field(1))
- assert ref.bind(schema, case_sensitive=True) == bound
+def test_ref_binding_case_sensitive(table_schema_simple: Schema):
+ ref = base.Reference[str]("foo")
+ bound = base.BoundReference[str](table_schema_simple.find_field(1),
table_schema_simple.accessor_for_field(1))
+ assert ref.bind(table_schema_simple, case_sensitive=True) == bound
-def test_ref_binding_case_sensitive_failure(request):
- schema = request.getfixturevalue("table_schema_simple")
- ref = base.Reference("Foo")
+def test_ref_binding_case_sensitive_failure(table_schema_simple: Schema):
+ ref = base.Reference[str]("Foo")
with pytest.raises(ValueError):
- ref.bind(schema, case_sensitive=True)
+ ref.bind(table_schema_simple, case_sensitive=True)
-def test_ref_binding_case_insensitive(request):
- schema = request.getfixturevalue("table_schema_simple")
- ref = base.Reference("Foo")
- bound = base.BoundReference(schema.find_field(1),
schema.accessor_for_field(1))
- assert ref.bind(schema, case_sensitive=False) == bound
+def test_ref_binding_case_insensitive(table_schema_simple: Schema):
+ ref = base.Reference[str]("Foo")
+ bound = base.BoundReference[str](table_schema_simple.find_field(1),
table_schema_simple.accessor_for_field(1))
+ assert ref.bind(table_schema_simple, case_sensitive=False) == bound
-def test_ref_binding_case_insensitive_failure(request):
- schema = request.getfixturevalue("table_schema_simple")
- ref = base.Reference("Foot")
+def test_ref_binding_case_insensitive_failure(table_schema_simple: Schema):
+ ref = base.Reference[str]("Foot")
with pytest.raises(ValueError):
- ref.bind(schema, case_sensitive=False)
+ ref.bind(table_schema_simple, case_sensitive=False)
def test_in_to_eq():
assert base.In(base.Reference("x"), (literal(34.56),)) ==
base.EqualTo(base.Reference("x"), literal(34.56))
-def test_bind_in(request):
- schema = request.getfixturevalue("table_schema_simple")
+def test_empty_bind_in(table_schema_simple: Schema):
+ bound = base.BoundIn[str](
Review Comment:
Yeah, it's a bit odd.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]