feat(sqllab): Add a configuration option to disable data preview (#19104)

This commit is contained in:
cccs-Dustin
2022-03-17 09:22:57 -04:00
committed by GitHub
parent cfb967f430
commit 02ef9ca4cd
18 changed files with 175 additions and 42 deletions

View File

@@ -212,6 +212,13 @@ class Database(
def explore_database_id(self) -> int:
return self.get_extra().get("explore_database_id", self.id)
@property
def disable_data_preview(self) -> bool:
# this will prevent any 'trash value' strings from going through
if self.get_extra().get("disable_data_preview", False) is not True:
return False
return True
@property
def data(self) -> Dict[str, Any]:
return {
@@ -225,6 +232,7 @@ class Database(
"allows_virtual_table_explore": self.allows_virtual_table_explore,
"explore_database_id": self.explore_database_id,
"parameters": self.parameters,
"disable_data_preview": self.disable_data_preview,
"parameters_schema": self.parameters_schema,
}