You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/08/23 19:59:55 UTC
[superset] 02/02: Fix autoincrement
This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch fix-count-meta-db
in repository https://gitbox.apache.org/repos/asf/superset.git
commit e079bfa90204a5ec129865bca914d14d77da5c48
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Wed Aug 23 12:43:06 2023 -0700
Fix autoincrement
---
superset/extensions/metadb.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/superset/extensions/metadb.py b/superset/extensions/metadb.py
index 17e9f2850c..50147a0a8b 100644
--- a/superset/extensions/metadb.py
+++ b/superset/extensions/metadb.py
@@ -397,6 +397,9 @@ class SupersetShillelaghAdapter(Adapter):
raise ProgrammingError(f"Invalid rowid specified: {row_id}")
row[self._rowid] = row_id
+ if self._table.c[self._rowid].autoincrement and row[self._rowid] is None:
+ row.pop(self._rowid)
+
query = self._table.insert().values(**row)
with self.engine_context() as engine: