LewisDavies / upstream-prod

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

Error with `prefer_recent` variable in ref.sql #31

Closed andreviniciusmb closed 4 months ago

andreviniciusmb commented 6 months ago

Context

I want to configure the preference to select the latest model (even though it is in dev) or not, and this can be done using the variable upstream_prod_prefer_recent.

Problem

Even setting the variable to False and not having the most up-to-date tables in my staging, the package continues to reference the tables in my staging.

Ex: As the prefer_recent variable is False and dev_exists is True, it could not be entered in the if command.

When I did this test checking if the variable was False, the if command did not enter.

LewisDavies commented 5 months ago

Thanks for catching this, and sorry for my slow reply. I've had this problem before when I haven't done a explicit comparison like prefer_recent == false - it's easy to miss because in Jinja it doesn't cause an error.

I've gone through the package and fixed any statements like this. I should be able to release a new version fixing this soon.

LewisDavies commented 4 months ago

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