-
Notifications
You must be signed in to change notification settings - Fork 175
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
[ADAP-1046] [CT-3418] [Bug] dbt python model logging not working with snowflake #846
Comments
any progress? |
@manishkundu @wenbaolicat I've tried quite a lot of combinations of settings and I believe this comes down to the settings on |
@manishkundu @wenbaolicat It looks like the import logging
import snowflake.snowpark as snowpark
import snowflake.snowpark.functions as f
from snowflake.snowpark.functions import *
logger = logging.getLogger("dbt_logger")
logger.info("******Inside Logging module.******")
def model(dbt, session: snowpark.Session):
# To use: GRANT MODIFY SESSION LOG LEVEL ON ACCOUNT TO ROLE <DBT_ROLE>;
dbt.config(pre_hook='ALTER SESSION SET LOG_LEVEL=INFO;')
logger.info("******Logging start.******")
df=session.sql(f"select current_user() as session_user, current_role() as session_role")
logger.info("******Logging End.******")
return df Please let me know if this is still not working for you. |
Is this a new bug in dbt-core?
Current Behavior
dbt python model logging statement not able to put logs inside snowflake event table.
Model Name: Logging_test.py
Code:
Expected Behavior
dbt model should put log in event table
Steps To Reproduce
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
While executing the dbt generated store procedure from snowsight, it's working fine and insert logs in event log table
The text was updated successfully, but these errors were encountered: