Esempio n. 1
0
 def set_ready(self, logs=List[LogMessage]) -> None:
     assert self.last_parse.state == ManifestStatus.Compiling, \
         f'invalid state {self.last_parse.state}'
     self.last_parse = LastParse(
         state=ManifestStatus.Ready,
         logs=logs
     )
Esempio n. 2
0
 def set_compile_exception(self, exc, logs=List[LogMessage]) -> None:
     assert self.last_parse.state == ManifestStatus.Compiling, \
         f'invalid state {self.last_parse.state}'
     self.last_parse = LastParse(
         error={'message': str(exc)},
         state=ManifestStatus.Error,
         logs=logs
     )
Esempio n. 3
0
 def __init__(self, args, config, task_types: TaskTypes) -> None:
     self.args = args
     self.config = config
     self.manifest: Optional[Manifest] = None
     self._task_types: TaskTypes = task_types
     self.active_tasks: TaskHandlerMap = {}
     self.gc = GarbageCollector(active_tasks=self.active_tasks)
     self.last_parse: LastParse = LastParse(state=ManifestStatus.Init)
     self._lock: dbt.flags.MP_CONTEXT.Lock = dbt.flags.MP_CONTEXT.Lock()
     self._reloader: Optional[ManifestReloader] = None
     self.reload_manifest()
Esempio n. 4
0
 def set_parsing(self) -> bool:
     with self._lock:
         if self.last_parse.state == ManifestStatus.Compiling:
             return False
         self.last_parse = LastParse(state=ManifestStatus.Compiling)
     return True