LewisDavies / upstream-prod

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

macro 'dbt_macro__ref' takes no keyword argument 'v' #11

Closed andreviniciusmb closed 1 year ago

andreviniciusmb commented 1 year ago

Describe the feature

With the update of dbt versions, we now have the possibility to add the version in the ref.sql file, as referenced here. When using the dbt Python Models and the upstream-prod I had a problem because the dbt does not find the argument 'v' which would be the version of the macro ref, as shown in the image below:

Possible Solution

Add the arguments 'v' or 'version' to the ref macro.

Environment

- OS: Linux 22.04.2 LTS
- Python: 3.9.16
- dbt: 1.5.1
- upstream_prod: 0.5.0
LewisDavies commented 1 year ago

Thanks for raising this @andreviniciusmb, I've had a quick look and this should be a relatively straightforward fix. I'll make the change, update my tests and open a PR soon.

LewisDavies commented 1 year ago

@andreviniciusmb I've created a fix and the new tests are passing. Would you mind testing it on your project to confirm? You can install the new version by adding this to packages.yml:

packages:
  - git: https://github.com/LewisDavies/upstream-prod.git
    revision: model-versions
andreviniciusmb commented 1 year ago

Thank you! The problem was solved.

sameerailawadi commented 8 months ago

Hi @LewisDavies Can you please elaborate the steps to use the upstream_prod ref function in a python dbt model? Thanks, Sameer