def __init__(self, auth_folder, thread_id, project_id, script, dist_dataset=None, dist_table=None): threading.Thread.__init__(self) self.logger = logging.getLogger(__name__) self.thread_id = thread_id self.project_id = project_id self.job_id = str(uuid.uuid4()) self.script = script self.dist_dataset = dist_dataset self.dist_table = dist_table self.result = None self.svc = get_service(auth_folder)
def __init__(self, auth_folder, thread_id, project_id, bq_folder, scripts, date_target, period): threading.Thread.__init__(self) self.logger = logging.getLogger(__name__) self.thread_id = thread_id self.project_id = project_id self.scripts = scripts self.date_target = date_target self.period = period self.bq_folder = bq_folder self.exec_scripts = [] self.auth_folder = auth_folder self.svc = get_service(auth_folder) if (self.period == 'W'): self.date_start = date_target self.date_end = util.add_days(date_target, 6) self.date_start_prev = util.add_days(date_target, -7) else: self.date_start = util.getDateMonthStart(date_target) self.date_end = util.getDateMonthEnd(date_target) self.date_start_prev = util.getDatePrevMonthStart(date_target)