-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1193a79
commit 8249543
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
tests/functional/adapter/python_model_tests/test_logging.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from dbt.tests.util import run_dbt | ||
import pytest | ||
|
||
from tests.functional.adapter.python_model_tests._files import MODEL__LOGGING | ||
|
||
EVENT_TABLE_SQL = """ | ||
SELECT | ||
RECORD['severity_text']::STRING AS log_level, | ||
VALUE::STRING AS message, | ||
RESOURCE_ATTRIBUTES['snow.query.id']::STRING AS query_id | ||
FROM | ||
DXRX_OPERATIONS.LOGGING.EVENTS | ||
WHERE | ||
SCOPE['name']::STRING = 'dbt_logger' | ||
ORDER BY | ||
'TIMESTAMP' DESC | ||
; | ||
""" | ||
|
||
|
||
class TestPythonModelLogging: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"logging_model.py": MODEL__LOGGING} | ||
|
||
def test_logging(self, project): | ||
run_dbt(["run"]) |