Skip to content

Commit

Permalink
cleanup[2]
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev committed Apr 23, 2024
1 parent fb0ea59 commit 7e15ea9
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ jobs:
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV


- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install -r docs/requirements-docs.txt -e . pandas "polars<0.20.8" # modin[ray] @ git+https://github.com/modin-project/modin.git@abbbd03023f55d4ee9592c4c695308e10a97cb4c

- run: pip install -r docs/requirements-docs.txt -e . pandas "polars<0.20.8" # modin[ray]
- run: mkdocs gh-deploy --force
20 changes: 14 additions & 6 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,27 @@ jobs:
key: ${{ runner.os }}-build-${{ matrix.python-version }}
- name: install-reqs
run: python -m pip install --upgrade tox virtualenv setuptools pip -r requirements-dev.txt
- name: Run pytest
- name: Run pytest for pandas and polars
run: |
pytest tests --cov=dataframe_api_compat/pandas_standard --cov=tests --cov-append --cov-fail-under=50 --cov-report= --library pandas-numpy
pytest tests --cov=dataframe_api_compat/pandas_standard --cov=tests --cov-append --cov-fail-under=50 --cov-report= --library pandas-nullable
pytest tests --cov=dataframe_api_compat/polars_standard --cov=tests --cov-append --cov-fail-under=100 --library polars-lazy
- name: install type-checking reqs
run: python -m pip install 'git+https://github.com/data-apis/dataframe-api.git#egg=dataframe_api&subdirectory=spec/API_specification' mypy typing-extensions
- name: run mypy
run: mypy dataframe_api_compat tests
pytest tests --cov=dataframe_api_compat/polars_standard --cov=tests --cov-append --cov-fail-under=95 --library polars-lazy
- name: run polars integration tests
run: pip uninstall pandas -y && pytest tests/integration/upstream_test.py::TestPolars && pip install -U pandas
- name: run pandas integration tests
run: pip uninstall polars -y && pytest tests/integration/upstream_test.py::TestPandas
- name: Update env for modin
run: |
python -m pip uninstall -r requirements-dev.txt
python -m pip install -r requirements-dev-modin.txt
- name: Run pytest for modin
run: |
pytest tests --cov=dataframe_api_compat/modin_standard --cov=tests --cov-append --cov-fail-under=100 --library modin
- name: install type-checking reqs
run: python -m pip install 'git+https://github.com/data-apis/dataframe-api.git#egg=dataframe_api&subdirectory=spec/API_specification' mypy typing-extensions
- name: run mypy
run: mypy dataframe_api_compat tests


tox-modin:
strategy:
Expand Down
3 changes: 2 additions & 1 deletion dataframe_api_compat/modin_standard/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def rename(self, mapping: Mapping[str, str]) -> DataFrame:
self.dataframe.rename(columns=mapping),
)

def get_column_names(self) -> list[str]:
def get_column_names(self) -> list[str]: # pragma: no cover
# TODO: add a test after modin implements `__dataframe_consortium_standard__`
# DO NOT REMOVE
# This one is used in upstream tests - even if deprecated,
# just leave it in for backwards compatibility
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ line-length = 90
filterwarnings = [
"error",
'ignore:distutils Version classes are deprecated:DeprecationWarning',
# modin specific
'ignore:.*pkg_resources:DeprecationWarning',
'ignore:Ray execution environment not yet initialized:UserWarning',
"ignore:Distributing <class '.*'> object.:UserWarning",
Expand Down
3 changes: 1 addition & 2 deletions requirements-dev-modin.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
covdefaults
modin[ray] @ git+https://github.com/modin-project/modin.git@25d143ff3c6043104bda3c51a204eab626103eb4
polars
modin[ray]
pre-commit
pytest
pytest-cov
15 changes: 0 additions & 15 deletions tests/column/invalid_pandas_test.py

This file was deleted.

15 changes: 14 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,28 @@ def pytest_generate_tests(metafunc: Any) -> None:
metafunc.parametrize("library", lib_handlers, ids=libraries)


ci_skip_ids = [
# polars does not allow to create a dataframe with non-unique columns
"non_unique_column_names.py::test_repeated_columns[polars-lazy]",
]


ci_xfail_ids = [
# https://github.com/modin-project/modin/issues/7212
"join_test.py::test_join_left[modin]",
"join_test.py::test_join_two_keys[modin]",
"persistedness_test.py::test_cross_df_propagation[modin]",
# https://github.com/modin-project/modin/issues/3602
"aggregate_test.py::test_aggregate[modin]",
"aggregate_test.py::test_aggregate_only_size[modin]",
]


def pytest_collection_modifyitems(items: list[pytest.Item]) -> None:
def pytest_collection_modifyitems(items: list[pytest.Item]) -> None: # pragma: no cover
for item in items:
if any(id_ in item.nodeid for id_ in ci_xfail_ids):
item.add_marker(pytest.mark.xfail(strict=True))
elif any(id_ in item.nodeid for id_ in ci_skip_ids):
item.add_marker(
pytest.mark.skip("does not make sense for a specific implementation"),
)
6 changes: 0 additions & 6 deletions tests/groupby/aggregate_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import pytest

from tests.utils import BaseHandler
from tests.utils import compare_dataframe_with_reference
from tests.utils import integer_dataframe_4


def test_aggregate(library: BaseHandler) -> None:
if library.name == "modin":
pytest.skip("https://github.com/modin-project/modin/issues/3602")
df = integer_dataframe_4(library)
df = df.assign((df.col("b") > 0).rename("d"))
ns = df.__dataframe_namespace__()
Expand Down Expand Up @@ -62,8 +58,6 @@ def test_aggregate(library: BaseHandler) -> None:


def test_aggregate_only_size(library: BaseHandler) -> None:
if library.name == "modin":
pytest.skip("https://github.com/modin-project/modin/issues/3602")
df = integer_dataframe_4(library)
ns = df.__dataframe_namespace__()
result = (
Expand Down
2 changes: 2 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ def temporal_dataframe_1(library: BaseHandler) -> DataFrame:

df = pd.DataFrame(
{
# the data for column "a" differs from other implementations due to pandas 1.5 compat
# https://github.com/data-apis/dataframe-api-compat/commit/aeca5cf1a052033b72388e3f87ad8b70d66cedec
"a": [
datetime(2020, 1, 1, 1, 2, 1, 123000),
datetime(2020, 1, 2, 3, 1, 2, 321000),
Expand Down

0 comments on commit 7e15ea9

Please sign in to comment.