Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix for #500 #503

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix
  • Loading branch information
sitingren committed Apr 19, 2023
commit 6fe8dcfe2dc57c42c1d3d15e4ccfeef0306bf5f5
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