diff options
author | BonfaceKilz | 2021-06-02 07:38:53 +0300 |
---|---|---|
committer | zsloan | 2021-06-18 22:08:04 +0000 |
commit | 515ac34950db419bd6440afd1393cf41310d1814 (patch) | |
tree | b13d715c7b709caab7365c5e0c9e084480d48d46 | |
parent | 07464f44f48895cc31ba2b088d6125e7777e1073 (diff) | |
download | genenetwork3-515ac34950db419bd6440afd1393cf41310d1814.tar.gz |
gn3: db: Return None if data and where are empty
-rw-r--r-- | gn3/db/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/db/__init__.py b/gn3/db/__init__.py index fae4d29..1eb7b12 100644 --- a/gn3/db/__init__.py +++ b/gn3/db/__init__.py @@ -36,7 +36,7 @@ def update(conn: Any, data: Dataclass, where: Dataclass) -> Optional[int]: """Run an UPDATE on a table""" - if not any(astuple(data) + astuple(where)): + if not (any(astuple(data)) and any(astuple(where))): return None sql = f"UPDATE {table} SET " sql += ", ".join(f"{TABLEMAP[table].get(k)} " |