Skip to content

Commit

Permalink
Move to utilities folder, add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
austinweisgrau committed Aug 31, 2023
1 parent d7156a9 commit 80f490d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
4 changes: 0 additions & 4 deletions parsons/dbt/__init__.py

This file was deleted.

42 changes: 37 additions & 5 deletions parsons/dbt/dbt.py → parsons/utilities/dbt.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
"""Utility for running and logging output from dbt commands
Enable this utility by installing parsons with a dbt extra:
`pip install parsons[dbt-redshift]`
or `pip install parsons[dbt-postgres]`
or `pip install parsons[dbt-snowflake]`
or `pip install parsons[dbt-bigquery]`
For the slack integration to work, you'll need to include the slack extra:
`pip install parsons[dbt-redshift,slack]`, etc.
To run dbt commands, you will need to have a dbt project directory
somewhere on the local filesystem.
If slack-related arguments or environment variables are not provided,
no log message will be sent to slack.
Example usage:
```
from parsons.utilities.dbt import dbtRunner
dbt_runner = dbtRunner(
commands: ['run', 'test']
dbt_project_directory: '/home/ubuntu/code/dbt_project/',
dbt_schema: 'dbt_dev'
)
dbt_runner.run()
```
"""


import json
import logging
import shutil
import pathlib
import os
import pathlib
import shutil
import subprocess
import time
from typing import List, Literal, Optional

from parsons.notifications.slack import Slack
import json
from typing import Optional, Literal, List
from parsons.utilities import check_env
import time

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 80f490d

Please sign in to comment.