Skip to content

Commit a9f54b3

Browse files
authored
chore: clean assorted (#2787)
* clean assorted * typo
1 parent 4d73399 commit a9f54b3

File tree

7 files changed

+12
-17
lines changed

7 files changed

+12
-17
lines changed

tests/expr_and_series/str/to_datetime_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def test_to_datetime_series_infer_fmt(
151151
def test_to_datetime_infer_fmt_from_date(
152152
constructor: Constructor, request: pytest.FixtureRequest
153153
) -> None:
154-
if "duckdb" in str(constructor) or "ibis" in str(constructor):
154+
if any(x in str(constructor) for x in ("duckdb", "ibis")):
155155
request.applymarker(pytest.mark.xfail)
156156
data = {"z": ["2020-01-01", "2020-01-02", None]}
157157
if "pyspark" in str(constructor):

tests/expr_and_series/unary_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_unary_one_element(
156156

157157
def test_unary_one_element_series(constructor_eager: ConstructorEager) -> None:
158158
data = {"a": [1], "b": [2], "c": [None]}
159-
df = nw.from_native(constructor_eager(data))
159+
df = nw.from_native(constructor_eager(data), eager_only=True)
160160
result = {
161161
"a_nunique": [df["a"].n_unique()],
162162
"a_skew": [df["a"].skew()],

tests/frame/group_by_test.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,8 @@ def test_no_agg(constructor: Constructor) -> None:
284284

285285

286286
def test_group_by_categorical(constructor: Constructor) -> None:
287-
if (
288-
("pyspark" in str(constructor))
289-
or "duckdb" in str(constructor)
290-
or "ibis" in str(constructor)
291-
):
292-
pytest.skip(reason="DuckDB, PySpark, and Ibis do not support categorical types")
287+
if any(x in str(constructor) for x in ("pyspark", "duckdb", "ibis")):
288+
pytest.skip(reason="no categorical support")
293289
if "pyarrow_table" in str(constructor) and PYARROW_VERSION < (
294290
15,
295291
): # pragma: no cover

tests/v1_test.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,9 @@ def test_cast_to_enum_v1(
260260
request: pytest.FixtureRequest, constructor: Constructor
261261
) -> None:
262262
# Backends that do not (yet) support Enum dtype
263-
if (
264-
any(
265-
backend in str(constructor)
266-
for backend in ["pyarrow_table", "sqlframe", "pyspark", "ibis"]
267-
)
268-
or str(constructor) == "modin"
263+
if any(
264+
backend in str(constructor)
265+
for backend in ("pyarrow_table", "sqlframe", "pyspark", "ibis")
269266
):
270267
request.applymarker(pytest.mark.xfail)
271268

tpch/execute.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
"sqlframe": (sqlframe, {"session": DuckDBSession()}),
3939
}
4040

41-
DUCKDB_SKIPS = ["q15"]
41+
DUCKDB_SKIPS = [
42+
"q15" # needs `filter` which works with window expressions
43+
]
4244

4345
QUERY_DATA_PATH_MAP = {
4446
"q1": (LINEITEM_PATH,),

tpch/queries/q14.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def query(line_item_ds: FrameT, part_ds: FrameT) -> FrameT:
1919
.select(
2020
(
2121
100.00
22-
* nw.when(nw.col("p_type").str.contains("PROMO*"))
22+
* nw.when(nw.col("p_type").str.starts_with("PROMO"))
2323
.then(nw.col("l_extendedprice") * (1 - nw.col("l_discount")))
2424
.otherwise(0)
2525
.sum()

tpch/queries/q9.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def query(
2626
)
2727
.join(orders_ds, left_on="l_orderkey", right_on="o_orderkey")
2828
.join(nation_ds, left_on="s_nationkey", right_on="n_nationkey")
29-
.filter(nw.col("p_name").str.contains("green"))
29+
.filter(nw.col("p_name").str.contains("green", literal=True))
3030
.select(
3131
nw.col("n_name").alias("nation"),
3232
nw.col("o_orderdate").dt.year().alias("o_year"),

0 commit comments

Comments
 (0)