Skip to content

Commit

Permalink
fix: added string type conversion before encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
luccadibe committed Dec 10, 2024
1 parent 2f678d8 commit 2b97db1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/internal/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def humanize_end_timestamp(self) -> datetime.datetime:
def _compute_hash(self) -> None:
"""Hash the config filename to uniquely identify experiments"""
if self.config_filename:
self.hash = self.config_filename.encode("utf-8")
self.hash = hashlib.sha256(usedforsecurity=False)
self.hash = self.hash.hexdigest()
hasher = hashlib.sha256(usedforsecurity=False)
hasher.update(str(self.config_filename).encode('utf-8'))
self.hash = hasher.hexdigest()

def _build_treatments(self) -> None:
"""Build a representation of treatments defined in config"""
Expand Down

0 comments on commit 2b97db1

Please sign in to comment.