From 4682fb4210392eb03616eefdf588550c1d7eabd0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 4 Sep 2022 16:02:37 +0200 Subject: [PATCH] Throw an assertion error when on_duplicate_update is specified on db.insert with no key_columns --- platypush/plugins/db/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platypush/plugins/db/__init__.py b/platypush/plugins/db/__init__.py index e419f1573..1ff56daa4 100644 --- a/platypush/plugins/db/__init__.py +++ b/platypush/plugins/db/__init__.py @@ -292,6 +292,11 @@ class DbPlugin(Plugin): } """ + if on_duplicate_update: + assert ( + key_columns + ), 'on_duplicate_update requires key_columns to be specified' + if key_columns is None: key_columns = []