Skip to content

Commit a557ea2

Browse files
authored
docs: add code samples for str accessor methdos (#594)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes internal issue 333397327 🦕
1 parent 5f1d670 commit a557ea2

File tree

3 files changed

+677
-10
lines changed

3 files changed

+677
-10
lines changed

‎bigframes/operations/strings.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,25 @@ def lower(self) -> series.Series:
5353
return self._apply_unary_op(ops.lower_op)
5454

5555
def reverse(self) -> series.Series:
56-
"""Reverse strings in the Series."""
56+
"""Reverse strings in the Series.
57+
58+
**Examples:**
59+
60+
>>> import bigframes.pandas as bpd
61+
>>> bpd.options.display.progress_bar = None
62+
63+
>>> s = bpd.Series(["apple", "banana", "", bpd.NA])
64+
>>> s.str.reverse()
65+
0 elppa
66+
1 ananab
67+
2
68+
3 <NA>
69+
dtype: string
70+
71+
Returns:
72+
bigframes.series.Series: A Series of booleans indicating whether the given
73+
pattern matches the start of each string element.
74+
"""
5775
# reverse method is in ibis, not pandas.
5876
return self._apply_unary_op(ops.reverse_op)
5977

‎scripts/get_documentation_coverage.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ def get_coverage_summary(
9797
if name.startswith("_") and not name.startswith("__"):
9898
continue
9999

100+
# ignore constructor
101+
if name == "__init__":
102+
continue
103+
100104
def predicate(impl):
101105
return (
102106
# This includes class methods like `from_dict`, `from_records`

0 commit comments

Comments
 (0)