Skip to content

Commit

Permalink
Remvoe pandas 2 checks (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl committed Jul 1, 2024
1 parent fc02292 commit 1763c6f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
3 changes: 1 addition & 2 deletions dask_expr/_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from dask.array import chunk
from dask.array.reductions import moment_agg, moment_chunk, moment_combine, nannumel
from dask.dataframe import hyperloglog, methods
from dask.dataframe._compat import PANDAS_GE_200
from dask.dataframe.core import (
_concat,
_cov_corr_agg,
Expand Down Expand Up @@ -633,7 +632,7 @@ def chunk_kwargs(self):
out = {"keep": self.keep}
if is_dataframe_like(self.frame._meta):
out["subset"] = self.subset
if PANDAS_GE_200 and not is_index_like(self.frame._meta):
if not is_index_like(self.frame._meta):
out["ignore_index"] = self.ignore_index
return out

Expand Down
3 changes: 1 addition & 2 deletions dask_expr/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import sys

import pytest
from dask.dataframe._compat import PANDAS_GE_200

from dask_expr import new_collection
from dask_expr._expr import Lengths
Expand Down Expand Up @@ -124,7 +123,7 @@ def test_timeseries_gaph_size(seed):
graph_size = sys.getsizeof(pickle.dumps(df.dask))
graph_size_dd = sys.getsizeof(pickle.dumps(dict(ddf.dask)))
# Make sure we are close to the dask.dataframe graph size
threshold = 1.10 if PANDAS_GE_200 else 1.50
threshold = 1.10
assert graph_size < threshold * graph_size_dd


Expand Down
3 changes: 0 additions & 3 deletions dask_expr/tests/test_map_partitions_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np
import pytest
from dask.dataframe._compat import PANDAS_GE_200

from dask_expr import from_pandas, map_overlap, map_partitions
from dask_expr.tests._util import _backend_library, assert_eq
Expand Down Expand Up @@ -64,8 +63,6 @@ def test_map_partitions_merge(opt):
# Check result with/without fusion
expect = pdf1.merge(pdf2, on="x")
df3 = (df3.optimize() if opt else df3)[list(expect.columns)]
if not PANDAS_GE_200:
df3 = df3.reset_index(drop=True)
assert_eq(df3, expect, check_index=False)


Expand Down
10 changes: 1 addition & 9 deletions dask_expr/tests/test_string_accessor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from dask.dataframe._compat import PANDAS_GE_200

from dask_expr._collection import DataFrame, from_pandas
from dask_expr.tests._util import _backend_library, assert_eq
Expand Down Expand Up @@ -28,14 +27,7 @@ def dser(ser):
("contains", {"pat": "a"}),
("count", {"pat": "a"}),
("endswith", {"pat": "a"}),
pytest.param(
"extract",
{"pat": r"[ab](\d)"},
marks=pytest.mark.skipif(
not PANDAS_GE_200,
reason="Index metadata wrong for pandas<2.0",
),
),
("extract", {"pat": r"[ab](\d)"}),
("extractall", {"pat": r"[ab](\d)"}),
("find", {"sub": "a"}),
("findall", {"pat": "a"}),
Expand Down

0 comments on commit 1763c6f

Please sign in to comment.