Skip to content

Commit

Permalink
fix(database): ensure pk_constraint is JSON serializable (#13147)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Feb 16, 2021
1 parent d8c32b8 commit 5ab613d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion superset/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def get_indexes(
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
Expand Down

0 comments on commit 5ab613d

Please sign in to comment.