Hi, I'm trying to run dbt transfromations in my pi...
# announcements
i
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
d
@ingo_klose 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?
i
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.
d
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.
i
Does that also work with loaders that inherit from
target-redshift
because the
default_target_schema
is different
d
Yes, that should work