{"id":21319,"library":"fakesnow","title":"fakesnow","description":"Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally using DuckDB. Current version: 0.11.6. Release cadence: approximately monthly.","status":"active","version":"0.11.6","language":"python","source_language":"en","source_url":"https://github.com/tekumara/fakesnow","tags":["snowflake","testing","mock","duckdb","fake"],"install":[{"cmd":"pip install fakesnow","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install fakesnow[server]","lang":"bash","label":"Install with server support"}],"dependencies":[{"reason":"fakesnow patches snowflake.connector.connect to return a fake connection, so snowflake-connector-python must be installed","package":"snowflake-connector-python","optional":false},{"reason":"Underlying in-memory database engine used for SQL execution","package":"duckdb","optional":false}],"imports":[{"note":"fakesnow does not expose a connect function; you use snowflake.connector.connect after fakesnow.patch()","wrong":"from fakesnow import connect","symbol":"fakesnow","correct":"import fakesnow"},{"note":"If you do 'import fakesnow' then you must call fakesnow.patch(), but it is clearer to import patch directly","wrong":"fakesnow.patch()","symbol":"fakesnow.patch","correct":"from fakesnow import patch; patch()"},{"note":"After fakesnow.patch(), snowflake.connector.connect is replaced with a fake version. Don't use fakesnow.connect.","wrong":"import fakesnow; conn = fakesnow.connect(...)","symbol":"snowflake.connector.connect","correct":"import snowflake.connector; conn = snowflake.connector.connect(...)"}],"quickstart":{"code":"import fakesnow\nimport snowflake.connector\n\nfakesnow.patch()\n\nconn = snowflake.connector.connect(\n    user='test',\n    password='test',\n    account='test',\n    database='MYDB',\n    schema='PUBLIC',\n    warehouse='test'\n)\n\ncur = conn.cursor()\ncur.execute('CREATE TABLE users (id INT, name STRING)')\ncur.execute(\"INSERT INTO users VALUES (1, 'Alice')\")\ncur.execute('SELECT * FROM users')\nprint(cur.fetchall())\n","lang":"python","description":"Patch snowflake.connector, create a fake connection, run SQL locally."},"warnings":[{"fix":"Upgrade to Python >=3.10 or pin fakesnow <0.11.0","message":"Python 3.9 support dropped in v0.11.0","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Update queries to use uppercase column names (e.g., 'TABLE_NAME' instead of 'table_name') or wrap in double quotes","message":"Information schema column names now uppercase (v0.10.0)","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Check GitHub issues/README for known limitations before relying on fakesnow for complex queries.","message":"fakesnow does NOT mock all Snowflake features. Unsupported SQL may raise errors or produce incorrect results.","severity":"gotcha","affected_versions":"all"},{"fix":"Run 'fakesnow.patch()' at the top of your test file or conftest.py, before any snowflake imports.","message":"Always call fakesnow.patch() BEFORE importing snowflake.connector if possible, or at least before any connection attempt.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install snowflake-connector-python","cause":"Missing snowflake-connector-python dependency","error":"ModuleNotFoundError: No module named 'snowflake'"},{"fix":"Use 'from fakesnow import patch' or 'import fakesnow; fakesnow.patch()'","cause":"Incorrect import; fakesnow does not export patch if imported incorrectly","error":"fakesnow.patch() not found"},{"fix":"Simplify the statement or check fakesnow's supported SQL subset (see GitHub README).","cause":"Unsupported SQL feature in fakesnow (e.g., certain DDL variations)","error":"snowflake.connector.errors.DatabaseError: 000404 (42S02): Table ... does not exist"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}