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:54 UTC

[superset] 01/02: fix: count in meta DB

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 2686bfd2f88aedaa9571f5eada5af39917c3f36b
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Wed Aug 23 10:47:13 2023 -0700

    fix: count in meta DB
---
 superset/extensions/metadb.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/superset/extensions/metadb.py b/superset/extensions/metadb.py
index 79a3c446c4..17e9f2850c 100644
--- a/superset/extensions/metadb.py
+++ b/superset/extensions/metadb.py
@@ -62,7 +62,7 @@ from shillelagh.fields import (
 )
 from shillelagh.filters import Equal, Filter, Range
 from shillelagh.typing import RequestedOrder, Row
-from sqlalchemy import MetaData, Table
+from sqlalchemy import func, MetaData, Table
 from sqlalchemy.engine.url import URL
 from sqlalchemy.exc import NoSuchTableError
 from sqlalchemy.sql import Select, select
@@ -407,7 +407,7 @@ class SupersetShillelaghAdapter(Adapter):
             if self._rowid:
                 return result.inserted_primary_key[0]
 
-            query = self._table.count()
+            query = select([func.count()]).select_from(self._table)
             return connection.execute(query).scalar()
 
     @check_dml