From 9a6e2649c1a494ff362fc9d2859a725305042a6f Mon Sep 17 00:00:00 2001 From: Lauric Desauw Date: Fri, 29 Oct 2021 15:31:53 +0200 Subject: [PATCH] fix: add CsvLines type --- powerapi/cli/generator.py | 2 +- powerapi/report/hwpc_report.py | 2 +- powerapi/report/power_report.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/powerapi/cli/generator.py b/powerapi/cli/generator.py index 4790a2ed..fb887931 100644 --- a/powerapi/cli/generator.py +++ b/powerapi/cli/generator.py @@ -67,7 +67,7 @@ def generate(self, config: Dict) -> Dict[str, Tuple[Type[Actor], StartMessage]]: msg = 'Configuration error : argument ' + exn.args[0] msg += ' needed with output ' + component_type print(msg, file=sys.stderr) - raise PowerAPIException(msg) + raise PowerAPIException(msg) from exn return actors diff --git a/powerapi/report/hwpc_report.py b/powerapi/report/hwpc_report.py index 6d226c4d..da648f95 100644 --- a/powerapi/report/hwpc_report.py +++ b/powerapi/report/hwpc_report.py @@ -115,7 +115,7 @@ def to_mongodb(report: HWPCReport) -> Dict: return HWPCReport.to_json(report) @staticmethod - def from_csv_lines(lines: List[Tuple[str, Dict[str, str]]]) -> HWPCReport: + def from_csv_lines(lines: CsvLines) -> HWPCReport: """ :param lines: list of pre-parsed lines. a line is a tuple composed with : - the file name where the line were read diff --git a/powerapi/report/power_report.py b/powerapi/report/power_report.py index d2fe70f6..1fcbb012 100644 --- a/powerapi/report/power_report.py +++ b/powerapi/report/power_report.py @@ -76,7 +76,7 @@ def from_json(data: Dict) -> Report: raise BadInputData(exn.args[0], data) from exn @staticmethod - def from_csv_lines(lines: List[Tuple[str, Dict]]) -> PowerReport: + def from_csv_lines(lines: CsvLines) -> PowerReport: """ :param lines: list of pre-parsed lines. a line is a tuple composed with : - the file name where the line were read @@ -105,7 +105,7 @@ def from_csv_lines(lines: List[Tuple[str, Dict]]) -> PowerReport: raise BadInputData(exn.args[0], row) from exn @staticmethod - def to_csv_lines(report: PowerReport, tags: List[str]) -> Tuple[List[str], Dict]: + def to_csv_lines(report: PowerReport, tags: List[str]) -> CsvLines: """ convert a power report into csv lines :param report: Report that will be converted into csv lines