Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
chore(tableau): add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
Vixtir committed Oct 3, 2023
1 parent 9e2ec94 commit 552a68d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions odd_collector/adapters/tableau/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def get_sheets(self) -> list[Sheet]:
return [Sheet.from_response(response) for response in sheets_response]

def get_databases(self) -> dict[str, Union[EmbeddedDatabase, ExternalDatabase]]:
logger.debug("Getting databases")
databases = self._query(query=databases_query, root_key="databasesConnection")

connection_params = self.get_servers()

result = {}
Expand All @@ -128,6 +130,7 @@ def get_databases(self) -> dict[str, Union[EmbeddedDatabase, ExternalDatabase]]:
logger.warning(f"Couldn't get database: {db.get('name')} {e}")
continue

logger.debug(f"Got {len(result)} databases")
return result

def get_tables(self) -> dict[str, Table]:
Expand Down
4 changes: 3 additions & 1 deletion odd_collector/adapters/tableau/domain/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def __new__(cls, *args, **kwargs):
if kwargs["connection_type"].lower() in subclass._CONNECTION_TYPE:
return super().__new__(subclass)

raise NotImplementedError("Database is not supported")
raise NotImplementedError(
f"Database {kwargs['connection_type']} is not supported"
)

def __post_init__(self):
self.tables = [self.create_table(**table) for table in self.tables]
Expand Down

0 comments on commit 552a68d

Please sign in to comment.