Skip to content

Commit

Permalink
remove ensure_list function (solved with pydantic)
Browse files Browse the repository at this point in the history
  • Loading branch information
edulauer committed Sep 4, 2024
1 parent d380fbd commit 97dea73
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/dou_dag_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,6 @@ def perform_searches(

return search_dict

def _ensure_list_of_searches(self, specs: DAGConfig) -> list:
"""Ensure that the search attribute is returned as a list,
whether it's originally a single element or a list."""

# is it a single search or a list of searchers?
if isinstance(specs.search, list):
searches = specs.search
else:
searches = [specs.search]

return searches

def get_xcom_pull_tasks(self, num_searches, **context):
"""Retrieve XCom values from multiple tasks and append them to a new list.
Function required for Airflow version 2.10.0 or later
Expand Down Expand Up @@ -455,7 +443,7 @@ def create_dag(self, specs: DAGConfig, config_file: str) -> DAG:

with TaskGroup(group_id="exec_searchs") as tg_exec_searchs:

searches = self._ensure_list_of_searches(specs=specs)
searches = specs.search

for counter, subsearch in enumerate(searches, 1):

Expand Down

0 comments on commit 97dea73

Please sign in to comment.