Skip to content

Commit 341f4fb

Browse files
committed
fix tets
1 parent c938f7b commit 341f4fb

File tree

4 files changed

+2
-37
lines changed

4 files changed

+2
-37
lines changed

daft/expressions/expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ def is_in(self, other: Any) -> Expression:
14571457
other = [Expression._to_expression(item) for item in other]
14581458
elif not isinstance(other, Expression):
14591459
series = item_to_series("items", other)
1460-
other = Expression._from_pyexpr(_series_lit(series._series))
1460+
other = [Expression._from_pyexpr(_series_lit(series._series))]
14611461
else:
14621462
other = [other]
14631463

tests/expressions/test_expressions.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from daft.expressions import col, lit
1212
from daft.expressions.testing import expr_structurally_equal
1313
from daft.recordbatch import MicroPartition
14-
from daft.series import Series
1514

1615

1716
@pytest.mark.parametrize(
@@ -25,7 +24,6 @@
2524
(b"a", DataType.binary()),
2625
(True, DataType.bool()),
2726
(None, DataType.null()),
28-
(Series.from_pylist([1, 2, 3]), DataType.int64()),
2927
(date(2023, 1, 1), DataType.date()),
3028
(time(1, 2, 3, 4), DataType.time(timeunit=TimeUnit.from_str("us"))),
3129
(datetime(2023, 1, 1), DataType.timestamp(timeunit=TimeUnit.from_str("us"))),
@@ -638,12 +636,6 @@ def test_duration_lit(input, expected) -> None:
638636
assert output == expected
639637

640638

641-
def test_repr_series_lit() -> None:
642-
s = lit(Series.from_pylist([1, 2, 3]))
643-
output = repr(s)
644-
assert output == "lit([1, 2, 3])"
645-
646-
647639
def test_list_value_counts():
648640
# Create a MicroPartition with a list column
649641
mp = MicroPartition.from_pydict(

tests/expressions/test_null_safe_equals.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -338,33 +338,6 @@ def test_left_nulls_all_types(type_name, left_data, right_data, expected_values)
338338
assert result_values == expected_values, f"Failed for {type_name} comparison"
339339

340340

341-
@pytest.mark.parametrize(
342-
"type_name,left_data,right_data",
343-
[
344-
("int", [1, 2, 3], [1, 2]),
345-
("float", [1.0, 2.0, 3.0], [1.0, 2.0]),
346-
("boolean", [True, False, True], [True, False]),
347-
("string", ["a", "b", "c"], ["a", "b"]),
348-
("binary", [b"a", b"b", b"c"], [b"a", b"b"]),
349-
("fixed_size_binary", [b"aaa", b"bbb", b"ccc"], [b"aaa", b"bbb"]),
350-
],
351-
)
352-
def test_length_mismatch_all_types(type_name, left_data, right_data):
353-
"""Test that length mismatches raise appropriate error for all data types."""
354-
# Create two separate tables
355-
left_table = MicroPartition.from_pydict({"value": left_data})
356-
right_table = MicroPartition.from_pydict({"value": right_data})
357-
358-
with pytest.raises(ValueError) as exc_info:
359-
result = left_table.eval_expression_list([col("value").eq_null_safe(right_table.get_column_by_name("value"))])
360-
# Force evaluation by accessing the result
361-
result.get_column_by_name("value").to_pylist()
362-
363-
# Verify error message format
364-
error_msg = str(exc_info.value)
365-
assert "trying to compare different length arrays" in error_msg
366-
367-
368341
@pytest.mark.parametrize(
369342
"type_name,left_data,right_data,expected_values",
370343
[

tests/expressions/typing/test_float.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_fill_nan(binary_data_fixture):
3636
lhs, rhs = binary_data_fixture
3737
assert_typing_resolve_vs_runtime_behavior(
3838
data=binary_data_fixture,
39-
expr=col(lhs.name()).float.fill_nan(rhs),
39+
expr=col(lhs.name()).float.fill_nan(col(rhs.name())),
4040
run_kernel=lambda: lhs.float.fill_nan(rhs),
4141
resolvable=(
4242
lhs.datatype() in (DataType.float32(), DataType.float64())

0 commit comments

Comments
 (0)