[Python-modules-commits] [python-vertica] 01/03: Import python-vertica_0.6.4.orig.tar.gz
Jean Baptiste Favre
jbfavre-guest at moszumanska.debian.org
Wed Jun 22 18:35:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
jbfavre-guest pushed a commit to branch master
in repository python-vertica.
commit c35615bbca411cb9d2589d253f843cb0208ef58f
Author: Jean Baptiste Favre <github at jbfavre.org>
Date: Mon Jun 20 22:12:30 2016 +0200
Import python-vertica_0.6.4.orig.tar.gz
---
setup.py | 2 +-
vertica_python/__init__.py | 2 +-
vertica_python/tests/type_tests.py | 15 +++++++++++++++
vertica_python/vertica/column.py | 2 +-
4 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/setup.py b/setup.py
index e93311e..d556e31 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ opts = ReqOpts(None, 'git')
# version should use the format 'x.x.x' (instead of 'vx.x.x')
setup(
name='vertica-python',
- version='0.6.3',
+ version='0.6.4',
description='A native Python client for the Vertica database.',
author='Justin Berka, Alex Kim, Kenneth Tran',
author_email='justin.berka at gmail.com, alex.kim at uber.com, tran at uber.com',
diff --git a/vertica_python/__init__.py b/vertica_python/__init__.py
index b8a48b8..5bd8e26 100644
--- a/vertica_python/__init__.py
+++ b/vertica_python/__init__.py
@@ -6,7 +6,7 @@ from vertica_python.vertica.connection import Connection
# Main module for this library.
# The version number of this library.
-version_info = (0, 6, 3)
+version_info = (0, 6, 4)
__version__ = '.'.join(map(str, version_info))
diff --git a/vertica_python/tests/type_tests.py b/vertica_python/tests/type_tests.py
new file mode 100644
index 0000000..31900b4
--- /dev/null
+++ b/vertica_python/tests/type_tests.py
@@ -0,0 +1,15 @@
+from .test_commons import conn_info, VerticaTestCase
+from .. import connect
+from decimal import Decimal
+
+
+class TypeTestCase(VerticaTestCase):
+ def test_decimal_query(self):
+ value = Decimal(0.42)
+ query = "SELECT {}::numeric".format(value)
+
+ with connect(**conn_info) as conn:
+ cur = conn.cursor()
+ cur.execute(query)
+ res = cur.fetchone()
+ self.assertAlmostEqual(res[0], value)
diff --git a/vertica_python/vertica/column.py b/vertica_python/vertica/column.py
index 010dbec..58d0dc8 100644
--- a/vertica_python/vertica/column.py
+++ b/vertica_python/vertica/column.py
@@ -116,7 +116,7 @@ class Column(object):
('timestamp_tz', timestamp_tz_parse),
('interval', None),
('time_tz', None),
- ('numeric', lambda s: Decimal(s)),
+ ('numeric', lambda s: Decimal(str(s, 'utf-8', unicode_error))),
('bytea', None),
('rle_tuple', None),
]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-vertica.git
More information about the Python-modules-commits
mailing list