Skip to content

Commit

Permalink
Merge pull request #58 from OscarAdserballe/support_connections
Browse files Browse the repository at this point in the history
Add support for connections to remote models
  • Loading branch information
OscarAdserballe authored Aug 6, 2024
2 parents f7001ad + 40721ff commit 5ef1535
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "dbt_ml"
version: "0.6.0"
version: "0.6.1"

config-version: 2

Expand Down
14 changes: 10 additions & 4 deletions macros/materializations/model.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@
{{ sql_header if sql_header is not none }}

create or replace model {{ relation }}

{% if ml_config.get('connection_name') %}
remote with connection `{{ ml_config.pop('connection_name') }}`
{% endif %}

{{ dbt_ml.model_options(
ml_config=ml_config,
labels=raw_labels
) }}
{%- if ml_config.get('MODEL_TYPE', ml_config.get('model_type', '')).lower() != 'tensorflow' -%}
as (
{{ sql }}
);

{%- if sql -%}
as (
{{ sql }}
);
{%- endif -%}
{% endmacro %}

Expand Down

0 comments on commit 5ef1535

Please sign in to comment.