gouline / dbt-metabase

dbt + Metabase integration
https://pypi.org/project/dbt-metabase/
MIT License
461 stars 71 forks source link

Shouldn't overwrite semantic_type if not set #118

Closed willbryant closed 2 years ago

willbryant commented 2 years ago

In my personal opinion, if semantic_type is not configured in the dbt schema, the value currently set in Metabase should be retained.

I was surprised when I ran dbt-metabase (in order to upload column descriptions) and found that Metabase's initial guesses at the semantic types (which were mostly correct), plus a few that I'd done manually, had all been reset.

To avoid this, IMHO the semantic type should only be set if metabase.semantic_type is explicitly specified. Changing this behavior would have the downside that if you had previously set metabase.semantic_type and then removed it, the type would not be un-set. But in my opinion that is not surprising behavior.

@gouline do you agree? I won't try and have a go this one if you wouldn't accept it.

gouline commented 2 years ago

Agreed, that's how I originally intended. This must be a regression introduced at some point in 0.8.x. Fixed it already.