Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-316] [Bug] tests set with severity: warn creates a level:error row with --log-format json #4814

Closed
1 task done
karlanka opened this issue Mar 2, 2022 · 4 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working logging

Comments

@karlanka
Copy link

karlanka commented Mar 2, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a model with a test set to severity warn:

-- test_trigger.sql
SELECT 1 AS numb
UNION ALL
SELECT 1
version: 2

models:
  - name: test_trigger
    columns:
      - name: numb
        tests:
          - unique:
              config:
                severity: warn

I run this as dbt --log-format json test -m test_trigger, which generates a bunch of logs. The two important are these:

{
    "code": "Z021",
    "data": {
        "node_name": "unique_test_trigger_numb",
        "path": "models\\pbi\\test_trigger.yml",
        "resource_type": "test"
    },
    "invocation_id": "75c78961-8621-47f9-b082-f8b8efaf4203",
    "level": "warn",
    "log_version": 1,
    "msg": "\u001b[33mWarning in test unique_test_trigger_numb (models\\pbi\\test_trigger.yml)\u001b[0m",
    "node_info": {},
    "pid": 10548,
    "thread_name": "MainThread",
    "ts": "2022-03-02T11:58:14.824775Z",
    "type": "log_line"
}
{
    "code": "Z024",
    "data": {
        "msg": "Got 1 result, configured to warn if != 0"
    },
    "invocation_id": "75c78961-8621-47f9-b082-f8b8efaf4203",
    "level": "error",
    "log_version": 1,
    "msg": "  Got 1 result, configured to warn if != 0",
    "node_info": {},
    "pid": 10548,
    "thread_name": "MainThread",
    "ts": "2022-03-02T11:58:14.824775Z",
    "type": "log_line"
}

The first line has level:warn as expected. But the second has level:error, which I do not expect.

Expected Behavior

A test set with severity:warn should produce no log rows with level:error.

Environment

- OS: Windows 10
- Python: 3.9.6
- dbt: dbt-core=1.0.3, dbt-redshift=1.0.0

What database are you using dbt with?

redshift

Additional Context

No response

@karlanka karlanka added bug Something isn't working triage labels Mar 2, 2022
@github-actions github-actions bot changed the title [Bug] tests set with severity: warn creates a level:error row with --log-format json [CT-316] [Bug] tests set with severity: warn creates a level:error row with --log-format json Mar 2, 2022
@iknox-fa
Copy link
Contributor

Hi @karlanka, thanks for bringing us this bug report. I can confirm the behavior you're seeing and should have a fix out for it in main shortly.

@iknox-fa iknox-fa removed the triage label Mar 16, 2022
@iknox-fa iknox-fa self-assigned this Mar 16, 2022
@iknox-fa
Copy link
Contributor

iknox-fa commented Apr 11, 2022

@karlanka I just wanted to follow up about this issue. It's exposed a larger problem in our event logging so while your PR does bandaid the solution*, I'm going to close this ticket in favor of #4914.

@jtcohen6 if you'd like to apply a bandaid here let us know and we can get that PR merged, but the consensus on the team at BLG today was we'd rather fix it holistically as described in #4914

* mine did too 😬

@karlanka
Copy link
Author

@iknox-fa allright - I close my PR and wait for either your bandaid or a proper fix. I have a not-so-nice workaround to filter out these logs, so I can live with this behavior for now :)

@jtcohen6
Copy link
Contributor

I'm going to close this issue, in favor of the better tech-debt resolution described in #4914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logging
Projects
None yet
3 participants