Skip to content

Commit

Permalink
Fixed hashing of ids and started fixing id handling
Browse files Browse the repository at this point in the history
  • Loading branch information
npalacioescat committed Jun 4, 2024
1 parent 96de70f commit 339a9b3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cache_manager/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def create(
self._execute(f'''
INSERT INTO
main (
id,
item_id,
version_id,
version,
Expand All @@ -297,7 +296,6 @@ def create(
ext
)
VALUES (
NULL,
{self._quotes(new.key)},
"{new.key}-{new.version}",
{new.version},
Expand Down
2 changes: 1 addition & 1 deletion cache_manager/_data/main.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "INT PRIMARY KEY",
"id": "INT PRIMARY KEY NOT NULL",
"item_id": "VARCHAR",
"version_id": "VARCHAR",
"version": "INT",
Expand Down
2 changes: 1 addition & 1 deletion cache_manager/_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def serialize(cls, uri, attrs: dict | None = None):
attrs = attrs or {}
attrs['uri'] = uri

return _utils.serialize(attrs)
return _utils.hash(_utils.serialize(attrs))

def path(self, version: int | None = None):
"""
Expand Down

0 comments on commit 339a9b3

Please sign in to comment.