From edc80fca0a1703bd74d9a5fa0d5c639139c7ed13 Mon Sep 17 00:00:00 2001 From: sooooooing Date: Tue, 26 Nov 2024 15:30:17 +0900 Subject: [PATCH 1/2] fix docstring api.types.is_re_compilable --- ci/code_checks.sh | 1 - pandas/core/dtypes/inference.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 246a907c5052c..9faa2a249613b 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -82,7 +82,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timestamp.min PR02" \ -i "pandas.Timestamp.resolution PR02" \ -i "pandas.Timestamp.tzinfo GL08" \ - -i "pandas.api.types.is_re_compilable PR07,SA01" \ -i "pandas.arrays.ArrowExtensionArray PR07,SA01" \ -i "pandas.arrays.IntegerArray SA01" \ -i "pandas.arrays.IntervalArray.length SA01" \ diff --git a/pandas/core/dtypes/inference.py b/pandas/core/dtypes/inference.py index 6adb34ff0f777..bc4e95f4deaea 100644 --- a/pandas/core/dtypes/inference.py +++ b/pandas/core/dtypes/inference.py @@ -190,12 +190,17 @@ def is_re_compilable(obj: object) -> bool: Parameters ---------- obj : The object to check + The object to check if the object can be compiled into a regex pattern instance. Returns ------- bool Whether `obj` can be compiled as a regex pattern. + See Also + -------- + api.types.is_re : Check if the object is a regex pattern instance. + Examples -------- >>> from pandas.api.types import is_re_compilable @@ -210,7 +215,7 @@ def is_re_compilable(obj: object) -> bool: return False else: return True - + def is_array_like(obj: object) -> bool: """ From 06192cd0322b967b62200b2f9bf36045a76efa8b Mon Sep 17 00:00:00 2001 From: sooooooing Date: Tue, 26 Nov 2024 15:43:29 +0900 Subject: [PATCH 2/2] fix lint error --- pandas/core/dtypes/inference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/inference.py b/pandas/core/dtypes/inference.py index bc4e95f4deaea..918d107f2ce6c 100644 --- a/pandas/core/dtypes/inference.py +++ b/pandas/core/dtypes/inference.py @@ -215,7 +215,7 @@ def is_re_compilable(obj: object) -> bool: return False else: return True - + def is_array_like(obj: object) -> bool: """