Skip to content

Commit

Permalink
fix edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmccluskey committed Oct 10, 2024
1 parent fefd184 commit 255e6cc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sdks/python/apache_beam/dataframe/frame_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,21 @@ def wrap(func):
" :skipif: True"),
re.sub(r"^", " ", content, flags=re.MULTILINE),
])
elif "Examples" in content and ">>>" in content:
# some new examples don't have the correct heading
# this catches those examples
split_content = content.split("Examples")
content = '\n\n'.join([
split_content[0],
"Examples\n",
# Indent the code snippet under a doctest heading,
# add skipif option. This makes sure our doctest
# framework doesn't run these pandas tests.
(".. doctest::\n"
" :skipif: True"),
re.sub(r"^", " ", content, flags=re.MULTILINE),
split_content[1]
])
else:
content = content.replace('DataFrame', 'DeferredDataFrame').replace(
'Series', 'DeferredSeries')
Expand Down

0 comments on commit 255e6cc

Please sign in to comment.