diff --git a/litellm-proxy-extras/litellm_proxy_extras/utils.py b/litellm-proxy-extras/litellm_proxy_extras/utils.py index 2930c128c8d..30aba6b1f49 100644 --- a/litellm-proxy-extras/litellm_proxy_extras/utils.py +++ b/litellm-proxy-extras/litellm_proxy_extras/utils.py @@ -230,7 +230,6 @@ class ProxyExtrasDBManager: idempotent_patterns = [ r"already exists", r"column .* already exists", - r"duplicate key value violates", r"relation .* already exists", r"constraint .* already exists", r"does not exist", diff --git a/tests/litellm-proxy-extras/test_litellm_proxy_extras_utils.py b/tests/litellm-proxy-extras/test_litellm_proxy_extras_utils.py index a8eff29b17b..38890ff8c5e 100644 --- a/tests/litellm-proxy-extras/test_litellm_proxy_extras_utils.py +++ b/tests/litellm-proxy-extras/test_litellm_proxy_extras_utils.py @@ -86,10 +86,10 @@ class TestIdempotentErrorDetection: error_message = "column 'email' already exists" assert ProxyExtrasDBManager._is_idempotent_error(error_message) is True - def test_is_idempotent_error_duplicate_key(self): - """Test detection of duplicate key violation error""" + def test_duplicate_key_violation_not_idempotent(self): + """Duplicate key violations (e.g., CREATE INDEX with duplicate data) are NOT idempotent""" error_message = "duplicate key value violates unique constraint" - assert ProxyExtrasDBManager._is_idempotent_error(error_message) is True + assert ProxyExtrasDBManager._is_idempotent_error(error_message) is False def test_is_idempotent_error_relation_already_exists(self): """Test detection of 'relation already exists' error"""