diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-17 01:12:00 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-17 01:12:00 +0000 |
| commit | fd7598acd7e33782090d7f866fa51c167e2190c8 (patch) | |
| tree | 59dac435b5cd71575682b269828d1a452209237e | |
| parent | 3c0d24558db94e359fbcde89a48526b8b36218e4 (diff) | |
| download | gdpr-obfuscator-fd7598acd7e33782090d7f866fa51c167e2190c8.tar.gz gdpr-obfuscator-fd7598acd7e33782090d7f866fa51c167e2190c8.zip | |
performance: add @staticmethod to CSVReader methods to save memory
| -rw-r--r-- | obfuscator/csv_reader.py | 13 |
1 files 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 [] |
