From 3faf4a7819f59b068cfef5bda7c0b7530bfbfc77 Mon Sep 17 00:00:00 2001 From: Alex Kim Date: Fri, 23 Sep 2016 11:15:29 -0700 Subject: [PATCH] 0.6.7 --- README.md | 2 +- setup.py | 2 +- vertica_python/__init__.py | 2 +- vertica_python/tests/unicode_tests.py | 24 ++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 63ae974e..dff7bf16 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![PyPI version](https://badge.fury.io/py/vertica-python.png)](http://badge.fury.io/py/vertica-python) -0.6.x adds python3 support (namedparams support is currently broken in python3, see issue 112) +0.6.x adds python3 support (unicode namedparams support is currently broken in python3, see issue 112) 0.5.x changes the connection method to accept kwargs instead of a dict to be more dbapi compliant. copy methods improved and consolidated in 0.5.1 diff --git a/setup.py b/setup.py index ebc4a48a..9e220746 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ # version should use the format 'x.x.x' (instead of 'vx.x.x') setup( name='vertica-python', - version='0.6.6', + version='0.6.7', description='A native Python client for the Vertica database.', author='Justin Berka, Alex Kim', author_email='justin.berka@gmail.com, alex.kim@uber.com', diff --git a/vertica_python/__init__.py b/vertica_python/__init__.py index cd486e62..e01c0642 100644 --- a/vertica_python/__init__.py +++ b/vertica_python/__init__.py @@ -6,7 +6,7 @@ # Main module for this library. # The version number of this library. -version_info = (0, 6, 6) +version_info = (0, 6, 7) __version__ = '.'.join(map(str, version_info)) diff --git a/vertica_python/tests/unicode_tests.py b/vertica_python/tests/unicode_tests.py index adf13141..2cfaebbf 100644 --- a/vertica_python/tests/unicode_tests.py +++ b/vertica_python/tests/unicode_tests.py @@ -26,3 +26,27 @@ def test_unicode_named_parameter_binding(self): res = cur.fetchone() assert res[0] == value + + def test_string_query(self): + value = u'test' + query = u"SELECT '{}'".format(value) + + with connect(**conn_info) as conn: + cur = conn.cursor() + cur.execute(query) + res = cur.fetchone() + + assert res[0] == value + + # this test is broken on python3: see issue #112 + def test_string_named_parameter_binding(self): + key = u'test' + value = u'value' + query = u"SELECT :{}".format(key) + + with connect(**conn_info) as conn: + cur = conn.cursor() + cur.execute(query, {key: value}) + res = cur.fetchone() + + assert res[0] == value