From 1196faaf716113c356ee2eeded8cc2af555362cd Mon Sep 17 00:00:00 2001 From: Siting Ren Date: Wed, 19 Apr 2023 16:32:16 +0800 Subject: [PATCH] Quick fix for #500 (#503) --- vertica_python/vertica/cursor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vertica_python/vertica/cursor.py b/vertica_python/vertica/cursor.py index 9b549221..870c0f15 100644 --- a/vertica_python/vertica/cursor.py +++ b/vertica_python/vertica/cursor.py @@ -39,6 +39,7 @@ import datetime import glob import inspect +import os import re import sys import traceback @@ -653,7 +654,7 @@ def object_to_string(self, py_obj, is_copy_data): # noinspection PyArgumentList def format_operation_with_parameters(self, operation, parameters, is_copy_data=False): if isinstance(parameters, dict): - if parameters and ':' not in operation: + if parameters and ':' not in operation and os.environ.get('VERTICA_PYTHON_IGNORE_NAMED_PARAMETER_CHECK') != '1': raise ValueError(f'Invalid SQL: {operation}' "\nHINT: When argument 'parameters' is a dict, variables in SQL should be specified with named (:name) placeholders." " If you use a dict to represent the value of a ROW type column, enclose the dict with brackets('[]') to construct a list.")