Skip to content

Commit

Permalink
add dataclass SearchConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
edulauer committed May 13, 2024
1 parent 5ea7def commit 133d564
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@

from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import List, Tuple, Set
from typing import Dict, List, Tuple, Set
import ast
import yaml
import textwrap

from airflow.models import Variable

@dataclass
class DAGConfig:
dag_id: str
class SearchConfig:
sources: List[str]
territory_id: int
dou_sections: List[str]
search_date: str
field: str
search_date: str
is_exact_search: bool
ignore_signature_match: bool
force_rematch: bool
Expand All @@ -26,6 +25,11 @@ class DAGConfig:
sql: str
conn_id: str
department: List[str]

@dataclass
class DAGConfig:
dag_id: str
search_dict: Dict[str, SearchConfig]
emails: List[str]
subject: str
attach_csv: bool
Expand All @@ -38,7 +42,6 @@ class DAGConfig:
dag_tags: Set[str]
owner: str


class FileParser(ABC):
"""Abstract class to build file parsers with DAG configuration.
"""
Expand Down

0 comments on commit 133d564

Please sign in to comment.