-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/datacoves3.3
- Loading branch information
Showing
74 changed files
with
934 additions
and
215 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
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
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
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
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 @@ | ||
OPENAI_API_KEY=abc.... |
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,22 @@ | ||
# dbt-osmosis | ||
|
||
## Set openai key from .env file | ||
`set -a && source /config/workspace/observe/osmosis/.env && set +a` | ||
|
||
## Run Refactor | ||
Executes organize which syncs yaml files with database schema. | ||
This also uses OpenAI to add descriptions to cols. | ||
|
||
`uvx --with=dbt-snowflake~=1.8.0 --from 'dbt-osmosis[openai]' dbt-osmosis yaml refactor --synthesize` | ||
|
||
Run without OpenAI | ||
|
||
`uvx --with=dbt-snowflake~=1.8.0 dbt-osmosis yaml refactor` | ||
|
||
You can pass `--fqn` with a name of a folder in `models/` to limit the refactor | ||
|
||
`dbt-osmosis yaml refactor --fqn L3_coves` | ||
|
||
Separate sub-folders with a `.` | ||
|
||
`dbt-osmosis yaml refactor --fqn L3_coves.loan_analytics` |
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
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,20 @@ | ||
from airflow.decorators import dag | ||
from orchestrate.utils.default_args import default_args | ||
from operators.datacoves.dbt import DatacovesDbtOperator | ||
|
||
|
||
@dag( | ||
default_args=default_args, | ||
description="Daily dbt run", | ||
schedule="0 12 * * *", | ||
tags=["transform"], | ||
catchup=False, | ||
) | ||
def default_args_dag(): | ||
run_dbt = DatacovesDbtOperator( | ||
task_id="run_dbt", bash_command="dbt run -s country_codes" | ||
) | ||
|
||
|
||
dag = default_args_dag() |
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,11 @@ | ||
# utils/default_args.py | ||
from datetime import datetime, timedelta | ||
|
||
default_args = { | ||
'owner': '[email protected]', | ||
'email_on_failure': False, | ||
'email_on_retry': False, | ||
'retries': 3, | ||
'retry_delay': timedelta(minutes=5), | ||
'start_date': datetime(2023, 12, 1), | ||
} |
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
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
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 |
---|---|---|
|
@@ -29,6 +29,8 @@ | |
can_login: true | ||
member_of: | ||
- analyst | ||
- accountadmin | ||
- securityadmin | ||
|
||
- sebastian: | ||
can_login: true | ||
|
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 @@ | ||
SLACK_API_TOKEN=xyz... |
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,31 @@ | ||
#!/usr/bin/env -S uv run --cache-dir /tmp/.uv_cache | ||
# /// script | ||
# dependencies = [ | ||
# "slack_sdk==3.34.0", | ||
# "python-dotenv" | ||
# ] | ||
# /// | ||
from slack_sdk import WebClient | ||
from slack_sdk.errors import SlackApiError | ||
from dotenv import load_dotenv | ||
import os | ||
|
||
load_dotenv() | ||
SLACK_TOKEN = os.getenv("SLACK_API_TOKEN") | ||
|
||
def send_hello_world(): | ||
# Initialize the Slack client with your bot token | ||
client = WebClient(token=SLACK_TOKEN) | ||
print("TEST") | ||
try: | ||
response = client.chat_postMessage( | ||
channel='#bot-aks-notifications', | ||
text='Hello, World! 👋' | ||
) | ||
print(f"Message sent successfully: {response['ts']}") | ||
|
||
except SlackApiError as e: | ||
print(f"Error sending message: {e.response['error']}") | ||
|
||
if __name__ == "__main__": | ||
send_hello_world() |
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
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
Oops, something went wrong.