Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nightingale/mapper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from typing import Any

import dict_hash
import deepdiff

from nightingale.codelists import CodelistsMapping
from nightingale.config import Config
Expand Down Expand Up @@ -326,8 +326,8 @@ def make_release_id(self, curr_row: dict) -> None:
:param curr_row: The current release row dictionary.
:type curr_row: dict
"""
id_ = dict_hash.sha256(curr_row)
curr_row["id"] = id_
id_ = deepdiff.DeepHash(curr_row, exclude_paths={"root['id']"})
curr_row["id"] = id_[curr_row]

def date_release(self, curr_row: dict, curr_date: str | None) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ dependencies = [
"charset-normalizer==3.4.1",
"click==8.1.8",
"click-pathlib==2020.3.13.0",
"deepdiff==8.3.0",
"deflate_dict==1.2.2",
"dict_hash==1.3.6",
"et_xmlfile==2.0.0",
"idna==3.10",
"ijson==3.3.0",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_unflatten.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
from unittest import mock

import dict_hash
import deepdiff
import pytest

from nightingale.config import Config, Datasource, Mapping, Output, Publishing
Expand Down Expand Up @@ -405,7 +405,7 @@ def test_remove_empty_id_arrays(mock_config, base_config):


def generate_hash(data):
return dict_hash.sha256(data)
return deepdiff.DeepHash(data, exclude_paths={"root['id']"})[data]


@mock.patch("nightingale.mapper.get_iso_now")
Expand Down
Loading