Skip to content

Commit

Permalink
patch: use narwhals stable api (#685)
Browse files Browse the repository at this point in the history
Co-authored-by: vincent d warmerdam <vincentwarmerdam@gmail.com>
  • Loading branch information
MarcoGorelli and koaning authored Jul 9, 2024
1 parent d8a165e commit 3dac70f
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
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

0 comments on commit 3dac70f

Please sign in to comment.