medic/dataemon

Bug in Postgres port configuration in dbt profile

Closed this issue · 0 comments

There is a bug in the following code snippet in the dbt profile:

default:
  target: dev
  outputs:
    dev:
      type: postgres
      host: "{{ env_var('POSTGRES_HOST') }}"
      user: "{{ env_var('POSTGRES_USER') }}"
      password: "{{ env_var('POSTGRES_PASSWORD') }}"
      port: "{{ env_var('POSTGRES_PORT', 5432) }}"
      dbname: "{{ env_var('POSTGRES_DB') }}"
      schema: "{{ env_var('POSTGRES_SCHEMA') }}"

On line port: "{{ env_var('POSTGRES_PORT', 5432) }}", the system is expecting an integer value for the POSTGRES_PORT environment variable, but it is receiving a string, causing a runtime error while reading profiles.

Error logs:

17:06:13  Encountered an error while reading profiles:
17:06:13    ERROR: Runtime Error
  Credentials in profile "default", target "dev" invalid: '5432' is not of type 'integer'
17:06:13  Defined profiles:
17:06:13   - default

This issue needs to be fixed to ensure the correct configuration of the Postgres port in the dbt profile.