mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
Feat: Adding table comment and columns comment for SQLLab (#10844)
* Adding table comment and columns comment for backend * fix mypy * Fix CI * adding wider catch * use logger * fix lint
This commit is contained in:
@@ -73,6 +73,7 @@ def get_table_metadata(
|
||||
indexes = get_indexes_metadata(database, table_name, schema_name)
|
||||
keys += foreign_keys + indexes
|
||||
payload_columns: List[Dict[str, Any]] = []
|
||||
table_comment = database.get_table_comment(table_name, schema_name)
|
||||
for col in columns:
|
||||
dtype = get_col_type(col)
|
||||
payload_columns.append(
|
||||
@@ -81,6 +82,7 @@ def get_table_metadata(
|
||||
"type": dtype.split("(")[0] if "(" in dtype else dtype,
|
||||
"longType": dtype,
|
||||
"keys": [k for k in keys if col["name"] in k["column_names"]],
|
||||
"comment": col.get("comment"),
|
||||
}
|
||||
)
|
||||
return {
|
||||
@@ -97,4 +99,5 @@ def get_table_metadata(
|
||||
"primaryKey": primary_key,
|
||||
"foreignKeys": foreign_keys,
|
||||
"indexes": keys,
|
||||
"comment": table_comment,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user