@@ -96,7 +96,7 @@ def offset(self) -> int:
96
96
return 0
97
97
98
98
@cache_readonly
99
- def dtype (self ):
99
+ def dtype (self ) -> tuple [ DtypeKind , int , str , str ] :
100
100
dtype = self ._col .dtype
101
101
102
102
if is_categorical_dtype (dtype ):
@@ -138,7 +138,7 @@ def _dtype_from_pandasdtype(self, dtype) -> tuple[DtypeKind, int, str, str]:
138
138
# Not a NumPy dtype. Check if it's a categorical maybe
139
139
raise ValueError (f"Data type { dtype } not supported by exchange protocol" )
140
140
141
- return ( kind , dtype .itemsize * 8 , dtype_to_arrow_c_fmt (dtype ), dtype .byteorder )
141
+ return kind , dtype .itemsize * 8 , dtype_to_arrow_c_fmt (dtype ), dtype .byteorder
142
142
143
143
@property
144
144
def describe_categorical (self ):
@@ -181,10 +181,10 @@ def null_count(self) -> int:
181
181
"""
182
182
Number of null elements. Should always be known.
183
183
"""
184
- return self ._col .isna ().sum ()
184
+ return self ._col .isna ().sum (). item ()
185
185
186
186
@property
187
- def metadata (self ):
187
+ def metadata (self ) -> dict [ str , pd . Index ] :
188
188
"""
189
189
Store specific metadata of the column.
190
190
"""
@@ -196,7 +196,7 @@ def num_chunks(self) -> int:
196
196
"""
197
197
return 1
198
198
199
- def get_chunks (self , n_chunks = None ):
199
+ def get_chunks (self , n_chunks : int | None = None ):
200
200
"""
201
201
Return an iterator yielding the chunks.
202
202
See `DataFrame.get_chunks` for details on ``n_chunks``.
0 commit comments