loguru mypy error (#118)

This commit is contained in:
you-n-g
2024-07-25 23:12:42 +08:00
committed by GitHub
parent 6dfae7dcf0
commit 080f5e6a60
+5 -3
View File
@@ -6,10 +6,12 @@ from functools import partial
from multiprocessing import Pipe
from multiprocessing.connection import Connection
from pathlib import Path
from typing import Union, Generator, Dict, Any
from typing import TYPE_CHECKING, Union, Generator, Dict, Any
from logging import LogRecord
from loguru import Record, logger
from loguru import logger
if TYPE_CHECKING:
from loguru import Record
from psutil import Process
from rdagent.core.conf import RD_AGENT_SETTINGS
@@ -97,7 +99,7 @@ class RDAgentLog(SingletonBaseClass):
process = parent_process
return pid_chain
def file_format(self, record: Record, raw: bool = False) -> str:
def file_format(self, record: "Record", raw: bool = False) -> str:
# FIXME: the formmat is tightly coupled with the message reading in storage.
record["message"] = LogColors.remove_ansi_codes(record["message"])
if raw: