Skip to content

Commit 78d88a5

Browse files
authored
docs(api): indicate that re_search need only match part of a string (#10402)
1 parent c55cbd9 commit 78d88a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ibis/expr/types/strings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,9 +1020,9 @@ def ilike(
10201020
why="Different backends support different regular expression syntax."
10211021
)
10221022
def re_search(self, pattern: str | StringValue) -> ir.BooleanValue:
1023-
"""Return whether the values match `pattern`.
1023+
"""Return whether `self` contains the regex `pattern`.
10241024
1025-
Returns `True` if the regex matches a string and `False` otherwise.
1025+
Returns `True` if the regex matches any part of a string and `False` otherwise.
10261026
10271027
Parameters
10281028
----------
@@ -1038,7 +1038,7 @@ def re_search(self, pattern: str | StringValue) -> ir.BooleanValue:
10381038
--------
10391039
>>> import ibis
10401040
>>> ibis.options.interactive = True
1041-
>>> t = ibis.memtable({"s": ["Ibis project", "GitHub"]})
1041+
>>> t = ibis.memtable({"s": ["Ibis project", "GitHub", "GitHub Actions"]})
10421042
>>> t.s.re_search(".+Hub")
10431043
┏━━━━━━━━━━━━━━━━━━━━━━━━━┓
10441044
┃ RegexSearch(s, '.+Hub') ┃
@@ -1047,6 +1047,7 @@ def re_search(self, pattern: str | StringValue) -> ir.BooleanValue:
10471047
├─────────────────────────┤
10481048
│ False │
10491049
│ True │
1050+
│ True │
10501051
└─────────────────────────┘
10511052
"""
10521053
return ops.RegexSearch(self, pattern).to_expr()

0 commit comments

Comments
 (0)