diff options
author | BonfaceKilz | 2021-06-02 07:38:53 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-06-03 21:58:31 +0300 |
commit | cd0f1155d2b325aa0863268d4e27397ae34afdec (patch) | |
tree | 4ca72821940bb7394db884026d3b3694dad2e7b4 | |
parent | 0500d974565320bcb6cf92139ed25c3196800032 (diff) | |
download | genenetwork3-cd0f1155d2b325aa0863268d4e27397ae34afdec.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)} " |