From 9dba1848a651fc96356b428d9fb9a523ed96b80f Mon Sep 17 00:00:00 2001 From: Dominic Tarro <57306102+dominictarro@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:36:28 -0400 Subject: [PATCH] fix: support case where cur.execute uses default param value =None --- src/prefecto/ext/snowflake.py | 2 +- tests/ext/test_snowflake.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/prefecto/ext/snowflake.py b/src/prefecto/ext/snowflake.py index 569a3b6..a7936d2 100644 --- a/src/prefecto/ext/snowflake.py +++ b/src/prefecto/ext/snowflake.py @@ -164,7 +164,7 @@ def _execute( # Obfuscate parameters if requested formatted_command_string = command % _obfuscate_params( - kwargs.get("params", {}), obfuscate_params + kwargs.get("params", {}) or {}, obfuscate_params ) logger.info("Beginning command.") diff --git a/tests/ext/test_snowflake.py b/tests/ext/test_snowflake.py index 0f3dcd4..bb2d95b 100644 --- a/tests/ext/test_snowflake.py +++ b/tests/ext/test_snowflake.py @@ -74,6 +74,12 @@ def test_execute_log_level_adjustment( None, "SELECT * FROM table", ), + ( + "SELECT * FROM table", + None, + None, + "SELECT * FROM table", + ), ( "SELECT * FROM table WHERE id = %(id)s", {"id": 123},