Skip to content
Snippets Groups Projects
Commit aa400ea2 authored by Victor Dosda's avatar Victor Dosda
Browse files

encode record id as static function

parent 5f028d0e
No related branches found
No related tags found
1 merge request!240Deletion of bulk data
......@@ -129,7 +129,8 @@ class DaskBulkStorage:
def base_directory(self) -> str:
return self._parameters.base_directory
def encode_record_id(self, record_id: str) -> str:
@staticmethod
def encode_record_id(record_id: str) -> str:
return hashlib.sha1(record_id.encode()).hexdigest()
def _get_base_directory(self, protocol=True):
......@@ -137,7 +138,7 @@ class DaskBulkStorage:
def _get_entity_path(self, record_id: str, with_protocol=True) -> str:
"""Return the entity id path from the record_id."""
encoded_id = self._encode_record_id(record_id)
encoded_id = self.encode_record_id(record_id)
return f'{self._get_base_directory(with_protocol)}/{encoded_id}'
def _get_bulk_path(self, record_id: str, with_protocol=True) -> str:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment