Skip to content

Commit

Permalink
test(duckdb): test against bugfix release 1.1.1 (ibis-project#10222)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored Sep 25, 2024
1 parent 3e73479 commit a54ecea
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 65 deletions.
8 changes: 6 additions & 2 deletions ibis/backends/duckdb/tests/test_geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import ibis
from ibis.conftest import LINUX, MACOS, SANDBOXED

duckdb = pytest.importorskip("duckdb")
gpd = pytest.importorskip("geopandas")
gtm = pytest.importorskip("geopandas.testing")
shapely = pytest.importorskip("shapely")
Expand Down Expand Up @@ -185,8 +186,11 @@ def test_geospatial_start_point(lines, lines_gdf):
methodcaller("union_all"),
marks=pytest.mark.xfail(
condition=(
vparse(gpd.__version__) < vparse("1")
or vparse(shapely.__version__) >= vparse("2.0.5")
vparse(duckdb.__version__) < vparse("1.1.1")
and (
vparse(gpd.__version__) < vparse("1")
or vparse(shapely.__version__) >= vparse("2.0.5")
)
),
raises=(AttributeError, AssertionError),
reason="union_all doesn't exist; shapely 2.0.5 results in a different value for union_all",
Expand Down
33 changes: 18 additions & 15 deletions ibis/backends/tests/test_asof_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,24 @@ def test_asof_join(con, time_left, time_right, time_df1, time_df2, direction, op
)
@pytest.mark.notyet(
[
"bigquery",
"datafusion",
"trino",
"postgres",
"mysql",
"pyspark",
"druid",
"impala",
"bigquery",
"exasol",
"oracle",
"flink",
"impala",
"mssql",
"sqlite",
"mysql",
"oracle",
"postgres",
"pyspark",
"risingwave",
"flink",
"sqlite",
"trino",
]
)
@pytest.mark.xfail_version(
duckdb=["duckdb>=0.10.2"], raises=DuckDBInvalidInputException
duckdb=["duckdb>=0.10.2,<1.1.1"], raises=DuckDBInvalidInputException
)
def test_keyed_asof_join_with_tolerance(
con,
Expand Down Expand Up @@ -172,8 +172,11 @@ def test_keyed_asof_join_with_tolerance(
result = result.sort_values(["key", "time"]).reset_index(drop=True)
expected = expected.sort_values(["key", "time"]).reset_index(drop=True)

tm.assert_frame_equal(result[expected.columns], expected)
with pytest.raises(AssertionError):
tm.assert_series_equal(result["time"], result["time_right"])
with pytest.raises(AssertionError):
tm.assert_series_equal(result["key"], result["key_right"])
tm.assert_frame_equal(
# drop `time` from comparison to avoid issues with different time resolution
result[expected.columns].drop(["time"], axis=1),
expected.drop(["time"], axis=1),
)

# check that time is equal in value, if not dtype
tm.assert_series_equal(result["time"], expected["time"], check_dtype=False)
100 changes: 53 additions & 47 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defusedxml==0.7.1 ; python_version >= "3.10" and python_version < "3.13"
deltalake==0.20.0 ; python_version >= "3.10" and python_version < "4.0"
distlib==0.3.8 ; python_version >= "3.10" and python_version < "4.0"
doit==0.36.0 ; python_version >= "3.10" and python_version < "3.13"
duckdb==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
duckdb==1.1.1 ; python_version >= "3.10" and python_version < "4.0"
dulwich==0.21.7 ; python_version >= "3.10" and python_version < "4.0"
dunamai==1.22.0 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11"
Expand Down

0 comments on commit a54ecea

Please sign in to comment.