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

Add SSO Creds to snowflake-dagster Profile #686

Merged
merged 7 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.local.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file should be copied to .env.local and manually filled out by devs after cloning.
export SYSTEM_SNOWFLAKE_USER='[email protected]'
export SYSTEM_SNOWFLAKE_PASSWORD='' # intentionally left blank for externalbrowser auth
export SYSTEM_SNOWFLAKE_AUTHENTICATOR='externalbrowser'
export SYSTEM_SNOWFLAKE_ROLE='ROLE_NAME'
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@ There are two ways to get help:
3. Write SQL model changes
4. Open a PR and view results of your changes directly in the Github Actions - more on this in [adding a new metric](#adding-a-new-metric).

For running on snowflake, create a `.env.local` file in the root of this repo with the following structure:
For running on snowflake, create a `.env.local` file in the root of this repo by running `cp .env.local.template .env.local` and filling out the necessary values.

```
export SYSTEM_SNOWFLAKE_USER=''
export SYSTEM_SNOWFLAKE_PASSWORD=''
export SYSTEM_SNOWFLAKE_ROLE=''
```

Run `source .env.local` to load these environment variables into your shell.
Run `source syncenv` to load these environment variables into your shell and install the necessary Python dependencies.

## System Design

Expand Down
4 changes: 3 additions & 1 deletion profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ snowflake-dagster:
account: IYTNLTJ-MWB17343

user: "{{ env_var('SYSTEM_SNOWFLAKE_USER') }}"
password: "{{ env_var('SYSTEM_SNOWFLAKE_PASSWORD') }}"
password: "{{ env_var('SYSTEM_SNOWFLAKE_PASSWORD', '') }}"
# snowflake client_store_temporary_credential is automatically set by dbt-snowflake
authenticator: "{{ env_var('SYSTEM_SNOWFLAKE_AUTHENTICATOR', 'snowflake') }}"

role: "{{ env_var('SYSTEM_SNOWFLAKE_ROLE') }}"
database: PC_DBT_DB
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
dbt-bigquery==1.7.4
dbt-core==1.7.17
dbt-extractor==0.5.1
dbt-semantic-interfaces==0.4.3
dbt-snowflake==1.7.1
pandas==2.0.2
numpy==1.26.4
sqlfluff==3.1.0
pre-commit
2 changes: 1 addition & 1 deletion syncenv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ python3 -m venv venv
. ./venv/bin/activate

pip install uv==0.2.15
uv pip sync requirements.txt
uv pip install -r requirements.txt
akan72 marked this conversation as resolved.
Show resolved Hide resolved

chmod +x dbt_scripts/run_sqlfluff_on_changed_files.sh

Expand Down
Loading