Skip to content

Commit 6a14451

Browse files
try fixing typing issues
1 parent e065d33 commit 6a14451

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/arrays/string_arrow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,17 @@ def _is_re_pattern_with_flags(pat: str | re.Pattern) -> bool:
358358
)
359359

360360
@staticmethod
361-
def _preprocess_re_pattern(pat: re.Pattern, case: bool):
361+
def _preprocess_re_pattern(pat: re.Pattern, case: bool) -> tuple[str, bool, int]:
362+
pattern = pat.pattern
362363
flags = pat.flags
363-
pat = pat.pattern
364364
# flags is not supported by pyarrow, but `case` is -> extract and remove
365365
if flags & re.IGNORECASE:
366366
case = False
367367
flags = flags & ~re.IGNORECASE
368368
# when creating a pattern with re.compile and a string, it automatically
369369
# gets a UNICODE flag, while pyarrow assumes unicode for strings anyway
370370
flags = flags & ~re.UNICODE
371-
return pat, case, flags
371+
return pattern, case, flags
372372

373373
def _str_contains(
374374
self,

0 commit comments

Comments
 (0)