Make PostgresUserPasswordProfileMapping schema profile argument optional #675
Labels
area:profile
Related to ProfileConfig, like Athena, BigQuery, Clickhouse, Spark, Trino, etc
bug
Something isn't working
dbt:run
Primarily related to dbt run command or functionality
profile:postgres
Related to Postgres ProfileConfig
Milestone
Context
As of Cosmos 1.2.3, when users instantiate a
ProfileMapping
usingPostgresUserPasswordProfileMapping
, Cosmos expects users to define a schema:astronomer-cosmos/cosmos/profiles/postgres/user_pass.py
Line 24 in 773fa27
As illustrated below:
However,
dbt-postgres
does not have this property as a mandatory field. This is usually not an issue unless users want to define schemas specific to models. When this happens, dbt considers the schema set at the profile level as thetarget_schema
for applying acustom_schema
(macrogenerate_schema_name
): https://docs.getdbt.com/docs/build/custom-schemas.The consequence is that model-specific schemas are resolved incorrectly if the profile
schema=""
, by having an underscore pre-pre-appended.This issue was originally raised by tariq.f in the Airflow #ariflow-dbt slack channel:
https://apache-airflow.slack.com/archives/C059CC42E9W/p1700049843620749
Acceptance criteria
PostgresUserPasswordProfileMapping
schema profile argument optionalThe text was updated successfully, but these errors were encountered: