Skip to content

Commit aafd743

Browse files
Updates to Streamlit Data Access and Grant Documentation
1 parent 082f8bc commit aafd743

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

docs/setup/snowflake-setup.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,28 +129,42 @@ alter account set session policy policies.public.account_session_policy;
129129
### Developing against production data
130130
131131
Our Snowflake architecture allows for reasonably safe `SELECT`ing from the production `RAW` database while developing models.
132-
While this could be expensive for large tables,
133-
it also allows for faster and more reliable model development.
132+
While this could be expensive for large tables, it also allows for faster and more reliable model development.
134133
135-
To develop against production `RAW` data, first you need someone with the `USERADMIN` role to grant rights to the `TRANSFORMER_DEV` role
136-
(this need only be done once, and can be revoked later):
134+
To develop against production data, first you need someone with the `USERADMIN` role to grant rights to the `TRANSFORMER_DEV` role (this need only be done once, and can be revoked later). These grants enable access to real data for development and facilitate cloning and deferral for large-table projects:
137135
138136
```sql
139137
USE ROLE USERADMIN;
140138
GRANT ROLE RAW_PRD_READ TO ROLE TRANSFORMER_DEV;
139+
GRANT ROLE TRANSFORM_PRD_READ TO ROLE TRANSFORMER_DEV;
140+
GRANT ROLE ANALYTICS_PRD_READ TO ROLE TRANSFORMER_DEV;
141141
```
142142
143-
!!! note
144-
This grant is not managed via terraform in order to keep the configurations of
145-
different environments as logically separate as possible. We may revisit this
146-
decision should the manual grant cause problems.
143+
**Note**
144+
These grants are not managed via Terraform in order to keep the configurations of
145+
different environments as logically separate as possible. We may revisit this
146+
decision should the manual grants cause problems.
147147
148148
You can then run dbt locally and specify the `RAW` database manually:
149149
150150
```bash
151151
DBT_RAW_DB=RAW_PRD dbt run
152152
```
153153
154+
### Streamlit dashboard development
155+
156+
All production Streamlit dashboards and their marts should reside in the `ANALYTICS_ENGCA_PRD` database.
157+
If a dashboard needs access to objects from earlier layers, they should be exposed via explicitly created mart tables in this database.
158+
159+
To support Streamlit development, the `REPORTER_DEV` role may need read access to the production marts:
160+
161+
```sql
162+
USE ROLE USERADMIN;
163+
GRANT ROLE ANALYTICS_PRD_READ TO ROLE REPORTER_DEV;
164+
```
165+
166+
Additionally, the cross-environment grant of the `${module.raw.name}_${var.environment}_STREAMLIT` role to the `REPORTER_DEV` role is managed manually via SQL, outside of Terraform.
167+
154168
### Add IT-Ops representatives
155169
156170
TODO: establish and document processes here.

0 commit comments

Comments
 (0)