Skip to content

Commit 4aaa889

Browse files
KhemkaranKhemkaran
authored andcommitted
fixed mypy check
1 parent a336ccb commit 4aaa889

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,21 +312,21 @@ def _str_match(
312312
if isinstance(pat, re.Pattern):
313313
# GH#61952
314314
pat = pat.pattern
315-
if not pat.startswith("^"):
315+
if isinstance(pat, str) and not pat.startswith("^"):
316316
pat = f"^{pat}"
317317
return self._str_contains(pat, case, flags, na, regex=True)
318318

319319
def _str_fullmatch(
320320
self,
321-
pat,
321+
pat: str | re.Pattern,
322322
case: bool = True,
323323
flags: int = 0,
324324
na: Scalar | lib.NoDefault = lib.no_default,
325325
):
326326
if isinstance(pat, re.Pattern):
327327
# GH#61952
328328
pat = pat.pattern
329-
if not pat.endswith("$") or pat.endswith("\\$"):
329+
if isinstance(pat, str) and (not pat.endswith("$") or pat.endswith("\\$")):
330330
pat = f"{pat}$"
331331
return self._str_match(pat, case, flags, na)
332332

0 commit comments

Comments
 (0)