Skip to content

Commit

Permalink
chore: add debug to tables endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed May 2, 2022
1 parent 1ebdaac commit 55dab89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ def tables( # pylint: disable=too-many-locals,no-self-use,too-many-arguments
cache_timeout=database.table_cache_timeout,
)
] or []
logger.debug("Loaded all tables from schema %s: %s", schema_parsed, tables)
views = [
utils.DatasourceName(*datasource_name)
for datasource_name in database.get_all_view_names_in_schema(
Expand All @@ -1133,25 +1134,30 @@ def tables( # pylint: disable=too-many-locals,no-self-use,too-many-arguments
cache_timeout=database.table_cache_timeout,
)
] or []
logger.debug("Loaded all views from schema %s: %s", schema_parsed, views)
else:
tables = [
utils.DatasourceName(*datasource_name)
for datasource_name in database.get_all_table_names_in_database(
cache=True, force=False, cache_timeout=24 * 60 * 60
)
]
logger.debug("Loaded all tables from database: %s", tables)
views = [
utils.DatasourceName(*datasource_name)
for datasource_name in database.get_all_view_names_in_database(
cache=True, force=False, cache_timeout=24 * 60 * 60
)
]
logger.debug("Loaded all views from database: %s", views)
tables = security_manager.get_datasources_accessible_by_user(
database, tables, schema_parsed
)
logger.debug("Filtered tables to: %s", tables)
views = security_manager.get_datasources_accessible_by_user(
database, views, schema_parsed
)
logger.debug("Filtered views to: %s", views)

def get_datasource_label(ds_name: utils.DatasourceName) -> str:
return (
Expand Down

0 comments on commit 55dab89

Please sign in to comment.