Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer 66470d8656 fix pypy failures 2014-03-03 16:18:09 -05:00
Mike Bayer ea05a23218 - Support has been added for pytest to run tests. This runner
is currently being supported in addition to nose, and will likely
be preferred to nose going forward.   The nose plugin system used
by SQLAlchemy has been split out so that it works under pytest as
well.  There are no plans to drop support for nose at the moment
and we hope that the test suite itself can continue to remain as
agnostic of testing platform as possible.  See the file
README.unittests.rst for updated information on running tests
with pytest.

The test plugin system has also been enhanced to support running
tests against mutiple database URLs at once, by specifying the ``--db``
and/or ``--dburi`` flags multiple times.  This does not run the entire test
suite for each database, but instead allows test cases that are specific
to certain backends make use of that backend as the test is run.
When using pytest as the test runner, the system will also run
specific test suites multiple times, once for each database, particularly
those tests within the "dialect suite".   The plan is that the enhanced
system will also be used by Alembic, and allow Alembic to run
migration operation tests against multiple backends in one run, including
third-party backends not included within Alembic itself.
Third party dialects and extensions are also encouraged to standardize
on SQLAlchemy's test suite as a basis; see the file README.dialects.rst
for background on building out from SQLAlchemy's test platform.
2014-03-03 15:55:17 -05:00
Marc Abramowitz e226caa968 dialects/mssql/pymssql.py: Remove second two paragraphs, as requested by @zzzeek. 2014-03-03 09:15:28 -08:00
Mike Bayer bf89ca2e10 - get util.get_callable_argspec() to be completely bulletproof for 2.6-3.4,
methods, classes, builtins, functools.partial(), everything known so far
- use get_callable_argspec() within ColumnDefault._maybe_wrap_callable, re: #2979
2014-03-02 13:59:06 -05:00
Mike Bayer 6750c39a4f - Fixed some test/feature failures occurring in Python 3.4,
in particular the logic used to wrap "column default" callables
wouldn't work properly for Python built-ins.
fixes #2979
2014-03-02 10:39:48 -05:00
Mike Bayer fa23570a33 - add new tests for individual type reflection 2014-03-01 13:55:30 -05:00
Mike Bayer e99e38a3ff use view_column requirement here 2014-02-28 18:57:39 -05:00
Mike Bayer 43f95d3e5e - dont create a self-ref FK if test suite marked as not supporting self ref
- break out reflection of views to support view column reflection separately
from view definition
2014-02-28 18:50:18 -05:00
Mike Bayer e8d048f10b fix typos 2014-02-28 14:26:35 -05:00
Mike Bayer e58fdadb9b add a migration for this one 2014-02-28 14:23:44 -05:00
Mike Bayer 12ce2edc92 - Added a new option to :paramref:.relationship.innerjoin which is
to specify the string ``"nested"``.  When set to ``"nested"`` as opposed
to ``True``, the "chaining" of joins will parenthesize the inner join on the
right side of an existing outer join, instead of chaining as a string
of outer joins.   This possibly should have been the default behavior
when 0.9 was released, as we introduced the feature of right-nested
joins in the ORM, however we are keeping it as a non-default for now
to avoid further surprises.
fixes #2976
2014-02-28 14:15:13 -05:00
Marc Abramowitz c1b7c2db19 Update pymssql dialect description, remove "limitations" section 2014-02-27 18:45:31 -08:00
Mike Bayer e21cd0d95f - Fixed bug in :func:.tuple_ construct where the "type" of essentially
the first SQL expression would be applied as the "comparison type"
to a compared tuple value; this has the effect in some cases of an
inappropriate "type coersion" occurring, such as when a tuple that
has a mix of String and Binary values improperly coerces target
values to Binary even though that's not what they are on the left
side.  :func:`.tuple_` now expects heterogeneous types within its
list of values.
fixes #2977
2014-02-27 19:54:49 -05:00
Marc Abramowitz 078621494e Update URL for pymssql 2014-02-27 14:45:56 -08:00
Christoph Zwerschke c4dede6e7c Restore coercion to unicode with cx_Oracle.
This feature is now turned off by default.
2014-02-27 21:15:21 +01:00
Mike Bayer c2f86c92b1 restore the contracts of update/extend to the degree that the same column identity
isn't appended to the list.  reflection makes use of this.
2014-02-27 13:50:47 -05:00
Mike Bayer b6428219c6 - Fixed a regression in association proxy caused by 🎫2810 which
caused a user-provided "getter" to no longer receive values of ``None``
when fetching scalar values from a target that is non-present.  The
check for None introduced by this change is now moved into the default
getter, so a user-provided getter will also again receive values of
None.
re: #2810
2014-02-27 13:29:59 -05:00
Mike Bayer 2d146ddad9 - Removed stale names from `sqlalchemy.orm.interfaces.__all__` and
refreshed with current names, so that an ``import *`` from this
module again works.
fixes #2975
2014-02-26 19:27:22 -05:00
Mike Bayer 6aeec027a0 - Adjusted the logic which applies names to the .c collection when
a no-name :class:`.BindParameter` is received, e.g. via :func:`.sql.literal`
or similar; the "key" of the bind param is used as the key within
.c. rather than the rendered name.  Since these binds have "anonymous"
names in any case, this allows individual bound parameters to
have their own name within a selectable if they are otherwise unlabeled.
fixes #2974
2014-02-26 15:45:52 -05:00
Mike Bayer 302ad6228a - Some changes to how the :attr:.FromClause.c collection behaves
when presented with duplicate columns.  The behavior of emitting a
warning and replacing the old column with the same name still
remains to some degree; the replacement in particular is to maintain
backwards compatibility.  However, the replaced column still remains
associated with the ``c`` collection now in a collection ``._all_columns``,
which is used by constructs such as aliases and unions, to deal with
the set of columns in ``c`` more towards what is actually in the
list of columns rather than the unique set of key names.  This helps
with situations where SELECT statements with same-named columns
are used in unions and such, so that the union can match the columns
up positionally and also there's some chance of :meth:`.FromClause.corresponding_column`
still being usable here (it can now return a column that is only
in selectable.c._all_columns and not otherwise named).
The new collection is underscored as we still need to decide where this
list might end up.   Theoretically it
would become the result of iter(selectable.c), however this would mean
that the length of the iteration would no longer match the length of
keys(), and that behavior needs to be checked out.
fixes #2974
- add a bunch more tests for ColumnCollection
2014-02-26 15:34:49 -05:00
Mike Bayer bf67069d26 - Fixed issue in new :meth:.TextClause.columns method where the ordering
of columns given positionally would not be preserved.   This could
have potential impact in positional situations such as applying the
resulting :class:`.TextAsFrom` object to a union.
2014-02-26 13:28:14 -05:00
Mike Bayer 6fadb57165 - use MutableMapping to make this more succinct, complete 2014-02-26 00:27:54 -05:00
Mike Bayer f9492ef906 docs 2014-02-25 20:10:52 -05:00
Mike Bayer 33f07202ce - The new dialect-level keyword argument system for schema-level
constructs has been enhanced in order to assist with existing
schemes that rely upon addition of ad-hoc keyword arguments to
constructs.
- To suit the use case of allowing custom arguments at construction time,
the :meth:`.DialectKWArgs.argument_for` method now allows this registration.
fixes #2962
2014-02-25 19:52:17 -05:00
Mike Bayer e60529da79 - Fixed bug where events set to listen at the class
level (e.g. on the :class:`.Mapper` or :class:`.ClassManager`
level, as opposed to on an individual mapped class, and also on
:class:`.Connection`) that also made use of internal argument conversion
(which is most within those categories) would fail to be removable.
fixes #2973
2014-02-25 16:55:42 -05:00
Mike Bayer 1122d355d1 - we're testing a query here with non-standard aliasing which fails on PG and MySQL.
Leave this test in place as its ultimately a SQLite use case, but only test on SQLite.
We perhaps should add another test case that works on all platforms.
2014-02-24 12:59:32 -05:00
Mike Bayer d966920b3d - Fixed regression from 0.8 where using an option like
:func:`.orm.lazyload` with the "wildcard" expression, e.g. ``"*"``,
would raise an assertion error in the case where the query didn't
contain any actual entities.  This assertion is meant for other cases
and was catching this one inadvertently.
2014-02-24 12:52:12 -05:00
Mike Bayer 537d921293 - Fixed bug in the versioned_history example where column-level INSERT
defaults would prevent history values of NULL from being written.
2014-02-24 12:34:54 -05:00
Mike Bayer 8b58c6adc2 more detail, what actually loads, etc. 2014-02-23 23:05:29 -05:00
Mike Bayer 948b14b65b -rewrite expire/refresh section 2014-02-23 16:30:09 -05:00
Mike Bayer 122ae49065 no more wheels until they have a point
fixes #2970
2014-02-22 21:39:14 -05:00
Mike Bayer ceaa6047ef - More fixes to SQLite "join rewriting"; the fix from 🎫2967
implemented right before the release of 0.9.3 affected the case where
a UNION contained nested joins in it.   "Join rewriting" is a feature
with a wide range of possibilities and is the first intricate
"SQL rewriting" feature we've introduced in years, so we're sort of
going through a lot of iterations with it (not unlike eager loading
back in the 0.2/0.3 series, polymorphic loading in 0.4/0.5). We should
be there soon so thanks for bearing with us :).
fixes #2969   re: #2967
- solve the issue of join rewriting inspecting various types of
from objects without using isinstance(), by adding some new
underscored inspection flags to the FromClause hierarchy.
2014-02-20 16:14:29 -05:00
Mike Bayer 5c88f38c72 fix typo rel_0_9_3 2014-02-19 23:09:07 -05:00
Mike Bayer 5634a3f104 0.8.5 released same day 2014-02-19 23:05:06 -05:00
Mike Bayer b2fd85b7d5 0.9.3 2014-02-19 23:01:40 -05:00
Mike Bayer a4f1d2ec6e skip this on oracle 2014-02-19 20:15:30 -05:00
Mike Bayer 57b214a0a4 - Added an additional message to psycopg2 disconnect detection,
"could not send data to server", which complements the existing
"could not receive data from server" and has been observed by users,
fixes #2936
2014-02-19 19:22:17 -05:00
Mike Bayer 69d1d08dc3 - re: #2967, also fixed a somewhat related issue where join rewriting would fail
on the columns clause of the SELECT statement if the targets were
aliased tables, as opposed to individual aliased columns.
2014-02-19 19:12:40 -05:00
Mike Bayer 25831872db - Fixed bug in SQLite "join rewriting" where usage of an exists() construct
would fail to be rewritten properly, such as when the exists is
mapped to a column_property in an intricate nested-join scenario. #2967
2014-02-19 19:04:04 -05:00
Mike Bayer a0fb9e74c6 - add a topological rule here to place PARTITIONS after PARTITION_BY,
for output consistency within the tests as well as in practice
2014-02-19 17:00:37 -05:00
Mike Bayer 8878e23079 restore the check ahead of the lock to avoid using it after initialization
is done
2014-02-19 16:11:19 -05:00
Mike Bayer 033463cd4b backport 2014-02-19 16:03:05 -05:00
Mike Bayer a552606091 - Added new MySQL-specific :class:.mysql.DATETIME which includes
fractional seconds support; also added fractional seconds support
to :class:`.mysql.TIMESTAMP`.  DBAPI support is limited, though
fractional seconds are known to be supported by MySQL Connector/Python.
Patch courtesy Geert JM Vanderkelen. #2941
2014-02-19 15:49:37 -05:00
Mike Bayer 0b4c0384f6 changelog for pullreq 12 2014-02-19 15:26:51 -05:00
Mike Bayer 7e66d7e392 Merge branch 'master' of https://bitbucket.org/50onred/sqlalchemy/overview into t 2014-02-19 15:24:36 -05:00
Mike Bayer 77ed036525 - Fixed bug where calling :meth:.Insert.values with an empty list
or tuple would raise an IndexError.   It now produces an empty
insert construct as would be the case with an empty dictionary.
2014-02-19 15:18:22 -05:00
Mike Bayer dd32540dab - Fixed a critical regression caused by 🎫2880 where the newly
concurrent ability to return connections from the pool means that the
"first_connect" event is now no longer synchronized either, thus leading
to dialect mis-configurations under even minimal concurrency situations.
2014-02-19 10:48:32 -05:00
Mike Bayer 185938e7b7 - update mysql connector python link, #2938 2014-02-18 20:49:33 -05:00
Mike Bayer ecdfc31774 - Support has been improved for Postgresql reflection behavior on very old
(pre 8.1) versions of Postgresql, and potentially other PG engines
such as Redshift (assuming Redshift reports the version as < 8.1).
The query for "indexes" as well as "primary keys" relies upon inspecting
a so-called "int2vector" datatype, which refuses to coerce to an array
prior to 8.1 causing failures regarding the "ANY()" operator used
in the query.  Extensive googling has located the very hacky, but
recommended-by-PG-core-developer query to use when PG version < 8.1
is in use, so index and primary key constraint reflection now work
on these versions.
2014-02-18 18:35:23 -05:00
Mike Bayer fdedb69d9c update docs re: cx_oracle unicode as of 0.9.2, no more outputtypehandlers 2014-02-18 16:58:14 -05:00