Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use Narwhals stable api #685

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ maintainers = [
]

dependencies = [
"narwhals>=0.8.13",
"narwhals>=1.0.0",
"pandas>=1.1.5",
"scikit-learn>=1.0",
"importlib-metadata >= 1.0; python_version < '3.8'",
Expand Down
2 changes: 1 addition & 1 deletion sklego/linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from inspect import signature
from warnings import warn

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
from scipy.optimize import minimize
from scipy.special._ufuncs import expit
Expand Down
2 changes: 1 addition & 1 deletion sklego/meta/_grouped_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import List

import narwhals as nw
import narwhals.stable.v1 as nw
import pandas as pd
from scipy.sparse import issparse
from sklearn.utils import check_array
Expand Down
2 changes: 1 addition & 1 deletion sklego/meta/_shrinkage_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from functools import partial

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
from sklearn.utils.validation import check_is_fitted

Expand Down
2 changes: 1 addition & 1 deletion sklego/meta/grouped_predictor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from copy import deepcopy
from typing import List, Union

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
import pandas as pd
from sklearn import clone
Expand Down
2 changes: 1 addition & 1 deletion sklego/meta/grouped_transformer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Union

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
from sklearn.base import BaseEstimator, MetaEstimatorMixin, TransformerMixin, clone
from sklearn.utils.validation import check_is_fitted
Expand Down
2 changes: 1 addition & 1 deletion sklego/meta/hierarchical_predictor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from warnings import warn

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
Expand Down
2 changes: 1 addition & 1 deletion sklego/meta/regression_outlier_detector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
from sklearn import clone
from sklearn.base import BaseEstimator, OutlierMixin
Expand Down
2 changes: 1 addition & 1 deletion sklego/model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from itertools import combinations
from warnings import warn

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
import pandas as pd
from sklearn.exceptions import NotFittedError
Expand Down
2 changes: 1 addition & 1 deletion sklego/pandas_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import inspect
from functools import partial, wraps

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
from scipy.ndimage import shift

Expand Down
2 changes: 1 addition & 1 deletion sklego/preprocessing/pandastransformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import warnings
from typing import Any

import narwhals as nw
import narwhals.stable.v1 as nw
from narwhals.dependencies import get_pandas
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_is_fitted
Expand Down
2 changes: 1 addition & 1 deletion sklego/preprocessing/projections.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_array
Expand Down
2 changes: 1 addition & 1 deletion tests/test_meta/test_hierarchical_predictor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from contextlib import nullcontext as does_not_raise
from random import randint

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
import pandas as pd
import polars as pl
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pandas_utils/test_pandas_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
import pandas as pd
import polars as pl
Expand Down
2 changes: 1 addition & 1 deletion tests/test_preprocessing/test_informationfilter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import narwhals as nw
import narwhals.stable.v1 as nw
import numpy as np
import pandas as pd
import polars as pl
Expand Down
Loading