Skip to content

Commit

Permalink
Fix autoincrement
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Aug 23, 2023
1 parent 7096b45 commit 7a485ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions superset/extensions/metadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ def insert_row(self, row: Row) -> int:
raise ProgrammingError(f"Invalid rowid specified: {row_id}")
row[self._rowid] = row_id

if (
self._rowid
and row[self._rowid] is None
and self._table.c[self._rowid].autoincrement
):
row.pop(self._rowid)

Check warning on line 405 in superset/extensions/metadb.py

View check run for this annotation

Codecov / codecov/patch

superset/extensions/metadb.py#L405

Added line #L405 was not covered by tests

query = self._table.insert().values(**row)

with self.engine_context() as engine:
Expand Down

0 comments on commit 7a485ba

Please sign in to comment.