diff options
author | BonfaceKilz | 2021-06-03 21:39:25 +0300 |
---|---|---|
committer | zsloan | 2021-06-18 22:08:04 +0000 |
commit | d769bfcc38a14720fa888e2b7c0ff874cc91f6a2 (patch) | |
tree | 1ae551238f58c901e72a379f9d0f1906e7174a36 /gn3/db/__init__.py | |
parent | 4c9bbe6d4229b79a1bc62cf2f641fbc4c4f00abc (diff) | |
download | genenetwork3-d769bfcc38a14720fa888e2b7c0ff874cc91f6a2.tar.gz |
gn3: db: Replace items() with keys()
* gn3/db/__init__.py (diff_from_dict): We only use the keys of the dict!
Diffstat (limited to 'gn3/db/__init__.py')
-rw-r--r-- | gn3/db/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/db/__init__.py b/gn3/db/__init__.py index ce92a7d..d62b575 100644 --- a/gn3/db/__init__.py +++ b/gn3/db/__init__.py @@ -93,6 +93,7 @@ def insert(conn: Any, conn.commit() return cursor.rowcount + def diff_from_dict(old: Dict, new: Dict) -> Dict: """Construct a new dict with a specific structure that contains the difference between the 2 dicts in the structure: @@ -104,6 +105,6 @@ Should return: {"id": {"old": 1, "new": 2}, "data": {"old": "a", "new": "b"}} """ dict_ = {} - for key, value in old.items(): + for key in old.keys(): dict_[key] = {"old": old[key], "new": new[key]} return dict_ |