From d34a93333e30933527ce60d791731cb3f5ae6509 Mon Sep 17 00:00:00 2001 From: bang128 <71242233+bang128@users.noreply.github.com> Date: Fri, 9 Dec 2022 21:54:39 -0800 Subject: [PATCH 1/4] Update column.py --- pandas/core/interchange/column.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/interchange/column.py b/pandas/core/interchange/column.py index c8675faec440c..2613ecbaa8350 100644 --- a/pandas/core/interchange/column.py +++ b/pandas/core/interchange/column.py @@ -81,7 +81,8 @@ def __init__(self, column: pd.Series, allow_copy: bool = True) -> None: self._col = column self._allow_copy = allow_copy - def size(self) -> int: # type: ignore[override] + @property + def size(self) -> int: """ Size of the column, in elements. """ From 598c6a73c82ec9847070814b79eba25162322d5f Mon Sep 17 00:00:00 2001 From: bang128 <71242233+bang128@users.noreply.github.com> Date: Fri, 9 Dec 2022 23:24:09 -0800 Subject: [PATCH 2/4] Remove ignore comment --- pandas/core/interchange/column.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/interchange/column.py b/pandas/core/interchange/column.py index 2613ecbaa8350..beb7780706940 100644 --- a/pandas/core/interchange/column.py +++ b/pandas/core/interchange/column.py @@ -81,7 +81,6 @@ def __init__(self, column: pd.Series, allow_copy: bool = True) -> None: self._col = column self._allow_copy = allow_copy - @property def size(self) -> int: """ Size of the column, in elements. From 26fc8841bb4ef8c5b0c791e6860bd3b5e0a6b6a0 Mon Sep 17 00:00:00 2001 From: bang128 <71242233+bang128@users.noreply.github.com> Date: Sat, 10 Dec 2022 16:13:59 -0800 Subject: [PATCH 3/4] Add @property --- pandas/core/interchange/column.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/interchange/column.py b/pandas/core/interchange/column.py index beb7780706940..2613ecbaa8350 100644 --- a/pandas/core/interchange/column.py +++ b/pandas/core/interchange/column.py @@ -81,6 +81,7 @@ def __init__(self, column: pd.Series, allow_copy: bool = True) -> None: self._col = column self._allow_copy = allow_copy + @property def size(self) -> int: """ Size of the column, in elements. From d36ca0ad3495f9ea0a2660128e7faed0e254fb89 Mon Sep 17 00:00:00 2001 From: bang128 <71242233+bang128@users.noreply.github.com> Date: Tue, 13 Dec 2022 01:23:29 -0800 Subject: [PATCH 4/4] Return to _col.size --- pandas/core/interchange/column.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/interchange/column.py b/pandas/core/interchange/column.py index 4a3355712281a..13154c0e55900 100644 --- a/pandas/core/interchange/column.py +++ b/pandas/core/interchange/column.py @@ -87,7 +87,7 @@ def size(self) -> int: Size of the column, in elements. """ # error: Signature of "size" incompatible with supertype "Column" [override] - return len(self._col._values) + return self._col.size @property def offset(self) -> int: