tvalentyn commented on a change in pull request #14140:
URL: https://github.com/apache/beam/pull/14140#discussion_r587899821
##########
File path: sdks/python/apache_beam/dataframe/doctests.py
##########
@@ -666,3 +658,53 @@ def _run_patched(func, *args, **kwargs):
*args, extraglobs=extraglobs, optionflags=optionflags, **kwargs)
finally:
doctest.DocTestRunner = original_doc_test_runner
+
+
+def with_run_patched_docstring(target=None):
+ assert target is not None
+ def wrapper(fn):
+ fn.__doc__ = f"""Run all pandas doctests in the specified {target}.
+
+ Arguments `skip`, `wont_implement_ok`, `not_implemented_ok` are all in the
+ format::
+
+ {{
+ "module.Class.method": ['*'],
+ "module.Class.other_method": [
+ 'instance.other_method(bad_input)',
+ 'observe_result_of_bad_input()',
+ ],
+ }}
+
+ `'*'` indicates all examples should be matched, otherwise the list is a
list
+ of specific input strings that should be matched.
+
+ All arguments are kwargs.
+
+ Args:
+ optionflags (int): Passed through to doctests.
+ extraglobs (Dict[str,Any]): Passed through to doctests.
+ use_beam (bool): If true, run a Beam pipeline with partitioned input to
+ verify the examples, else use PartitioningSession to simulate
+ distributed execution.
+ skip (Dict[str,str]): A set of examples to skip entirely.
+ wont_implement_ok (Dict[str,str]): A set of examples that are allowed to
+ raise WontImplementError.
+ not_implemented_ok (Dict[str,str]): A set of examples that are allowed to
+ raise NotImplementedError.
+
+ Returns:
+ ~doctest.TestResult: A doctest result describing the passed/failed tests.
+ """
+ return fn
+ return wrapper
+
+
+@with_run_patched_docstring(target="file")
Review comment:
What is the difference between file and module?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]