From 074377dd264d89488d365da4d271dc191cfce34d Mon Sep 17 00:00:00 2001 From: miguel Date: Tue, 28 May 2024 21:32:52 -0300 Subject: [PATCH 1/9] make construct_array_type a non-classmethod --- pandas/core/dtypes/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index d8a42d83b6c54..d79704d896995 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -206,7 +206,6 @@ def names(self) -> list[str] | None: """ return None - @classmethod def construct_array_type(cls) -> type_t[ExtensionArray]: """ Return the array type associated with this dtype. From c46d74cb98de401c78703e1fb7d3a1923ea00023 Mon Sep 17 00:00:00 2001 From: miguel Date: Tue, 28 May 2024 22:11:18 -0300 Subject: [PATCH 2/9] removing unused comment --- pandas/core/arrays/string_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 291cc2e62be62..1690a76d132aa 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -188,7 +188,7 @@ def construct_from_string(cls, string) -> Self: # https://github.com/pandas-dev/pandas/issues/36126 # error: Signature of "construct_array_type" incompatible with supertype # "ExtensionDtype" - def construct_array_type( # type: ignore[override] + def construct_array_type( self, ) -> type_t[BaseStringArray]: """ From 74d34135273a23b8ffad75c7f07a656a344d342b Mon Sep 17 00:00:00 2001 From: miguel Date: Tue, 28 May 2024 22:31:48 -0300 Subject: [PATCH 3/9] forgot to add self param --- pandas/core/dtypes/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index d79704d896995..1ee9e70b774d3 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -206,7 +206,7 @@ def names(self) -> list[str] | None: """ return None - def construct_array_type(cls) -> type_t[ExtensionArray]: + def construct_array_type(self, cls) -> type_t[ExtensionArray]: """ Return the array type associated with this dtype. From b457576f3a7a2ccb5733fa037a52ad63ac419c50 Mon Sep 17 00:00:00 2001 From: Miguel Garcia <72623443+miguelpgarcia@users.noreply.github.com> Date: Tue, 28 May 2024 22:49:29 -0300 Subject: [PATCH 4/9] Update string_.py --- pandas/core/arrays/string_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 1690a76d132aa..24b9aa3bc9c7d 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -188,7 +188,7 @@ def construct_from_string(cls, string) -> Self: # https://github.com/pandas-dev/pandas/issues/36126 # error: Signature of "construct_array_type" incompatible with supertype # "ExtensionDtype" - def construct_array_type( +def construct_array_type( # type: ignore[override] self, ) -> type_t[BaseStringArray]: """ From 0cfa59f6776f8a7ea38d09544be01440bdc93186 Mon Sep 17 00:00:00 2001 From: Miguel Garcia <72623443+miguelpgarcia@users.noreply.github.com> Date: Tue, 28 May 2024 22:50:09 -0300 Subject: [PATCH 5/9] Update string_.py --- pandas/core/arrays/string_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 24b9aa3bc9c7d..aa16e16e8d1d1 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -188,7 +188,7 @@ def construct_from_string(cls, string) -> Self: # https://github.com/pandas-dev/pandas/issues/36126 # error: Signature of "construct_array_type" incompatible with supertype # "ExtensionDtype" -def construct_array_type( # type: ignore[override] + def construct_array_type( # type: ignore[override] self, ) -> type_t[BaseStringArray]: """ From eb1af61258259646edb8f00a2d1e145fff4c0d2d Mon Sep 17 00:00:00 2001 From: Miguel Garcia <72623443+miguelpgarcia@users.noreply.github.com> Date: Tue, 28 May 2024 22:55:16 -0300 Subject: [PATCH 6/9] Update string_.py --- pandas/core/arrays/string_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index aa16e16e8d1d1..291cc2e62be62 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -188,7 +188,7 @@ def construct_from_string(cls, string) -> Self: # https://github.com/pandas-dev/pandas/issues/36126 # error: Signature of "construct_array_type" incompatible with supertype # "ExtensionDtype" - def construct_array_type( # type: ignore[override] + def construct_array_type( # type: ignore[override] self, ) -> type_t[BaseStringArray]: """ From 14872a50cb28f8dc358ef1a129cbcb9e16b7cd38 Mon Sep 17 00:00:00 2001 From: Miguel Garcia <72623443+miguelpgarcia@users.noreply.github.com> Date: Tue, 28 May 2024 23:24:02 -0300 Subject: [PATCH 7/9] Update base.py --- pandas/core/dtypes/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index 1ee9e70b774d3..df74b5b31e0af 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -206,7 +206,7 @@ def names(self) -> list[str] | None: """ return None - def construct_array_type(self, cls) -> type_t[ExtensionArray]: + def construct_array_type(self) -> type_t[ExtensionArray]: """ Return the array type associated with this dtype. @@ -214,7 +214,7 @@ def construct_array_type(self, cls) -> type_t[ExtensionArray]: ------- type """ - raise AbstractMethodError(cls) + raise AbstractMethodError(self) def empty(self, shape: Shape) -> ExtensionArray: """ From 0312ba0b80508627bb76b8d932e8663b79585c7f Mon Sep 17 00:00:00 2001 From: Miguel Garcia <72623443+miguelpgarcia@users.noreply.github.com> Date: Tue, 28 May 2024 23:49:21 -0300 Subject: [PATCH 8/9] Update string_.py --- pandas/core/arrays/string_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 291cc2e62be62..369b50b1ed1a7 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -188,7 +188,7 @@ def construct_from_string(cls, string) -> Self: # https://github.com/pandas-dev/pandas/issues/36126 # error: Signature of "construct_array_type" incompatible with supertype # "ExtensionDtype" - def construct_array_type( # type: ignore[override] + def construct_array_type( self, ) -> type_t[BaseStringArray]: """ From 27444df32ad78ba3e16c63ff90703fb992154717 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 29 May 2024 00:03:59 -0300 Subject: [PATCH 9/9] Update string.py --- pandas/core/arrays/string_.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/arrays/string_.py b/pandas/core/arrays/string_.py index 369b50b1ed1a7..e52dd1659793e 100644 --- a/pandas/core/arrays/string_.py +++ b/pandas/core/arrays/string_.py @@ -188,9 +188,7 @@ def construct_from_string(cls, string) -> Self: # https://github.com/pandas-dev/pandas/issues/36126 # error: Signature of "construct_array_type" incompatible with supertype # "ExtensionDtype" - def construct_array_type( - self, - ) -> type_t[BaseStringArray]: + def construct_array_type(self) -> type_t[BaseStringArray]: """ Return the array type associated with this dtype.