mirror of
https://github.com/apache/superset.git
synced 2026-04-21 00:54:44 +00:00
chore(sqllab): Cleanup /tables/... endpoint (#21284)
This commit is contained in:
@@ -72,38 +72,6 @@ class SqliteEngineSpec(BaseEngineSpec):
|
||||
def epoch_to_dttm(cls) -> str:
|
||||
return "datetime({col}, 'unixepoch')"
|
||||
|
||||
@classmethod
|
||||
def get_all_datasource_names(
|
||||
cls, database: "Database", datasource_type: str
|
||||
) -> List[utils.DatasourceName]:
|
||||
schemas = database.get_all_schema_names(
|
||||
cache=database.schema_cache_enabled,
|
||||
cache_timeout=database.schema_cache_timeout,
|
||||
force=True,
|
||||
)
|
||||
schema = schemas[0]
|
||||
if datasource_type == "table":
|
||||
return [
|
||||
utils.DatasourceName(*datasource_name)
|
||||
for datasource_name in database.get_all_table_names_in_schema(
|
||||
schema=schema,
|
||||
force=True,
|
||||
cache=database.table_cache_enabled,
|
||||
cache_timeout=database.table_cache_timeout,
|
||||
)
|
||||
]
|
||||
if datasource_type == "view":
|
||||
return [
|
||||
utils.DatasourceName(*datasource_name)
|
||||
for datasource_name in database.get_all_view_names_in_schema(
|
||||
schema=schema,
|
||||
force=True,
|
||||
cache=database.table_cache_enabled,
|
||||
cache_timeout=database.table_cache_timeout,
|
||||
)
|
||||
]
|
||||
raise Exception(f"Unsupported datasource_type: {datasource_type}")
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(
|
||||
cls, target_type: str, dttm: datetime, db_extra: Optional[Dict[str, Any]] = None
|
||||
|
||||
Reference in New Issue
Block a user