-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use internal macro pilo_star as a workaround for star()
While waiting for dbt_utils.star() to be fixed with dbt-labs/dbt-utils#732, we will use this proxy macro to not having to repeat the tedious if/else in all of our scripts.
- Loading branch information
Showing
12 changed files
with
29 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% macro pilo_star(table_name, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%} | ||
/* FIXME(vperron): Normally, sqlfluff rendering star() should render a `*`. | ||
But for some reason it does not, yet, or not anymore. | ||
https://github.com/dbt-labs/dbt-utils/pull/732 | ||
In the meantime, and since we don't want to fully maintain an intialized DB in CI, | ||
we have to workaround it. I would have like to monkeypatch it in CI (some override of | ||
the macro somewhere) but could not find a way to do it. Essentialy, we would want the | ||
following code being applied automatically. */ | ||
{%- if env_var('CI', '') -%} | ||
id | ||
{%- else -%} | ||
{{ dbt_utils.star(table_name, relation_alias, except, prefix, suffix, quote_identifiers) }} | ||
{%- endif -%} | ||
{% endmacro %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
select | ||
{% if env_var('CI', '') %} | ||
id | ||
{% else %} | ||
{{ dbt_utils.star(ref('candidatures_echelle_locale')) }} | ||
{% endif %} | ||
{{ pilo_star(ref('candidatures_echelle_locale')) }} | ||
from {{ ref('candidatures_echelle_locale') }} | ||
where "type_org_prescripteur" in ('CHRS', 'CHU', 'RS_FJT', 'OIL') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
select | ||
{% if env_var('CI', '') %} | ||
id | ||
{% else %} | ||
{{ dbt_utils.star(ref('stg_organisations')) }} | ||
{% endif %} | ||
{{ pilo_star(ref('stg_organisations')) }} | ||
from {{ ref('stg_organisations') }} | ||
where type in ('CHRS', 'CHU', 'RS_FJT', 'OIL') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
select | ||
{% if env_var('CI', '') %} | ||
id | ||
{% else %} | ||
{{ dbt_utils.star(ref('stg_reseaux')) }} | ||
{% endif %} | ||
{{ pilo_star(ref('stg_reseaux')) }} | ||
from | ||
{{ ref('stg_reseaux') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 1 addition & 12 deletions
13
dbt/models/marts/suivi_candidatures_prescripteurs_habilites.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters