Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdlineluser committed Oct 14, 2023
1 parent e08f828 commit 148e362
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions py-polars/tests/unit/sql/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,7 @@ def test_sql_unary_ops_8890(match_float: bool) -> None:
"d": [4, 4],
}


def test_sql_date() -> None:
df = pl.DataFrame(
{
Expand All @@ -1232,23 +1233,3 @@ def test_sql_date() -> None:
assert pl.select(
pl.sql_expr("""CAST(DATE('2023-03', '%Y-%m') as STRING)""")
).frame_equal(expected)


@pytest.mark.parametrize("match_float", [False, True])
def test_sql_unary_ops_8890(match_float: bool) -> None:
with pl.SQLContext(
df=pl.DataFrame({"a": [-2, -1, 1, 2], "b": ["w", "x", "y", "z"]}),
) as ctx:
in_values = "(-3.0, -1.0, +2.0, +4.0)" if match_float else "(-3, -1, +2, +4)"
res = ctx.execute(
f"""
SELECT *, -(3) as c, (+4) as d
FROM df WHERE a IN {in_values}
"""
)
assert res.collect().to_dict(False) == {
"a": [-1, 2],
"b": ["x", "z"],
"c": [-3, -3],
"d": [4, 4],
}

0 comments on commit 148e362

Please sign in to comment.