fal-ai / dbt-fal

do more with dbt. dbt-fal helps you run Python alongside dbt, so you can send Slack alerts, detect anomalies and build machine learning models.
https://fal.ai/dbt-fal
Apache License 2.0
853 stars 72 forks source link

Context test column name is None #791

Closed hilcik closed 1 year ago

hilcik commented 1 year ago

Describe the bug When accessing context.current_model.tests the column name is None if the tests are defined on table level instead of column level. For example these two tests below are doing the same thing, but only the one in columns key will have the column name metadata populated in context.

tests:
  - unique:
      column_name: col
columns:
  - name: col
    tests:
      - unique

Your environment

- Adapter being used: athena: 1.4.1

**How to reproduce**
1. Define a test in a yml file for an existing dbt model on a table level and specify a column. For example:

models:

Expected behavior I would expect to see column='col'

Actual behavior column=None

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

mederka commented 1 year ago

Thanks for raising this, @hilcik, I'm looking into this.

mederka commented 1 year ago

Hi @hilcik :wave: , we just released fal==0.8.3, it should fix this issue. Please, let us know if you run into other problems.

hilcik commented 1 year ago

@mederka amazing, thanks. You are fast!