Skip to content

Commit adb49da

Browse files
committed
Make spec tests pass
Signed-off-by: Vasily Litvinov <[email protected]>
1 parent ab48fec commit adb49da

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pandas/core/exchange/buffer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pandas.core.exchange.dataframe_protocol import Buffer, DlpackDeviceType, DtypeKind
1+
from pandas.core.exchange.dataframe_protocol import Buffer, DlpackDeviceType
22
import numpy as np
33
from typing import Tuple
44

pandas/core/exchange/column.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Buffer,
55
ColumnNullType,
66
)
7-
from pandas.core.exchange.buffer import PandasBuffer, buffer_to_ndarray
7+
from pandas.core.exchange.buffer import PandasBuffer
88
from pandas.core.exchange.utils import ArrowCTypes, Endianness, dtype_to_arrow_c_fmt
99
from pandas.api.types import is_categorical_dtype, is_string_dtype
1010
import pandas as pd

pandas/tests/exchange/test_protocol.py renamed to pandas/tests/exchange/test_spec_conformance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def test_categorical(df_from_dict):
7474
)
7575

7676
colX = df.__dataframe__().get_column_by_name("weekday")
77-
is_ordered, is_dictionary, _ = colX.describe_categorical
78-
assert isinstance(is_ordered, bool)
79-
assert isinstance(is_dictionary, bool)
77+
categorical = colX.describe_categorical
78+
assert isinstance(categorical["is_ordered"], bool)
79+
assert isinstance(categorical["is_dictionary"], bool)
8080

8181

8282
def test_dataframe(df_from_dict):
@@ -134,7 +134,7 @@ def test_buffer(df_from_dict):
134134

135135
assert dataBuf.bufsize > 0
136136
assert dataBuf.ptr != 0
137-
device, _ = dataBuf.__dlpack_device__
137+
device, _ = dataBuf.__dlpack_device__()
138138

139139
assert dataDtype[0] == 0
140140

0 commit comments

Comments
 (0)