Registry / database / fakesnow

fakesnow

JSON →
library0.11.9pypypi✓ verified 90d ago

Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally using DuckDB. Current version: 0.11.6. Release cadence: approximately monthly.

pip install fakesnow
INSTALL
IMPORT
SIG · FAKESNOW
F
fakesnow
databasepythonv0.11.9
Install
10.0s avg
Import
2618ms
Disk
309MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.11.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
build_error
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 10.0s · import 2.618s · 309MB
309MB installed
● package 309MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fakesnow
✓ import fakesnow
✗ from fakesnow import connect
fakesnow does not expose a connect function; you use snowflake.connector.connect after fakesnow.patch()
fakesnow.patch
✓ from fakesnow import patch; patch()
✗ fakesnow.patch()
If you do 'import fakesnow' then you must call fakesnow.patch(), but it is clearer to import patch directly
snowflake.connector.connect
✓ import snowflake.connector; conn = snowflake.connector.connect(...)
✗ import fakesnow; conn = fakesnow.connect(...)
After fakesnow.patch(), snowflake.connector.connect is replaced with a fake version. Don't use fakesnow.connect.

Patch snowflake.connector, create a fake connection, run SQL locally.

import fakesnow import snowflake.connector fakesnow.patch() conn = snowflake.connector.connect( user='test', password='test', account='test', database='MYDB', schema='PUBLIC', warehouse='test' ) cur = conn.cursor() cur.execute('CREATE TABLE users (id INT, name STRING)') cur.execute("INSERT INTO users VALUES (1, 'Alice')") cur.execute('SELECT * FROM users') print(cur.fetchall())
Debug
Known issues
breakingPython 3.9 support dropped in v0.11.0
fix
Upgrade to Python >=3.10 or pin fakesnow <0.11.0
affects: >=0.11.0
breakingInformation schema column names now uppercase (v0.10.0)
fix
Update queries to use uppercase column names (e.g., 'TABLE_NAME' instead of 'table_name') or wrap in double quotes
affects: >=0.10.0
gotchafakesnow does NOT mock all Snowflake features. Unsupported SQL may raise errors or produce incorrect results.
fix
Check GitHub issues/README for known limitations before relying on fakesnow for complex queries.
affects: all
gotchaAlways call fakesnow.patch() BEFORE importing snowflake.connector if possible, or at least before any connection attempt.
fix
Run 'fakesnow.patch()' at the top of your test file or conftest.py, before any snowflake imports.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'snowflake'
Missing snowflake-connector-python dependency
fix
pip install snowflake-connector-python
fakesnow.patch() not found
Incorrect import; fakesnow does not export patch if imported incorrectly
fix
Use 'from fakesnow import patch' or 'import fakesnow; fakesnow.patch()'
snowflake.connector.errors.DatabaseError: 000404 (42S02): Table ... does not exist
Unsupported SQL feature in fakesnow (e.g., certain DDL variations)
fix
Simplify the statement or check fakesnow's supported SQL subset (see GitHub README).
Upgrade
Version history
0.11.9latest on PyPI · released Jun 13, 2026
Audit
Dependencies
snowflake-connector-pythonrequiredfakesnow patches snowflake.connector.connect to return a fake connection, so snowflake-connector-python must be installed
duckdbrequiredUnderlying in-memory database engine used for SQL execution
Agent activity
18 hits · last 30 days
node
18
Resources
fakesnow — pip install fakesnow · libregistry