diff options
| author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2025-02-17 16:47:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-17 16:47:59 +0000 |
| commit | ea70f4889120bc01d2a5416b99e3faba9c28fe9d (patch) | |
| tree | 3f4c74045d582eb9352a89247e53d7e704c991ea /obfuscator | |
| parent | 00917b8ecf67de9e955479be555d74fcc8257020 (diff) | |
| download | gdpr-obfuscator-ea70f4889120bc01d2a5416b99e3faba9c28fe9d.tar.gz gdpr-obfuscator-ea70f4889120bc01d2a5416b99e3faba9c28fe9d.zip | |
style: format code with Autopep8, Black and Ruff Formatter
This commit fixes the style issues introduced in 00917b8 according to the output
from Autopep8, Black and Ruff Formatter.
Details: None
Diffstat (limited to 'obfuscator')
| -rw-r--r-- | obfuscator/csv_reader.py | 9 | ||||
| -rw-r--r-- | obfuscator/obfuscate.py | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/obfuscator/csv_reader.py b/obfuscator/csv_reader.py index 23a34fc..eb93609 100644 --- a/obfuscator/csv_reader.py +++ b/obfuscator/csv_reader.py @@ -9,13 +9,16 @@ logger = get_logger("CSVReader") # Putting the CSV reading components into a class may seem like overkill # for a simple script, but it allows for better organization and scalability. # @staticmethod is used to define the method without an instance of the class -# being required. The methods could be defined just as functions, and this +# being required. The methods could be defined just as functions, and this # may still be changed. + + class CSVReader: """ A class to read CSV data from a local file, S3 object, or string. Near the project completion, support for JSON/Parquet files will be added. """ + @staticmethod def read_local(path) -> List[Dict[str, str]]: """ @@ -24,7 +27,7 @@ class CSVReader: """ # Log the path of the file being read for debugging logger.debug(f"Reading local CSV from: {path}") - + # Attempt to read the file and return the data as a list of dictionaries # However, if the file isn't found or there is a generic exception, log # the error and raise an exception @@ -34,7 +37,7 @@ class CSVReader: return [dict(row) for row in reader] except FileNotFoundError: logger.error(f"File not found: {path}") - raise + raise except Exception as e: logger.error(f"Error reading file: {e}") diff --git a/obfuscator/obfuscate.py b/obfuscator/obfuscate.py index 3da9155..3f589cb 100644 --- a/obfuscator/obfuscate.py +++ b/obfuscator/obfuscate.py @@ -4,6 +4,7 @@ from obfuscator.logger import get_logger # Create the logger logger = get_logger("Obfuscator") + def obfuscate( data: List[Dict[str, str]], pii_fields: List[str] ) -> List[Dict[str, str]]: |
