Skip to content

Commit

Permalink
Update dbt reader to take into account namespace prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Gouline committed Dec 13, 2019
1 parent 55a0834 commit 72c324e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'dbt_metabase'
version: '0.1.1'
name: 'metabase'
version: '0.1.2'

target-path: "target"
clean-targets: ["target", "dbt_modules"]
Expand Down
2 changes: 1 addition & 1 deletion dbtmetabase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .dbt import DbtReader
from .metabase import MetabaseClient

__version__ = '0.1.1'
__version__ = '0.1.2'

def export(dbt_path: str,
mb_host: str, mb_user: str, mb_password: str,
Expand Down
4 changes: 2 additions & 2 deletions dbtmetabase/dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def read_column(self, column: dict) -> dict:
mb_column['special_type'] = 'type/FK'
mb_column['fk_target_table'] = self.parse_ref(relationships['to']).upper()
mb_column['fk_target_column'] = relationships['field'].upper()
elif 'metabase' in test:
metabase = test['metabase']
elif 'metabase.column' in test:
metabase = test['metabase.column']
if mb_column.get('special_type') != 'type/FK':
mb_column['special_type'] = metabase.get('special_type')

Expand Down
2 changes: 1 addition & 1 deletion macros/tests.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% macro test_metabase(model, column_name, special_type) -%}
{% macro test_column(model, column_name, special_type) -%}
select '{{ special_type }}' as type where type not in (
'type/AvatarURL',
'type/Category',
Expand Down

0 comments on commit 72c324e

Please sign in to comment.