https://meltano.com/ logo
#announcements
Title
# announcements
c

clever-football-96790

02/02/2021, 2:37 PM
Hi, I'm trying to run dbt transfromations in my pipeline and getting the following error. I'm nit really sure where to set this variable.
Copy code
dbt | Running with dbt=0.16.1
dbt | Encountered an error:
dbt | Compilation Error
dbt | Env var required but not provided: 'DBT_SOURCE_SCHEMA'
Thanks, Ingo
1
r

ripe-musician-59933

02/02/2021, 6:42 PM
@clever-football-96790 What extractor and loader are you running
dbt
with? Can you share your
meltano elt
invocation? The
DBT_SOURCE_SCHEMA
env var corresponds to dbt's
source_schema
setting, which (through a few layers of indirection: https://meltano.com/docs/integration.html#how-to-use) is typically set to the loader's
schema
, which itself is typically set to the extractor's namespace (e.g.
tap_gitlab
for
tap-gitlab
). If
DBT_SOURCE_SCHEMA
is not set, that suggests that one of these settings is missing. Are you using a custom loader, by any chance?
c

clever-football-96790

02/03/2021, 5:51 AM
Hi, yes, I'm using the custom Redshift loader from pipelinewise. The invocation is via the UI atm where I selected run transform. The loader uses an attribute called
default_target_schema
instead of
schema
. I set an additional attribute
meltano config <loader> set _target_schema <target_schema>
and that did the trick.
r

ripe-musician-59933

02/03/2021, 4:10 PM
Great! You can also set
target_schema: $TARGET_REDSHIFT_DEFAULT_TARGET_SCHEMA
in the
meltano.yml
definition for
target-redshift
so that it automatically picks up the value for its
default_target_schema
setting.
c

clever-football-96790

02/04/2021, 9:12 AM
Does that also work with loaders that inherit from
target-redshift
because the
default_target_schema
is different
r

ripe-musician-59933

02/04/2021, 3:42 PM
Yes, that should work