Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pycassa/pycassa
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Sutch committed Sep 26, 2011
2 parents 1cc4827 + cb06be1 commit 9071443
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 9 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Expand Up @@ -18,3 +18,5 @@ Dan Kuebrich
Paul Cannon
Kay Sackey
Alexey Smolsky
Samuel Sutch
Aaron Morton
14 changes: 14 additions & 0 deletions CHANGES
@@ -1,3 +1,17 @@
Changes in Version 1.2.1

This is strictly a bug-fix release addressing a few issues created in 1.2.0.

Bug Fixes

* Correctly check for Counters in ColumnFamily when setting
default_validation_class
* Pass kwargs in ColumnFamilyMap to ColumnFamily
* Avoid potential UnboundLocal in ConnectionPool.execute() when get() fails
* Fix ez_setup dependency/bundling so that package installations using
easy_install or pip don’t fail without ez_setup installed


Changes in Version 1.2.0

This should be a fairly smooth upgrade from pycassa 1.1. The
Expand Down
2 changes: 2 additions & 0 deletions doc/api/pycassa/pool.rst
Expand Up @@ -19,6 +19,8 @@

.. automethod:: put

.. automethod:: execute

.. automethod:: fill

.. automethod:: dispose
Expand Down
16 changes: 16 additions & 0 deletions doc/changelog.rst
@@ -1,6 +1,22 @@
Changelog
=========

Changes in Version 1.2.1
------------------------
This is strictly a bug-fix release addressing a few
issues created in 1.2.0.

Bug Fixes
~~~~~~~~~
- Correctly check for Counters in :class:`.ColumnFamily`
when setting `default_validation_class`
- Pass kwargs in :class:`.ColumnFamilyMap` to
:class:`.ColumnFamily`
- Avoid potential UnboundLocal in :meth:`.ConnectionPool.execute`
when :meth:`~.ConnectionPool.get` fails
- Fix ez_setup dependency/bundling so that package installations
using easy_install or pip don't fail without ez_setup installed

Changes in Version 1.2.0
------------------------
This should be a fairly smooth upgrade from pycassa 1.1. The
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Expand Up @@ -33,9 +33,9 @@
# built documents.
#
# The short X.Y version.
version = '1.2'
version = '.'.join(map(str, pycassa.version))
# The full version, including alpha/beta/rc tags.
release = '1.2.0'
release = version

# List of documents that shouldn't be included in the build.
unused_docs = []
Expand Down
2 changes: 2 additions & 0 deletions pycassa/__init__.py
Expand Up @@ -11,3 +11,5 @@
TimedOutException

from pycassa.logging.pycassa_logger import *

version = (1, 2, 1)
4 changes: 3 additions & 1 deletion pycassa/pool.py
Expand Up @@ -566,11 +566,13 @@ def execute(self, f, *args, **kwargs):
`f` on it with `*args` and `**kwargs`, return the
connection to the pool, and return the result of `f`.
"""
conn = None
try:
conn = self.get()
return getattr(conn, f)(*args, **kwargs)
finally:
self.put(conn)
if conn:
self.put(conn)

def dispose(self):
""" Closes all checked in connections in the pool. """
Expand Down
19 changes: 14 additions & 5 deletions setup.py
Expand Up @@ -11,13 +11,21 @@
except:
has_subprocess = False

from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
try:
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
pass

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

from distutils.cmd import Command

__version_info__ = (1, 2, 0)
__version__ = '.'.join([str(v) for v in __version_info__])
import pycassa
__version__ = '.'.join(map(str, pycassa.version))

long_description = """pycassa is a python client library for Apache Cassandra with the following features:
Expand Down Expand Up @@ -91,6 +99,7 @@ def run(self):
'pycassa.cassandra.c08',
'pycassa.logging'],
requires = ['thrift'],
py_modules=['ez_setup'],
scripts=['pycassaShell'],
cmdclass={"doc": doc},
classifiers=[
Expand Down
24 changes: 23 additions & 1 deletion tests/test_autopacking.py
Expand Up @@ -39,6 +39,7 @@ def setup_class(cls):
sys = SystemManager()
sys.create_column_family(TEST_KS, 'StdLong', comparator_type=LongType())
sys.create_column_family(TEST_KS, 'StdInteger', comparator_type=IntegerType())
sys.create_column_family(TEST_KS, 'StdBigInteger', comparator_type=IntegerType())
sys.create_column_family(TEST_KS, 'StdTimeUUID', comparator_type=TimeUUIDType())
sys.create_column_family(TEST_KS, 'StdLexicalUUID', comparator_type=LexicalUUIDType())
sys.create_column_family(TEST_KS, 'StdAscii', comparator_type=AsciiType())
Expand All @@ -50,6 +51,7 @@ def setup_class(cls):

cls.cf_long = ColumnFamily(pool, 'StdLong')
cls.cf_int = ColumnFamily(pool, 'StdInteger')
cls.cf_big_int = ColumnFamily(pool, 'StdBigInteger')
cls.cf_time = ColumnFamily(pool, 'StdTimeUUID')
cls.cf_lex = ColumnFamily(pool, 'StdLexicalUUID')
cls.cf_ascii = ColumnFamily(pool, 'StdAscii')
Expand Down Expand Up @@ -87,6 +89,11 @@ def test_standard_column_family(self):
int_cols = [1,2,3]
type_groups.append(self.make_group(TestCFs.cf_int, int_cols))

big_int_cols = [1 + int(time.time() * 10 ** 6),
2 + int(time.time() * 10 ** 6),
3 + int(time.time() * 10 ** 6)]
type_groups.append(self.make_group(TestCFs.cf_big_int, big_int_cols))

time_cols = [TIME1, TIME2, TIME3]
type_groups.append(self.make_group(TestCFs.cf_time, time_cols))

Expand Down Expand Up @@ -198,6 +205,7 @@ def setup_class(cls):
sys = SystemManager()
sys.create_column_family(TEST_KS, 'SuperLong', super=True, comparator_type=LongType())
sys.create_column_family(TEST_KS, 'SuperInt', super=True, comparator_type=IntegerType())
sys.create_column_family(TEST_KS, 'SuperBigInt', super=True, comparator_type=IntegerType())
sys.create_column_family(TEST_KS, 'SuperTime', super=True, comparator_type=TimeUUIDType())
sys.create_column_family(TEST_KS, 'SuperLex', super=True, comparator_type=LexicalUUIDType())
sys.create_column_family(TEST_KS, 'SuperAscii', super=True, comparator_type=AsciiType())
Expand All @@ -207,6 +215,7 @@ def setup_class(cls):

cls.cf_suplong = ColumnFamily(pool, 'SuperLong')
cls.cf_supint = ColumnFamily(pool, 'SuperInt')
cls.cf_supbigint = ColumnFamily(pool, 'SuperBigInt')
cls.cf_suptime = ColumnFamily(pool, 'SuperTime')
cls.cf_suplex = ColumnFamily(pool, 'SuperLex')
cls.cf_supascii = ColumnFamily(pool, 'SuperAscii')
Expand Down Expand Up @@ -242,7 +251,12 @@ def test_super_column_families(self):

int_cols = [1,2,3]
type_groups.append(self.make_super_group(TestSuperCFs.cf_supint, int_cols))


big_int_cols = [1 + int(time.time() * 10 ** 6),
2 + int(time.time() * 10 ** 6),
3 + int(time.time() * 10 ** 6)]
type_groups.append(self.make_super_group(TestSuperCFs.cf_supbigint, big_int_cols))

time_cols = [TIME1, TIME2, TIME3]
type_groups.append(self.make_super_group(TestSuperCFs.cf_suptime, time_cols))

Expand Down Expand Up @@ -352,6 +366,8 @@ def setup_class(cls):
comparator_type=LongType(), subcomparator_type=LongType())
sys.create_column_family(TEST_KS, 'SuperLongSubInt', super=True,
comparator_type=LongType(), subcomparator_type=IntegerType())
sys.create_column_family(TEST_KS, 'SuperLongSubBigInt', super=True,
comparator_type=LongType(), subcomparator_type=IntegerType())
sys.create_column_family(TEST_KS, 'SuperLongSubTime', super=True,
comparator_type=LongType(), subcomparator_type=TimeUUIDType())
sys.create_column_family(TEST_KS, 'SuperLongSubLex', super=True,
Expand All @@ -366,6 +382,7 @@ def setup_class(cls):

cls.cf_suplong_sublong = ColumnFamily(pool, 'SuperLongSubLong')
cls.cf_suplong_subint = ColumnFamily(pool, 'SuperLongSubInt')
cls.cf_suplong_subbigint = ColumnFamily(pool, 'SuperLongSubBigInt')
cls.cf_suplong_subtime = ColumnFamily(pool, 'SuperLongSubTime')
cls.cf_suplong_sublex = ColumnFamily(pool, 'SuperLongSubLex')
cls.cf_suplong_subascii = ColumnFamily(pool, 'SuperLongSubAscii')
Expand Down Expand Up @@ -402,6 +419,11 @@ def test_super_column_family_subs(self):

int_cols = [1,2,3]
type_groups.append(self.make_sub_group(TestSuperSubCFs.cf_suplong_subint, int_cols))

big_int_cols = [1 + int(time.time() * 10 ** 6),
2 + int(time.time() * 10 ** 6),
3 + int(time.time() * 10 ** 6)]
type_groups.append(self.make_sub_group(TestSuperSubCFs.cf_suplong_subbigint, big_int_cols))

time_cols = [TIME1, TIME2, TIME3]
type_groups.append(self.make_sub_group(TestSuperSubCFs.cf_suplong_subtime, time_cols))
Expand Down

0 comments on commit 9071443

Please sign in to comment.