From 0514c0ea11de27969efbeaf87960cc95389e4387 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 12 Jun 2026 07:49:02 -0700 Subject: [PATCH] Skip polars tests relying on newer sqlite features Some polars tests are failing on nightly CI, which runs with both latest and our earliest-supported dependencies. Some of the polars tests uses sqlite features not available with the Python / sqlite used in our earliest-supported matrix. This checks the sqlite version and skips the problematic tests. Closes https://github.com/rapidsai/cudf/issues/22850 --- .../cudf_polars/testing/inject_gpu_engine.py | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/python/cudf_polars/cudf_polars/testing/inject_gpu_engine.py b/python/cudf_polars/cudf_polars/testing/inject_gpu_engine.py index 3e7969a74900..77881c3de2a9 100644 --- a/python/cudf_polars/cudf_polars/testing/inject_gpu_engine.py +++ b/python/cudf_polars/cudf_polars/testing/inject_gpu_engine.py @@ -5,9 +5,11 @@ from __future__ import annotations +import sqlite3 from functools import partialmethod from typing import TYPE_CHECKING +import packaging.version import pytest import polars @@ -290,7 +292,7 @@ def pytest_report_header(config: pytest.Config) -> str: } -TESTS_TO_SKIP: Mapping[str, str] = { +TESTS_TO_SKIP: dict[str, str] = { "tests/unit/operations/test_profile.py::test_profile_with_cse": "Shape assertion won't match", # value_counts / struct-expansion row ordering is not guaranteed, so the GPU # result may or may not match CPU. Skip rather than xfail to avoid a flaky @@ -342,6 +344,31 @@ def pytest_report_header(config: pytest.Config) -> str: } +if packaging.version.parse(sqlite3.sqlite_version) <= packaging.version.parse("3.44.0"): + # These tests rely on features not available in older versions of sqlite. + TESTS_TO_SKIP.update( + { + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[SUM(x) FILTER (WHERE y > 20)-values0]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[AVG(x) FILTER (WHERE y > 20)-values1]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[MIN(x) FILTER (WHERE grp = 'a')-values2]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[MAX(x) FILTER (WHERE grp = 'a')-values3]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[COUNT(*) FILTER (WHERE grp = 'a')-values4]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[COUNT(1) FILTER (WHERE grp = 'a')-values5]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[COUNT(x) FILTER (WHERE grp = 'a')-values6]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[COUNT(x) FILTER (WHERE y > 20)-values7]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_grouped[COUNT(DISTINCT x) FILTER (WHERE y > 20)-values8]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_no_group_by[SUM(x) FILTER (WHERE y > 20)-13]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_no_group_by[AVG(x) FILTER (WHERE y > 20)-4.333333333333333]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_no_group_by[COUNT(*) FILTER (WHERE grp = 'a')-3]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_no_group_by[COUNT(x) FILTER (WHERE y > 20)-3]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_no_group_by[COUNT(DISTINCT x) FILTER (WHERE grp = 'b')-3]": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_filter_clause.py::test_filter_clause_multiple_aggs": 'sqlite3.OperationalError: near "AS": syntax error', + "tests/unit/sql/test_string_agg.py::test_string_agg_aliases[STRING_AGG]": 'sqlite3.OperationalError: near "ORDER": syntax error', + "tests/unit/sql/test_string_agg.py::test_string_agg_aliases[GROUP_CONCAT]": 'sqlite3.OperationalError: near "ORDER": syntax error', + } + ) + + # Generally skip for: # 1) Tests that are too slow with --inject-gpu-engine-blocksize=small due to many small partitions for large data STREAMING_ENGINE_TESTS_TO_SKIP: Mapping[str, str] = {