Skip to content

Commit

Permalink
fix: patching in fakesnow.ipynb
Browse files Browse the repository at this point in the history
it wasn't working because the finally was undoing the patching when the
context manager was garbage collected

now we hold the reference p to avoid this
  • Loading branch information
tekumara committed Apr 26, 2024
1 parent 62c7661 commit 388c0ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion notebooks/fakesnow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"\n",
"import fakesnow\n",
"\n",
"fakesnow.patch().__enter__()\n",
"p = fakesnow.patch()\n",
"p.__enter__()\n",
"conn = snowflake.connector.connect(database='db1', schema='schema1')\n",
"cur = conn.cursor()\n",
"print(cur.execute(\"SELECT 'Hello fake world!'\").fetchone())\n"
Expand Down

0 comments on commit 388c0ef

Please sign in to comment.