-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Labels
triage:productIn Product's queueIn Product's queuetype:bugSomething isn't working as documentedSomething isn't working as documented
Description
Is this a new bug?
- I believe this is a new bug
- I have searched the existing issues, and I could not find an existing issue for this bug
Which packages are affected?
- dbt-adapters
- dbt-tests-adapter
- dbt-athena
- dbt-athena-community
- dbt-bigquery
- dbt-postgres
- dbt-redshift
- dbt-snowflake
- dbt-spark
Current Behavior
When a python model is used in Snowflake for "table" materializaion, new table has all grants of previous table lost.
Expected Behavior
py_write_table
macro should set copy_grants
config.
Steps To Reproduce
- Create a basic dbt project with setting
models:
+copy_grants: true
- Create a model
from snowflake.snowpark import Session, DataFrame
from snowflake.snowpark import functions as F
def model(dbt, session: Session) -> DataFrame:
dbt.config(materialized="table")
df = session.range(1).select(F.lit(1).alias("col"))
return df
dbt run
In Snowflake query history you will see a stored procedure with python code, but copy_grants
won't be in the df.write...
call.
Relevant log output
Environment
- OS: mac
- Python: 3.10.9
- dbt-adapters: 1.9.2
- snowflake: 1.9.2
Additional Context
No response
Metadata
Metadata
Assignees
Labels
triage:productIn Product's queueIn Product's queuetype:bugSomething isn't working as documentedSomething isn't working as documented