aboutsummaryrefslogtreecommitdiffstats
path: root/gdpr_obfuscator/utils.py
diff options
context:
space:
mode:
authordeepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>2025-02-21 04:22:25 +0000
committerGitHub <noreply@github.com>2025-02-21 04:22:25 +0000
commit7cc98bff4095bd06838c8aa6d18cf5f62aff1979 (patch)
tree84aed299417974437ab2dddecb561c7af7955a28 /gdpr_obfuscator/utils.py
parent9bdeb7d3e8e68aa5da3ab29ec41b6ffd334be2b9 (diff)
downloadgdpr-obfuscator-7cc98bff4095bd06838c8aa6d18cf5f62aff1979.tar.gz
gdpr-obfuscator-7cc98bff4095bd06838c8aa6d18cf5f62aff1979.zip
refactor: change methods not using its bound instance to staticmethods
The method doesn't use its bound instance. Decorate this method with `@staticmethod` decorator, so that Python does not have to instantiate a bound method for every instance of this class thereby saving memory and computation. Read more about staticmethods [here](https://docs.python.org/3/library/functions.html#staticmethod).
Diffstat (limited to 'gdpr_obfuscator/utils.py')
-rw-r--r--gdpr_obfuscator/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdpr_obfuscator/utils.py b/gdpr_obfuscator/utils.py
index d305daf..9736d7c 100644
--- a/gdpr_obfuscator/utils.py
+++ b/gdpr_obfuscator/utils.py
@@ -8,13 +8,15 @@ class Utilities:
def __init__(self, logger=None):
pass
- def get_s3_path(self, uri):
+ @staticmethod
+ def get_s3_path(uri):
parts = uri.replace("s3://", "").split("/")
bucket = parts.pop(0)
key = "/".join(parts)
return bucket, key
- def create_byte_stream(self, data: List[Dict[str, str]]) -> bytes:
+ @staticmethod
+ def create_byte_stream(data: List[Dict[str, str]]) -> bytes:
if not data:
return b""
git.ajschof.me — hosted by ajschofield — powered by cgit