LewisDavies / upstream-prod

A dbt package for easily using production data in a development environment.
32 stars 4 forks source link

`check_reqd_vars` Contradictory Error Message #34

Closed PJDuszynski closed 4 months ago

PJDuszynski commented 5 months ago

Version: 0.8.0

The error message contained in the code block below contradicts the actual logic within the if statement.

    {% if prod_database is none and prod_database_replace is none %}
        {% set error_msg -%}
upstream_prod has been provided with two incompatible variables. Only one of the following should be set:
- upstream_prod_database
- upstream_prod_database_replace
        {%- endset %}
        {% do exceptions.raise_compiler_error(error_msg) %}
    {% endif %}

Based on the error message, it should be testing that both variables for is **not** none.

I was having some problems using this with the dbt-clickhouse adapter and overriding the macro with another version containingis not none in the if statement allowed me to compile.

LewisDavies commented 5 months ago

That's what I get for not updating the tests! Thanks for catching this @PJDuszynski, I'll fix and release an update today

LewisDavies commented 4 months ago

@PJDuszynski I've just merged a fix for this and will create a new release (v.0.8.1)