Skip to content

Commit

Permalink
feat: make sure from narwhals.stable.v1.dependencies import works (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Nov 23, 2024
1 parent e3876d6 commit afd92dc
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 7 deletions.
1 change: 1 addition & 0 deletions narwhals/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ def is_into_dataframe(native_dataframe: Any) -> bool:
"is_ibis_table",
"is_pandas_dataframe",
"is_pandas_series",
"is_pandas_index",
"is_polars_dataframe",
"is_polars_lazyframe",
"is_polars_series",
Expand Down
57 changes: 57 additions & 0 deletions narwhals/stable/v1/dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from __future__ import annotations

from narwhals.dependencies import get_cudf
from narwhals.dependencies import get_ibis
from narwhals.dependencies import get_modin
from narwhals.dependencies import get_numpy
from narwhals.dependencies import get_pandas
from narwhals.dependencies import get_polars
from narwhals.dependencies import get_pyarrow
from narwhals.dependencies import is_cudf_dataframe
from narwhals.dependencies import is_cudf_series
from narwhals.dependencies import is_dask_dataframe
from narwhals.dependencies import is_ibis_table
from narwhals.dependencies import is_into_dataframe
from narwhals.dependencies import is_into_series
from narwhals.dependencies import is_modin_dataframe
from narwhals.dependencies import is_modin_series
from narwhals.dependencies import is_numpy_array
from narwhals.dependencies import is_pandas_dataframe
from narwhals.dependencies import is_pandas_index
from narwhals.dependencies import is_pandas_like_dataframe
from narwhals.dependencies import is_pandas_like_series
from narwhals.dependencies import is_pandas_series
from narwhals.dependencies import is_polars_dataframe
from narwhals.dependencies import is_polars_lazyframe
from narwhals.dependencies import is_polars_series
from narwhals.dependencies import is_pyarrow_chunked_array
from narwhals.dependencies import is_pyarrow_table

__all__ = [
"get_polars",
"get_pandas",
"get_modin",
"get_cudf",
"get_pyarrow",
"get_numpy",
"get_ibis",
"is_ibis_table",
"is_pandas_dataframe",
"is_pandas_series",
"is_pandas_index",
"is_polars_dataframe",
"is_polars_lazyframe",
"is_polars_series",
"is_modin_dataframe",
"is_modin_series",
"is_cudf_dataframe",
"is_cudf_series",
"is_pyarrow_table",
"is_pyarrow_chunked_array",
"is_numpy_array",
"is_dask_dataframe",
"is_pandas_like_dataframe",
"is_pandas_like_series",
"is_into_dataframe",
"is_into_series",
]
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import pyarrow as pa
import pytest

from narwhals.dependencies import get_cudf
from narwhals.dependencies import get_dask_dataframe
from narwhals.dependencies import get_modin
from narwhals.stable.v1.dependencies import get_cudf
from narwhals.stable.v1.dependencies import get_modin
from tests.utils import PANDAS_VERSION

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion tests/dependencies/is_into_dataframe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pyarrow as pa

import narwhals as nw
from narwhals.dependencies import is_into_dataframe
from narwhals.stable.v1.dependencies import is_into_dataframe

if TYPE_CHECKING:
from typing_extensions import Self
Expand Down
2 changes: 1 addition & 1 deletion tests/dependencies/is_into_series_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pyarrow as pa

import narwhals as nw
from narwhals.dependencies import is_into_series
from narwhals.stable.v1.dependencies import is_into_series

if TYPE_CHECKING:
from typing_extensions import Self
Expand Down
2 changes: 1 addition & 1 deletion tests/dependencies/is_pandas_dataframe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import polars as pl

from narwhals.dependencies import is_pandas_dataframe
from narwhals.stable.v1.dependencies import is_pandas_dataframe


def test_is_pandas_dataframe() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/dependencies/is_pandas_index_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pandas as pd

from narwhals.dependencies import is_pandas_index
from narwhals.stable.v1.dependencies import is_pandas_index


def test_is_pandas_index() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/translate/to_py_scalar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest

import narwhals.stable.v1 as nw
from narwhals.dependencies import get_cudf
from narwhals.stable.v1.dependencies import get_cudf
from tests.utils import PANDAS_VERSION


Expand Down

0 comments on commit afd92dc

Please sign in to comment.