Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jul 2, 2023
1 parent 705835f commit 3749454
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
4 changes: 0 additions & 4 deletions py-polars/tests/unit/io/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ def create_temp_sqlite_db(test_db: str) -> None:
"date": pl.Date,
},
[date(2020, 1, 1), date(2021, 12, 31)],
marks=pytest.mark.skipif(
sys.version_info < (3, 8),
reason="connectorx not available below Python 3.8",
),
),
pytest.param(
"adbc",
Expand Down
13 changes: 3 additions & 10 deletions py-polars/tests/unit/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -3714,19 +3714,12 @@ def test_rolling_apply() -> None:


def test_ufunc() -> None:
# NOTE: unfortunately we must use cast instead of a type: ignore comment
# 1. CI job with Python 3.10, numpy==1.23.1 -> mypy complains about arg-type
# 2. so we try to resolve it with type: ignore[arg-type]
# 3. CI job with Python 3.7, numpy==1.21.6 -> mypy complains about
# unused type: ignore comment
# for more information, see: https://github.com/python/mypy/issues/8823

df = pl.DataFrame([pl.Series("a", [1, 2, 3, 4], dtype=pl.UInt8)])
out = df.select(
[
np.power(cast(Any, pl.col("a")), 2).alias("power_uint8"),
np.power(cast(Any, pl.col("a")), 2.0).alias("power_float64"),
np.power(cast(Any, pl.col("a")), 2, dtype=np.uint16).alias("power_uint16"),
np.power(pl.col("a"), 2).alias("power_uint8"), # type: ignore[call-overload]
np.power(pl.col("a"), 2.0).alias("power_float64"), # type: ignore[call-overload]
np.power(pl.col("a"), 2, dtype=np.uint16).alias("power_uint16"), # type: ignore[call-overload]
]
)
expected = pl.DataFrame(
Expand Down
9 changes: 0 additions & 9 deletions py-polars/tests/unit/test_interchange.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from typing import Any

import pandas as pd
Expand Down Expand Up @@ -57,10 +56,6 @@ def test_from_dataframe() -> None:
assert_frame_equal(result, df)


@pytest.mark.xfail(
sys.version_info < (3, 8),
reason="Pandas does not implement the protocol on Python 3.7",
)
def test_from_dataframe_pandas() -> None:
data = {"a": [1, 2], "b": [3.0, 4.0], "c": ["foo", "bar"]}

Expand All @@ -71,10 +66,6 @@ def test_from_dataframe_pandas() -> None:
assert_frame_equal(result, expected)


@pytest.mark.xfail(
sys.version_info < (3, 8),
reason="Pandas does not implement the protocol on Python 3.7",
)
def test_from_dataframe_allow_copy() -> None:
# Zero copy only allowed when input is already a Polars dataframe
df = pl.DataFrame({"a": [1, 2]})
Expand Down

0 comments on commit 3749454

Please sign in to comment.