Skip to content
Snippets Groups Projects
Commit 78223c72 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

DOC: add docstrings

parent a04b3319
No related branches found
No related tags found
2 merge requests!160STY: styling,!126Transformers
Pipeline #45773 passed
......@@ -28,6 +28,9 @@ from typing import Any
def ifelse(in_value: Any, in_parameters: dict):
"""returns the first argument if it does NOT match the reg exp of 'match' stored in the second
argument, other wise the value of 'then' stored in the second argument is returned.
"""
if "match" not in in_parameters or "then" not in in_parameters:
raise RuntimeError("Mandatory parameters missing.")
if re.match(in_parameters["match"], in_value) is not None:
......@@ -36,6 +39,9 @@ def ifelse(in_value: Any, in_parameters: dict):
def split(in_value: Any, in_parameters: dict):
"""calls the string 'split' function on the first argument and uses the value of the key
'marker' stored in the second argument
"""
if "marker" not in in_parameters:
raise RuntimeError("Mandatory parameter missing.")
if not isinstance(in_value, str):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment