Skip to content

Commit

Permalink
✏️ Fix main function name
Browse files Browse the repository at this point in the history
  • Loading branch information
malgorzatagwinner committed Oct 16, 2024
1 parent 922b657 commit 56ccedb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/viadot/orchestration/prefect/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ def _process_string(self, text: str) -> list[str] | str:

return text

def process_segment(self, processed_input: str | list[str]) -> str | list[str]:
"""Process a segment by recognizing dates within it.
def process_dates(self, processed_input: str | list[str]) -> str | list[str]:
"""Process an input by recognizing dates within it.
If the input is a string, it applies the recognize_date() function.
If the input is a list, it recursively processes each list item.
Expand All @@ -463,9 +463,7 @@ def process_segment(self, processed_input: str | list[str]) -> str | list[str]:
if isinstance(processed_input, str):
return self._process_string(processed_input)
if isinstance(processed_input, list):
return [
self.process_segment(sub_segment) for sub_segment in processed_input
] # type: ignore
return [self.process_dates(sub_segment) for sub_segment in processed_input] # type: ignore
return processed_input


Expand Down

0 comments on commit 56ccedb

Please sign in to comment.