Skip to content

Commit

Permalink
Quick fix for #500 (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
sitingren authored Apr 19, 2023
1 parent 26c3707 commit 1196faa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vertica_python/vertica/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import datetime
import glob
import inspect
import os
import re
import sys
import traceback
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 1196faa

Please sign in to comment.