question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SNOW-522232: SAWarning: Dialect snowflake:snowflake will not make use of SQL compilation caching as it does not set the 'supports_statement_cache' attribute to ``True``.

See original GitHub issue

Python 3.8.9 macOS-11.6.2-x86_64-i386-64bit snowflake-connector-python: 2.7.2 snowflake-sqlalchemy: 1.3.3 SQLAlchemy: 1.4.28

I imported the following…

import pandas as pd
from sqlalchemy import create_engine
from snowflake.sqlalchemy import URL
import snowflake.connector

Then, I created a new engine and executed my first query…

url = URL(CREDENTIALS) 
engine = create_engine(url)
connection = engine.connect()

pd.read_sql(QUERY, connection)

Received the following warning…

/Users/NAME/.local/lib/python3.8/site-packages/snowflake/sqlalchemy/snowdialect.py:206: SAWarning: Dialect snowflake:snowflake will not make use of SQL compilation caching as it does not set the ‘supports_statement_cache’ attribute to True. This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions. Dialect maintainers should seek to set this attribute to True after appropriate development and testing for SQLAlchemy 1.4 caching support. Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
uncle-sammcommented, Feb 1, 2022

For those who’d like this warning to be disabled do this before creating an engine:

from snowflake.sqlalchemy.snowdialect import SnowflakeDialect

SnowflakeDialect.supports_statement_cache = False
1reaction
allenlawrence94commented, Feb 22, 2022

Could we just set supports_statement_cache to False for now? Preferably in this package, rather than users doing it manually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Snowflake SQLAlchemy 'supports_statement_cache' warning
SAWarning : Dialect snowflake:snowflake will not make use of SQL compilation caching as it does not set the 'supports_statement_cache' ...
Read more >
Performance - SQLAlchemy 1.4 Documentation
SAWarning : Dialect database:driver will not make use of SQL compilation caching as it does not set the 'supports_statement_cache' attribute to ``True``.
Read more >
For testing purpose, how can I prevent my query using the ...
For testing purpose, how can I prevent my query using the cache? In order to get "cold" timings, how can I avoid my...
Read more >
When to set "cache_ok" to True? - Google Groups
to sqlalchemy. I have consistently receiving the warning: will not produce a cache key because the ``cache_ok`` flag is not set to True....
Read more >
How does the Snowflake Cache Work? - Analytics.Today
Snowflake holds both a data cache in SSD in addition to a result cache to maximise SQL query performance. While you cannot adjust...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found