Kyle Stark [Mon, 13 Jan 2014 16:52:31 +0000 (08:52 -0800)]
Fix TypeError for class_mapper called w/ iterable
When the class_ passed is not a mapped class but is actually an iterable, the string formatting operation fails with a TypeError, and the expected ArgumentError is not raised. Calling code which is using reflection and expects this error will fail (e.g. the sadisplay module).
Conflicts:
lib/sqlalchemy/orm/base.py
Mike Bayer [Thu, 2 Jan 2014 19:23:14 +0000 (14:23 -0500)]
- support addition of fails_if()/only_on(), just wraps the decorators
- update a few exclusions to support current pymssql. passes all of test_suite and dialect/mssql
Mike Bayer [Sat, 28 Dec 2013 22:50:19 +0000 (17:50 -0500)]
- apply a similar fix for floats to mssql+pyodbc as we did to firebird
- wrangle through osx+pyodbc+freetds to get at least test_suite to pass again
with mssql+pyodbc. invovled adding some silly requirements
Ben Alpert [Sat, 28 Dec 2013 06:11:23 +0000 (23:11 -0700)]
session docs: Change `object` to `someobject`
This makes the code block more consistent with the preceding one and also prevents the variable from being colored as a builtin (which `object` is) during syntax highlighting.
Mike Bayer [Fri, 27 Dec 2013 18:28:18 +0000 (13:28 -0500)]
- add a test which creates tables and views at the same time, then tests that the lists
of each can be reflected independently. Testing [ticket:2898] at the moment.
Mike Bayer [Fri, 27 Dec 2013 18:20:58 +0000 (13:20 -0500)]
- Fixed bug in Firebird index reflection where the columns within the
index were not sorted correctly; they are now sorted
in order of RDB$FIELD_POSITION.
Mike Bayer [Fri, 27 Dec 2013 18:16:48 +0000 (13:16 -0500)]
- The "asdecimal" flag used with the :class:`.Float` type will now
work with Firebird dialects; previously the decimal conversion was
not occurring.
- scale back some firebird FP numeric tests
John Anderson [Mon, 16 Dec 2013 20:50:10 +0000 (12:50 -0800)]
Remove terminated connections from the pool.
In pymssql, if you terminate a long running query manually
it will give you a connection reset by peer message, but this
connection remains in the pool and will be re-used.
Mike Bayer [Fri, 20 Dec 2013 15:26:09 +0000 (10:26 -0500)]
- Fixed issue where a primary key column that has a Sequence on it,
yet the column is not the "auto increment" column, either because
it has a foreign key constraint or ``autoincrement=False`` set,
would attempt to fire the Sequence on INSERT for backends that don't
support sequences, when presented with an INSERT missing the primary
key value. This would take place on non-sequence backends like
SQLite, MySQL. [ticket:2896]
Mike Bayer [Thu, 19 Dec 2013 21:02:14 +0000 (16:02 -0500)]
- Fixed bug with :meth:`.Insert.from_select` method where the order
of the given names would not be taken into account when generating
the INSERT statement, thus producing a mismatch versus the column
names in the given SELECT statement. Also noted that
:meth:`.Insert.from_select` implies that Python-side insert defaults
cannot be used, since the statement has no VALUES clause. [ticket:2895]
Mike Bayer [Tue, 17 Dec 2013 00:32:10 +0000 (19:32 -0500)]
- for [ticket:2651], leaving CheckConstraint alone, preferring to keep
backwards compatibility. A note about backslashing escapes is added.
Because the Text() construct now supports bind params better, the example
given in the code raises an exception now, so that should cover us.
The exception itself has been enhanced to include the key name of the
bound param. We're backporting this to 0.8 but 0.8 doesn't have the
text->bind behavior that raises.
Mike Bayer [Tue, 17 Dec 2013 00:17:41 +0000 (19:17 -0500)]
- An adjustment to the :func:`.subqueryload` strategy which ensures that
the query runs after the loading process has begun; this is so that
the subqueryload takes precedence over other loaders that may be
hitting the same attribute due to other eager/noload situations
at the wrong time. [ticket:2887]
Mike Bayer [Mon, 16 Dec 2013 20:25:48 +0000 (15:25 -0500)]
- Fixed bug when using joined table inheritance from a table to a
select/alias on the base, where the PK columns were also not same
named; the persistence system would fail to copy primary key values
from the base table to the inherited table upon INSERT.
[ticket:2885]
Mike Bayer [Thu, 12 Dec 2013 18:30:16 +0000 (13:30 -0500)]
- :func:`.composite` will raise an informative error message when the
columns/attribute (names) passed don't resolve to a Column or mapped
attribute (such as an erroneous tuple); previously raised an unbound
local. [ticket:2889]
Mike Bayer [Thu, 12 Dec 2013 17:49:57 +0000 (12:49 -0500)]
- Error message when a string arg sent to :func:`.relationship` which
doesn't resolve to a class or mapper has been corrected to work
the same way as when a non-string arg is received, which indicates
the name of the relationship which had the configurational error.
[ticket:2888]
Mike Bayer [Sat, 7 Dec 2013 22:20:05 +0000 (17:20 -0500)]
- A DBAPI that raises an error on ``connect()`` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged. Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged
in the same way as occurs within the execute process. [ticket:2881]
- add tests for this in test_parseconnect, but also add tests in test_execute
to ensure the execute() behavior as well
Mike Bayer [Sat, 7 Dec 2013 00:57:19 +0000 (19:57 -0500)]
- The :class:`.QueuePool` has been enhanced to not block new connection
attempts when an existing connection attempt is blocking. Previously,
the production of new connections was serialized within the block
that monitored overflow; the overflow counter is now altered within
it's own critical section outside of the connection process itself.
[ticket:2880]
Mike Bayer [Fri, 6 Dec 2013 20:53:59 +0000 (15:53 -0500)]
- Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.
Roman Podolyaka [Sun, 9 Jun 2013 16:07:00 +0000 (19:07 +0300)]
- backport unique constraints reflection to 0.8.4, thereby
assisting with alembic installations that have upgraded and are dealing with
PG index/unique constraint reflection.
Inspection API already supports reflection of table
indexes information and those also include unique
constraints (at least for PostgreSQL and MySQL).
But it could be actually useful to distinguish between
indexes and plain unique constraints (though both are
implemented in the same way internally in RDBMS).
This change adds a new method to Inspection API - get_unique_constraints()
and implements it for SQLite, PostgreSQL and MySQL dialects.
Mike Bayer [Sat, 30 Nov 2013 22:31:00 +0000 (17:31 -0500)]
- the pronoun removal commit. there was only one instance of a
standalone gendered pronoun with a gender-neutral subject, but also
have replaced all occurences of "his/her", "his or her", etc. The docs have always
strived to account for both genders in any non-specific singular pronoun,
however recent controversy in the community suggests
that a zero-gendered-pronoun policy is probably best going forward.
Mike Bayer [Fri, 22 Nov 2013 23:35:36 +0000 (18:35 -0500)]
- Fixed bug where SQL statement would be improperly ASCII-encoded
when a pre-DBAPI :class:`.StatementError` were raised within
:meth:`.Connection.execute`, causing encoding errors for
non-ASCII statements. The stringification now remains within
Python unicode thus avoiding encoding errors. [ticket:2871]
Mike Bayer [Fri, 22 Nov 2013 22:56:35 +0000 (17:56 -0500)]
Fixed bug where Oracle ``VARCHAR`` types given with no length
(e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR``
or similar. [ticket:2870]
Mike Bayer [Thu, 21 Nov 2013 18:30:32 +0000 (13:30 -0500)]
- Fixed bug which prevented the ``serializer`` extension from working
correctly with table or column names that contain non-ASCII
characters. [ticket:2869]
Mike Bayer [Thu, 31 Oct 2013 19:29:45 +0000 (15:29 -0400)]
- add a section re: using column_reflect for mapping, link to it from the "naming columns distinctly" and "column_prefix" sections since this is often what ppl are looking for. [ticket:2856] is related.
Mike Bayer [Wed, 30 Oct 2013 14:34:31 +0000 (10:34 -0400)]
- Fixed a regression introduced by :ticket:`2818` where the EXISTS
query being generated would produce a "columns being replaced"
warning for a statement with two same-named columns,
as the internal SELECT wouldn't have use_labels set.
Mike Bayer [Sun, 27 Oct 2013 22:14:44 +0000 (18:14 -0400)]
- Fixed bug where index reflection would mis-interpret indkey values
when using the pypostgresql adapter, which returns these values
as lists vs. psycopg2's return type of string.
[ticket:2855]
Mike Bayer [Fri, 25 Oct 2013 23:11:53 +0000 (19:11 -0400)]
- Fixed bug where Oracle table reflection using synonyms would fail
if the synonym and the table were in different remote schemas.
Patch to fix courtesy Kyle Derr. [ticket:2853]
Mike Bayer [Sun, 20 Oct 2013 20:25:46 +0000 (16:25 -0400)]
- add a type_coerce() step within Enum, Boolean to the CHECK constraint,
so that the custom type isn't exposed to an operation that is against the
"impl" type's constraint, [ticket:2842]
- this change showed up as some recursion overflow in pickling with labels,
add a __reduce__() there....pickling of expressions is less and less something
that's very viable...