Skip to content

Commit 24c9f99

Browse files
fix: narwhals.stable.v1.dependencies was importing narwhals.dependencies (#2696)
* fix: narwhals.stable.v1.dependencies may have been importing narwhals.dependencies * Update tests/stable_v1_dependencies_test.py Co-authored-by: Dan Redding <[email protected]> --------- Co-authored-by: Dan Redding <[email protected]>
1 parent f7d9451 commit 24c9f99

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

narwhals/stable/v1/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from warnings import warn
66

77
import narwhals as nw
8-
from narwhals import dependencies, exceptions, functions as nw_f, selectors
8+
from narwhals import exceptions, functions as nw_f
99
from narwhals._typing_compat import TypeVar
1010
from narwhals._utils import (
1111
Implementation,
@@ -29,7 +29,7 @@
2929
from narwhals.functions import _new_series_impl, concat, show_versions
3030
from narwhals.schema import Schema as NwSchema
3131
from narwhals.series import Series as NwSeries
32-
from narwhals.stable.v1 import dtypes
32+
from narwhals.stable.v1 import dependencies, dtypes, selectors
3333
from narwhals.stable.v1.dtypes import (
3434
Array,
3535
Binary,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from __future__ import annotations
2+
3+
import pytest
4+
5+
pytest.importorskip("pandas")
6+
import pandas as pd
7+
8+
9+
def test_stable_v1_dependenies_import() -> None:
10+
# https://github.com/bokeh/bokeh/pull/14530#issuecomment-2984474111
11+
# Note: for some reason, this test needs to be in its own file to reproduce
12+
# the error observed in Bokeh's CI. Please don't move this test to
13+
# tests/v1_test.py.
14+
import narwhals.stable.v1 as nw_v1
15+
16+
df = nw_v1.from_native(pd.DataFrame({"a": [1, 2, 3]}))
17+
nw_v1.dependencies.is_pandas_dataframe(df)

0 commit comments

Comments
 (0)