From fd7598acd7e33782090d7f866fa51c167e2190c8 Mon Sep 17 00:00:00 2001 From: Alex Schofield Date: Mon, 17 Feb 2025 01:12:00 +0000 Subject: performance: add @staticmethod to CSVReader methods to save memory --- obfuscator/csv_reader.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/obfuscator/csv_reader.py b/obfuscator/csv_reader.py index cf81a30..1fb1e30 100644 --- a/obfuscator/csv_reader.py +++ b/obfuscator/csv_reader.py @@ -9,8 +9,9 @@ logger = get_logger("CSVReader") class CSVReader: def __init__(self): pass - - def read_local(self, path) -> List[Dict[str, str]]: + + @staticmethod + def read_local(path) -> List[Dict[str, str]]: logger.debug(f"Reading local CSV from: {path}") data = [] @@ -26,10 +27,12 @@ class CSVReader: logger.debug(f"Total rows read: {len(data)}") return data - - def read_s3(self) -> List[Dict[str, str]]: - return [] + @staticmethod + def read_s3(path) -> List[Dict[str, str]]: + return [] + + @staticmethod def read_string(self, content: str) -> List[Dict[str, str]]: if not content.strip(): return [] -- cgit v1.2.3