Skip to content

Commit

Permalink
fix: add CsvLines type
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauric Desauw committed Oct 29, 2021
1 parent 47312c6 commit 9a6e264
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion powerapi/cli/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion powerapi/report/hwpc_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions powerapi/report/power_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9a6e264

Please sign in to comment.