Mike Bayer [Sat, 28 Jan 2012 15:45:23 +0000 (10:45 -0500)]
- [bug] Fixed regression from 0.7.4 whereby
using an already instrumented column from a
superclass as "polymorphic_on" failed to resolve
the underlying Column. [ticket:2345]
Mike Bayer [Sat, 28 Jan 2012 02:19:26 +0000 (21:19 -0500)]
- [bug] Added a boolean check for the "finalize"
function within the pool connection proxy's
weakref callback before calling it, so that a
warning isn't emitted that this function is None
when the application is exiting and gc has
removed the function from the module before the
weakref callback was invoked. [ticket:2383]
Mike Bayer [Sat, 28 Jan 2012 02:05:17 +0000 (21:05 -0500)]
- [bug] Changed LRUCache, used by the mapper
to cache INSERT/UPDATE/DELETE statements,
to use an incrementing counter instead
of a timestamp to track entries, for greater
reliability versus using time.time(), which
can cause test failures on some platforms.
[ticket:2379]
Mike Bayer [Sat, 28 Jan 2012 01:59:33 +0000 (20:59 -0500)]
- [bug] implemented standard "can't set attribute" /
"can't delete attribute" AttributeError when
setattr/delattr used on a hybrid that doesn't
define fset or fdel. [ticket:2353]
Mike Bayer [Sat, 28 Jan 2012 01:32:52 +0000 (20:32 -0500)]
- [bug] Fixed issue where modified session state
established after a failed flush would be committed
as part of the subsequent transaction that
begins automatically after manual call
to rollback(). The state of the session is
checked within rollback(), and if new state
is present, a warning is emitted and
restore_snapshot() is called a second time,
discarding those changes. [ticket:2389]
- repaired testing.assert_warnings to also verify
that any warnings were emitted
Mike Bayer [Mon, 23 Jan 2012 01:11:03 +0000 (20:11 -0500)]
- [feature] Added new capability to relationship
loader options to allow "default" loader strategies.
Pass '*' to any of joinedload(), lazyload(),
subqueryload(), or noload() and that becomes the
loader strategy used for all relationships,
except for those explicitly stated in the
Query. Thanks to up-and-coming contributor
Kent Bower for an exhaustive and well
written test suite ! [ticket:2351]
Mike Bayer [Mon, 23 Jan 2012 00:25:41 +0000 (19:25 -0500)]
- [bug] Dropped the "30 char" limit on pymssql,
based on reports that it's doing things
better these days. pymssql hasn't been
well tested and as the DBAPI is in flux
it's still not clear what the status
is on this driver and how SQLAlchemy's
implementation should adapt. [ticket:2347]
Mike Bayer [Mon, 23 Jan 2012 00:17:21 +0000 (19:17 -0500)]
- [bug] Adjusted the regexp used in the
mssql.TIME type to ensure only six digits
are received for the "microseconds" portion
of the value, which is expected by
Python's datetime.time(). Note that
support for sending microseconds doesn't
seem to be possible yet with pyodbc
at least. [ticket:2340]
Mike Bayer [Mon, 23 Jan 2012 00:03:06 +0000 (19:03 -0500)]
- [feature] Simplified the versioning example
a bit to use a declarative mixin as well
as an event listener, instead of a metaclass +
SessionExtension. [ticket:2313]
Mike Bayer [Sun, 22 Jan 2012 22:40:50 +0000 (17:40 -0500)]
- adjust the test for [ticket:2377] to be less controversial on
problematic backends like Oracle.i
- move the check generated in r85017c4310d2 up for both label name/name
comparisions, fixes additional mismatches which can occur
Mike Bayer [Sun, 22 Jan 2012 21:49:08 +0000 (16:49 -0500)]
- apply the pyflakes stick to strategies.py. In particular, try
to get almost every method to be less than 50 lines. For the relationship
loaders this meant finding some decent boundaries to split things up.
I find this style a bit unnatural as in some cases we are just doing
three things with a handful of variables, why shuffle them between
three methods that are entirely dependent on each other, but not
sure what other option there is for a long list of steps like
subquery loading.
Also renamed all the "loader callables" to something descriptive,
might help when they come up in stack traces.
Mike Bayer [Sun, 22 Jan 2012 19:04:20 +0000 (14:04 -0500)]
- [bug] Fixed bug whereby a table-bound Column
object named "<a>_<b>" which matched a column
labeled as "<tablename>_<colname>" could match
inappropriately when targeting in a result
set row. [ticket:2377]
- requires that we change the tuple format in RowProxy.
Makes an improvement to the cases tested against
an unpickled RowProxy as well though doesn't solve the
problem there entirely.
Mike Bayer [Sun, 22 Jan 2012 18:19:22 +0000 (13:19 -0500)]
- rework the test suite to make use of SkipTest for tests skipped, unsupported, etc.
so that we can get an accurate picture what's really running/not, what's installed on jenkins, etc.
Tested in cpython 2.7 so far, we'll see what jenkins says about other platforms
Mike Bayer [Sun, 22 Jan 2012 17:11:13 +0000 (12:11 -0500)]
- [bug] Improved error messages when a non-string
or invalid string is passed to any of the
date/time processors used by SQLite, including
C and Python versions. [ticket:2382]
- changed the import model of processors.py so that we can
get at the pure python versions and C versions simultaneously
in tests.
Mike Bayer [Wed, 18 Jan 2012 17:42:54 +0000 (12:42 -0500)]
- [feature] Added "false()" and "true()" expression
constructs to sqlalchemy.sql namespace, though
not part of __all__ as of yet.
- [bug] sql.false() and sql.true() compile to
0 and 1, respectively in sqlite [ticket:2368]
Mike Bayer [Tue, 10 Jan 2012 16:43:47 +0000 (11:43 -0500)]
- Fixed regression from 0.6 whereby if
"load_on_pending" relationship() flag were used
where a non-"get()" lazy clause needed to be
emitted on a pending object, it would fail
to load.
Mike Bayer [Tue, 10 Jan 2012 16:15:11 +0000 (11:15 -0500)]
- [bug] Added __reduce__ to StatementError,
DBAPIError so that exceptions are pickleable,
as when using multiprocessing. However, not
all DBAPIs support this yet, such as
psycopg2. [ticket:2371]
Mike Bayer [Sat, 7 Jan 2012 20:37:51 +0000 (15:37 -0500)]
- [bug] the "name" of an FK constraint in SQLite
is reflected as "None", not "0" [ticket:2364].
SQLite does not appear to support constraint
naming in any case (the names are ignored).
Mike Bayer [Sat, 7 Jan 2012 17:57:22 +0000 (12:57 -0500)]
- [bug] Fixed bug whereby event.listen(SomeClass)
forced an entirely unnecessary compile of the
mapper, making events very hard to set up
at module import time (nobody noticed this ??)
[ticket:2367]
Mike Bayer [Tue, 3 Jan 2012 22:07:44 +0000 (17:07 -0500)]
- rework "sql expressions as mapped attributes" to also stress hybrids as the first
method to try. now there's two sections here that introduce hybrids, which
is less than ideal.
Mike Bayer [Fri, 30 Dec 2011 20:29:44 +0000 (15:29 -0500)]
add a "jinja2 fallback" renderer for render_string(), which is used for the js/css templates
we don't really care about. not sure if this is going to break again with a newer sphinx
or what, but fixes [ticket:2359] for now.
Mike Bayer [Thu, 15 Dec 2011 15:31:55 +0000 (10:31 -0500)]
- [bug] Fixed inappropriate usage of util.py3k
flag and renamed it to util.py3k_warning, since
this flag is intended to detect the -3 flag
series of import restrictions only.
[ticket:2348]
Mike Bayer [Fri, 9 Dec 2011 16:12:41 +0000 (11:12 -0500)]
- Standalone expressions in polymorphic_on
propagate to single-table inheritance
subclasses so that they are used in the
WHERE /JOIN clause to limit rows to that
subclass as is the usual behavior.
- make sure implicit map to polymorphic_on expr
handles creating a label(). Use an explicit name
here as _sa_polymorphic_on makes more sense when
poking around in _props.
Mike Bayer [Fri, 9 Dec 2011 05:56:12 +0000 (00:56 -0500)]
- [feature] polymorphic_on now accepts many
new kinds of values:
- standalone expressions that aren't
otherwise mapped
- column_property() objects
- string names of any column_property()
or attribute name of a mapped Column
The docs include an example using
the case() construct, which is likely to be
a common constructed used here.
[ticket:2345] and part of [ticket:2238]
Mike Bayer [Wed, 7 Dec 2011 18:24:11 +0000 (13:24 -0500)]
- [bug] Fixed bug in get_history() when referring
to a composite attribute that has no value;
added coverage for get_history() regarding
composites which is otherwise just a userland
function.
Mike Bayer [Wed, 7 Dec 2011 01:59:04 +0000 (20:59 -0500)]
- doc updates per [ticket:2251]
- [feature] Added new value for Column autoincrement
called "ignore_fk", can be used to force autoincrement
on a column that's still part of a ForeignKeyConstraint.
New example in the relationship docs illustrates
its use.
Mike Bayer [Tue, 6 Dec 2011 21:31:52 +0000 (16:31 -0500)]
- [bug] Decode incoming values when retrieving
list of index names and the names of columns
within those indexes. [ticket:2269]
- rewrite unicode reflection test to be of more general use on
broken backends
Mike Bayer [Tue, 6 Dec 2011 20:35:06 +0000 (15:35 -0500)]
- [bug] don't cast "table name" as NVARCHAR
on SQL Server 2000. Still mostly in the dark
what incantations are needed to make PyODBC
work fully with FreeTDS 0.91 here, however.
[ticket:2343]
Mike Bayer [Mon, 5 Dec 2011 22:06:15 +0000 (17:06 -0500)]
- [feature] Added an example to the hybrid docs
of a "transformer" - a hybrid that returns a
query-transforming callable in combination
with a custom comparator. Uses a new method
on Query called with_transformation(). The use
case here is fairly experimental, but only
adds one line of code to Query.
Mike Bayer [Sun, 4 Dec 2011 21:23:55 +0000 (16:23 -0500)]
- [bug] Updated warning message when setting
delete-orphan without delete to no longer
refer to 0.6, as we never got around to
upgrading this to an exception. Ideally
this might be better as an exception but
it's not critical either way. [ticket:2325]
- add new test suite to test_cascades for cascade
arguments
Mike Bayer [Sun, 4 Dec 2011 20:47:13 +0000 (15:47 -0500)]
-re-document the is_modified method, and place significant caveats
about the "passive" flag which is now known to be wrong. Add
new is_modified tests illustrating the passive flag.
[ticket:2320]
Mike Bayer [Sun, 4 Dec 2011 19:25:00 +0000 (14:25 -0500)]
- [bug] Fixed bug whereby transaction.rollback()
would throw an error on an invalidated
connection if the transaction were a
two-phase or savepoint transaction.
For plain transactions, rollback() is a no-op
if the connection is invalidated, so while
it wasn't 100% clear if it should be a no-op,
at least now the interface is consistent.
[ticket:2317]