Gautam B
02/21/2023, 10:24 AMdbtArguments JSON key of the operator_dbt column for passing in the --vars argumen to dbt, so it knows which source tenant schema to write to. It looks like this:
select operator_dbt from operation o ;
{"gitRepoUrl": "https://oauth2:<key>@github.com/<org>/<repo>-etl.git", "dockerImage": "ghcr.io/dbt-labs/dbt-postgres:1.4.1", "dbtArguments": "run --vars \"{source_schema: tenant_5f9d3c9}\"", "gitRepoBranch": "main"}
For each of the connection we will have a separate operation with a different tenant_id
However when running it with this JSON, somehow the Airbyte is stripping the " from the "dbtArguments" key. We tried all combinations and each time the " was stripped, as visible in the logs below.
2023-02-21 08:50:57 INFO i.a.c.i.LineGobbler(voidCall):114 - Checking if ghcr.io/dbt-labs/dbt-postgres:1.4.1 exists...
2023-02-21 08:50:57 INFO i.a.c.i.LineGobbler(voidCall):114 - ghcr.io/dbt-labs/dbt-postgres:1.4.1 was found locally.
2023-02-21 08:50:57 INFO i.a.w.p.DockerProcessFactory(create):125 - Creating docker container = dbt-postgres-custom-21-0-ilecx with resources io.airbyte.config.ResourceRequirements@7a3b5d56[cpuR
equest=,cpuLimit=,memoryRequest=,memoryLimit=] and allowedHosts null
2023-02-21 08:50:57 INFO i.a.w.p.DockerProcessFactory(create):170 - Preparing command: docker run --rm --init -i -w /data/21/0/transform --log-driver none --name dbt-postgres-custom-21-0-ilecx -
-network host -v airbyte_workspace:/data -v /tmp/airbyte_local:/local -e DEPLOYMENT_MODE=OSS -e AIRBYTE_ROLE= -e WORKER_ENVIRONMENT=DOCKER -e AIRBYTE_VERSION=0.40.32 --entrypoint /bin/bash ghcr.
io/dbt-labs/dbt-postgres:1.4.1 entrypoint.sh run --vars source_schema: tenant_5f9d3c9
2023-02-21 08:50:57 dbt > Running from /data/21/0/transform/git_repo
2023-02-21 08:50:57 dbt > detected no config file for ssh, assuming ssh is off.
2023-02-21 08:50:57 dbt > Running: dbt run --vars source_schema: tenant_5f9d3c9 --profiles-dir=/data/21/0/transform --project-dir=/data/21/0/transform/git_repo
2023-02-21 08:50:58 dbt > usage: dbt [-h] [--version] [-r RECORD_TIMING_INFO] [-d]
2023-02-21 08:50:58 dbt > [--log-format {text,json,default}] [--no-write-json]
2023-02-21 08:50:58 dbt > [--use-colors | --no-use-colors] [--printer-width PRINTER_WIDTH]
2023-02-21 08:50:58 dbt > [--warn-error | --warn-error-options WARN_ERROR_OPTIONS]
2023-02-21 08:50:58 dbt > [--no-version-check] [--partial-parse | --no-partial-parse]
2023-02-21 08:50:58 dbt > [--use-experimental-parser] [--no-static-parser]
2023-02-21 08:50:58 dbt > [--profiles-dir PROFILES_DIR] [--no-anonymous-usage-stats] [-x]
2023-02-21 08:50:58 dbt > [-q] [--no-print]
2023-02-21 08:50:58 dbt > [--cache-selected-only | --no-cache-selected-only]
2023-02-21 08:50:58 dbt > {docs,source,init,clean,debug,deps,list,ls,build,snapshot,run,compile,parse,test,seed,run-operation}
2023-02-21 08:50:58 dbt > ...
2023-02-21 08:50:58 dbt > dbt: error: unrecognized arguments: tenant_5f9d3c9
Some other combinations that we tried:
"run --vars \"{source_schema: tenant_5f9d3c9}\""
"run --vars '{source_schema: tenant_5f9d3c9}'"Marcos Marx (Airbyte)
02/21/2023, 12:43 PMGautam B
02/21/2023, 1:21 PMGautam B
02/21/2023, 4:33 PM