Skip to content

Commit

Permalink
fail pyarrow on windows, use replace_time_zone
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Jan 18, 2025
1 parent 4f05167 commit e5493e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions narwhals/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,7 @@ def _from_native_impl( # noqa: PLR0915
raise TypeError(msg)
return native_object
if (
parse_version(get_dask().__version__) <= (2024, 12, 1)
and get_dask_expr() is None
parse_version(get_dask().__version__) < (2025, 1) and get_dask_expr() is None
): # pragma: no cover
msg = "Please install dask-expr"
raise ImportError(msg)
Expand Down
10 changes: 5 additions & 5 deletions tests/selectors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from tests.utils import PYARROW_VERSION
from tests.utils import Constructor
from tests.utils import assert_equal_data
from tests.utils import is_windows

data = {
"a": [1, 1, 2],
Expand Down Expand Up @@ -79,12 +80,11 @@ def test_datetime(constructor: Constructor, request: pytest.FixtureRequest) -> N
"pyspark" in str(constructor)
or "duckdb" in str(constructor)
or "dask" in str(constructor)
or ("pyarrow_table" in str(constructor) and PYARROW_VERSION < (12,))
or ("pyarrow" in str(constructor) and is_windows())
):
request.applymarker(pytest.mark.xfail)

if "pyarrow_table" in str(constructor) and PYARROW_VERSION < (12,):
request.applymarker(pytest.mark.xfail)

ts1 = datetime(2000, 11, 20, 18, 12, 16, 600000)
ts2 = datetime(2020, 10, 30, 10, 20, 25, 123000)

Expand All @@ -102,14 +102,14 @@ def test_datetime(constructor: Constructor, request: pytest.FixtureRequest) -> N
],
*[
nw.col("ts")
.dt.convert_time_zone("Europe/Lisbon")
.dt.replace_time_zone("Europe/Lisbon")
.cast(nw.Datetime(time_zone="Europe/Lisbon", time_unit=tu))
.alias(f"ts_lisbon_{tu}")
for tu in time_units
],
*[
nw.col("ts")
.dt.convert_time_zone("Europe/Berlin")
.dt.replace_time_zone("Europe/Berlin")
.cast(nw.Datetime(time_zone="Europe/Berlin", time_unit=tu))
.alias(f"ts_berlin_{tu}")
for tu in time_units
Expand Down

0 comments on commit e5493e1

Please sign in to comment.