Skip to content

Commit

Permalink
Use "public" when schema is None (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
davideanastasia authored Apr 1, 2020
1 parent 2842827 commit 392a8e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbtmetabase/metabase.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ def build_metadata_lookups(self, database_id: str, schema: str) -> (dict, dict):

metadata = self.api('get', f'/api/database/{database_id}/metadata')
for table in metadata.get('tables', []):
if table['schema'].upper() != schema.upper():
table_schema = 'public' if table['schema'] is None else table['schema']
if table_schema.upper() != schema.upper():
continue

table_name = table['name'].upper()
Expand Down

0 comments on commit 392a8e2

Please sign in to comment.