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

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ab613d  fix(database): ensure pk_constraint is JSON serializable 
(#13147)
5ab613d is described below

commit 5ab613d89ea6adf90bd958900dfeee8d43eadd56
Author: Ville Brofeldt <[email protected]>
AuthorDate: Tue Feb 16 12:17:29 2021 +0200

    fix(database): ensure pk_constraint is JSON serializable (#13147)
---
 superset/models/core.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/superset/models/core.py b/superset/models/core.py
index 2327618..5d0dde3 100755
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -632,7 +632,10 @@ class Database(
     def get_pk_constraint(
         self, table_name: str, schema: Optional[str] = None
     ) -> Dict[str, Any]:
-        return self.inspector.get_pk_constraint(table_name, schema)
+        pk_constraint = self.inspector.get_pk_constraint(table_name, schema) 
or {}
+        return {
+            key: utils.base_json_conv(value) for key, value in 
pk_constraint.items()
+        }
 
     def get_foreign_keys(
         self, table_name: str, schema: Optional[str] = None

Reply via email to