import os
import re
import sys

os.environ["PYARROW_IGNORE_TIMEZONE"] = "1"
sys.path.append(os.path.dirname(sys.path[0]))  # 上级目录
from utils.templates import Templates
from ..utils.templates import Templates
from utils.templates_mysql import TemplatesMysql
from ..utils.templates_mysql import TemplatesMysql


class DwdStToPg(Templates):

    def __init__(self, site_name='us', date_type="month", date_info='2022-1'):
        super().__init__()
        self.site_name = site_name
        self.date_type = date_type
        self.date_info = date_info
        self.engine_pg = TemplatesMysql().engine_pg
        self.engine_pg14 = TemplatesMysql().engine_pg
        self.engine_mysql = TemplatesMysql().engine

    def read_data(self):
        pass

    def handle_data(self):
        pass

    def save_data(self):
        pass


if __name__ == '__main__':
    if __name__ == '__main__':
        site_name = sys.argv[1]  # 参数1：站点
        date_type = sys.argv[2]  # 参数2：类型：week/4_week/month/quarter
        date_info = sys.argv[3]  # 参数3：年-周/年-月/年-季, 比如: 2022-1
        handle_obj = DwdStToPg(site_name=site_name, date_type=date_type, date_info=date_info)
        handle_obj.run()