You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2022/09/09 17:51:28 UTC

[superset] branch get-rows-tbl-schema created (now f11087497c)

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a change to branch get-rows-tbl-schema
in repository https://gitbox.apache.org/repos/asf/superset.git


      at f11087497c placeholder for compute count

This branch includes the following new commits:

     new f11087497c placeholder for compute count

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[superset] 01/01: placeholder for compute count

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch get-rows-tbl-schema
in repository https://gitbox.apache.org/repos/asf/superset.git

commit f11087497cf057802d0fdee903291f04b16d4a30
Author: hughhhh <hu...@gmail.com>
AuthorDate: Fri Sep 9 10:51:07 2022 -0700

    placeholder for compute count
---
 superset/databases/utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/superset/databases/utils.py b/superset/databases/utils.py
index 9229bb8cba..706455f226 100644
--- a/superset/databases/utils.py
+++ b/superset/databases/utils.py
@@ -52,7 +52,10 @@ def get_col_type(col: Dict[Any, Any]) -> str:
 
 
 def get_table_metadata(
-    database: Any, table_name: str, schema_name: Optional[str]
+    database: Any,
+    table_name: str,
+    schema_name: Optional[str],
+    get_row_count: bool = False,
 ) -> Dict[str, Any]:
     """
     Get table metadata information, including type, pk, fks.
@@ -86,6 +89,11 @@ def get_table_metadata(
                 "comment": col.get("comment"),
             }
         )
+
+    if get_row_count:
+        # compute `select count(*) from {table}`
+        pass
+
     return {
         "name": table_name,
         "columns": payload_columns,