simone_gaiarin
02/08/2023, 2:53 PMprod
my source is called my_source
, while in dev
my source is called my_source_smith
(smith is the last name of the developer). The developer is defined in a DEVELOPER
environment variable. What is the best way to achieve this? Does it make sense to parametrize the sources (the idea is to make the dev environments completely independent among develpers)?
Hi. I would like to parametrize my sources so that in theedgar_ramirez_mondragon
02/08/2023, 6:18 PMsimone_gaiarin
02/10/2023, 1:20 PMedgar_ramirez_mondragon
02/10/2023, 3:54 PMsimone_gaiarin
02/13/2023, 7:58 AMsimone_gaiarin
02/13/2023, 8:02 AMversion: 2
sources:
- name: "mysource{{ env_var('DATASET_SUFFIX', '') }}"
model:
with
source as (
select *
from {{ source(source_name('mysource'), 'mytable') }}
),
macro:
{% macro source_name(the_name) %}{{ the_name + env_var('DATASET_SUFFIX', '') }}{% endmacro %}%
I couldn't figure out a way to create a macro/function to use in the source.yml instead of using env_var directly