Commit Graph

206 Commits

Author SHA1 Message Date
Mike Bayer 30a50cc46a - the wrapped memoized_property here was not working, as the attribute name
didn't match.  use straight memoized_props here for now, add a perf test to check it
2013-11-26 23:24:13 -05:00
Mike Bayer 02f21ffcf3 - The :class:.RowProxy object is now sortable in Python as a regular
tuple is; this is accomplished via ensuring tuple() conversion on
both sides within the ``__eq__()`` method as well as
the addition of a ``__lt__()`` method. [ticket:2848]
2013-11-19 19:29:18 -05:00
Mike Bayer 08a6a8b519 - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynor 2013-09-22 20:35:40 -04:00
Mike Bayer b83a1564f1 Improved support for the cymysql driver, supporting version 0.6.5,
courtesy Hajime Nakagami.
2013-08-17 00:31:57 -04:00
Mike Bayer 4505425a38 - Removal of event listeners is now implemented. The feature is
provided via the :func:`.event.remove` function.
[ticket:2268]
- reorganization of event.py module into a package; with the addition of the
docstring work as well as the new registry for removal, there's a lot more code now.
the package separates concerns and provides a top-level doc for each subsection
of functionality
- the remove feature works by providing the EventKey object which associates
the user-provided arguments to listen() with a global, weak-referencing registry.
This registry stores a collection of _ListenerCollection and _DispatchDescriptor
objects associated with each set of arguments, as well as the wrapped function
which was applied to that collection.  The EventKey can then be recreated for
a removal, all the _ListenerCollection and _DispatchDescriptor objects are located,
and the correct wrapped function is removed from each one.
2013-07-26 14:21:58 -04:00
Mike Bayer 731a4daf63 A performance fix related to the usage of the :func:.defer option
when loading mapped entities.   The function overhead of applying
a per-object deferred callable to an instance at load time was
significantly higher than that of just loading the data from the row
(note that ``defer()`` is meant to reduce DB/network overhead, not
necessarily function call count); the function call overhead is now
less than that of loading data from the column in all cases.  There
is also a reduction in the number of "lazy callable" objects created
per load from N (total deferred values in the result) to 1 (total
number of deferred cols).
[ticket:2778]
2013-07-13 16:29:07 -04:00
Mike Bayer b38a76cd1d - replace most explicitly-named test objects called "Mock..." with
actual mock objects from the mock library.  I'd like to use mock
for new tests so we might as well use it in obvious places.
- use unittest.mock in py3.3
- changelog
- add a note to README.unittests
- add tests_require in setup.py
- have tests import from sqlalchemy.testing.mock
- apply usage of mock to one of the event tests.  we can be using
this approach all over the place.
2013-06-30 18:35:12 -04:00
Mike Bayer 3b4168875d - zoomark tests
- rewrite all profiles, we'll review the diffs to see if anything is too far out
2013-05-26 19:47:13 -04:00
Mike Bayer 6cde27fe91 a pass where we try to squash down as many list()/keys() combinations
as possible
2013-05-26 19:06:13 -04:00
Mike Bayer 4b614b9b35 - the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
2013-04-27 19:53:57 -04:00
Hajime Nakagami af9ed1ff16 testing.crashes on cymysql >= 0.6 2013-04-20 16:33:32 +09:00
Hajime Nakagami a6a311cd1a skip with cymysql 0.6 2013-04-20 15:54:33 +09:00
Mike Bayer a5ede47f12 A major fix to the way in which a select() object produces
labeled columns when apply_labels() is used; this mode
produces a SELECT where each column is labeled as in
<tablename>_<columnname>, to remove column name collisions
for a multiple table select.   The fix is that if two labels
collide when combined with the table name, i.e.
"foo.bar_id" and "foo_bar.id", anonymous aliasing will be
applied to one of the dupes.  This allows the ORM to handle
both columns independently; previously, 0.7
would in some cases silently emit a second SELECT for the
column that was "duped", and in 0.8 an ambiguous column error
would be emitted.   The "keys" applied to the .c. collection
of the select() will also be deduped, so that the "column
being replaced" warning will no longer emit for any select()
that specifies use_labels, though the dupe key will be given
an anonymous label which isn't generally user-friendly.
[ticket:2702]
2013-04-11 16:14:23 -04:00
Mike Bayer c8a80e2130 - remove all compat items that are pre-2.5 (hooray)
- other cleanup
- don't need compat.decimal, that approach never panned out. hopefully
outside libs aren't pulling it in, they shouldn't be
2013-03-09 17:26:16 -05:00
Mike Bayer 576224edd0 - add workaround for sqlite memusage tests, so no longer need to count to 220/skip tests
- Fixed potential memory leak which could occur if an
arbitrary number of :class:`.sessionmaker` objects
were created.   The anonymous subclass created by
the sessionmaker, when dereferenced, would not be garbage
collected due to remaining class-level references from the
event package.  This issue also applies to any custom system
that made use of ad-hoc subclasses in conjunction with
an event dispatcher.  Also in 0.7.10. [ticket:2650]
2013-01-12 17:21:35 -05:00
Mike Bayer b66dad46f3 - refactor of pathing mechanics, to address #2614, #2617
- paths now store Mapper + MapperProperty now instead of string key,
so that the parent mapper for the property is known, supports same-named
properties on multiple subclasses
- the Mapper within the path is now always relevant to the property
to the right of it.  PathRegistry does the translation now, instead
of having all the outside users of PathRegistry worry about it,
to produce a path that is much more consistent.  Paths are now
consistent with mappings in all cases.  Special logic to get at
"with_polymorphic" structures and such added also.
- AliasedClass now has two modes, "use_mapper_path" and regular;
"use_mapper_path" is for all those situations where we put an AliasedClass
in for a plain class internally, and want it to "path" with the
plain mapper.
- The AliasedInsp is now the first class "entity" for an AliasedClass,
and is passed around internally and used as attr._parententity
and such.  it is the AliasedClass analogue for Mapper.
2012-12-01 20:12:23 -05:00
Mike Bayer 0f56aa56c5 need to disable hstore for the "player" here. should really get rid of the recorder/player thing
at this point
2012-11-18 03:01:49 -05:00
Mike Bayer 08f104f7e7 - import fixes 2012-09-29 16:58:00 -04:00
Mike Bayer be40b51cb0 getting everything to pass again 2012-09-27 16:33:54 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer a2468c8a31 - [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level.   This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
2012-08-17 18:35:25 -04:00
Mike Bayer a4c651420b - this is a refcount test 2012-08-11 17:55:37 -04:00
Mike Bayer 48c9993b65 OK! let's turn this around completely. Forget making a single count across
all platforms.  let's instead store callcounts for *all* observed platforms in a datafile.
Will try to get enough platforms in the file for jenkins to have meaningful results.
for platforms not in the file, it's just skiptest.
2012-08-11 15:51:08 -04:00
Mike Bayer 3986fd7626 adjustments 2012-08-11 02:57:25 -04:00
Mike Bayer 2f522bd221 final cleanup 2012-08-10 11:10:21 -04:00
Mike Bayer 153248cf7b adjust 2012-08-09 17:49:36 -04:00
Mike Bayer 92ceb399c9 - make sure event mechanics have completed before running this test, lower callcount 2012-08-09 17:38:59 -04:00
Mike Bayer 781fff75d0 adjustment 2012-08-09 16:52:11 -04:00
Mike Bayer 4e54072397 more adjustments 2012-08-09 16:43:46 -04:00
Mike Bayer 442237afaa - a new approach to profiling where we attempt to strip out
parts of the pstats that are idiosyncratic to different platforms.
the goal is no per-version assertions on tests, version differences
in theory would go into the list of profiling exceptions.
2012-08-09 16:08:48 -04:00
Mike Bayer c13d4f613f - fixes 2012-08-07 14:55:41 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer 27913554a8 trailing whitespace bonanza 2012-07-28 15:50:05 -04:00
Mike Bayer 37ced0946c - some more interpret_as_froms 2012-07-23 20:59:46 -04:00
Mike Bayer 2bee05098e callcounts due to more engine event logic 2012-07-19 09:49:36 -04:00
Mike Bayer 6051636d89 try to get these to pass on jenkins 2012-07-17 12:41:06 -04:00
Mike Bayer 5b2df4215f relax this variance for now 2012-07-17 09:33:52 -04:00
Mike Bayer 8f04c53191 some test fixes and cleanup 2012-07-16 17:37:32 -04:00
Mike Bayer 9cab0f1f16 move mapper-level UOW functionality straight into unitofwork also. there's
no need for this to be per-mapper.   can't move dependency init
off of property though as this init needs to happen up front, added a test
to prove it.
2012-07-14 12:52:21 -04:00
Mike Bayer a1a58219c2 turn commit_all into an iterative method 2012-06-25 13:12:48 -04:00
Mike Bayer 467f7c1e02 - somehting is making this test have an inconsistent callcount 2012-06-24 02:07:43 -04:00
Mike Bayer 04e6faa2d9 callcounts, due to the DummyLock cleanup 2012-06-23 11:46:47 -04:00
Mike Bayer bc15fb6066 a likely callcount 2012-06-21 01:50:59 -04:00
Mike Bayer e4efa7f5d0 callcount 2012-06-20 19:39:35 -04:00
Mike Bayer 3dd536ac06 - [feature] The of_type() construct on attributes
now accepts aliased() class constructs as well
as with_polymorphic constructs, and works with
query.join(), any(), has(), and also
eager loaders subqueryload(), joinedload(),
contains_eager()
[ticket:2438] [ticket:1106]
- a rewrite of the query path system to use an
object based approach for more succinct usage.  the system
has been designed carefully to not add an excessive method overhead.
- [feature] select() features a correlate_except()
method, auto correlates all selectables except those
passed.   Is needed here for the updated any()/has()
functionality.
- remove some old cruft from LoaderStrategy, init(),debug_callable()
- use a namedtuple for _extended_entity_info.  This method should
become standard within the orm internals
- some tweaks to the memory profile tests, number of runs can
be customized to work around pysqlite's very annoying behavior
- try to simplify PropertyOption._get_paths(), rename to _process_paths(),
returns a single list now.  overall works more completely as was needed
for of_type() functionality
2012-06-20 19:28:29 -04:00
Mike Bayer df8f0f5d6b obnoxious callcounts 2012-06-16 19:55:35 -04:00
Mike Bayer 9c1a311139 callcount fix 2012-06-13 10:12:16 -04:00
Mike Bayer c238fb0c62 weird, seems like hasattr() doesn't count as a function call in the same way as isinstance()... 2012-06-12 10:32:52 -04:00
Mike Bayer 5cc0bb0474 - [bug] Fixed bug affecting Py3K whereby
string positional parameters passed to
engine/connection execute() would fail to be
interpreted correctly, due to __iter__
being present on Py3K string.
[ticket:2503].  Also in 0.7.8.
2012-06-11 20:11:05 -04:00
Mike Bayer 405b00f1de callcount 2012-06-11 19:44:58 -04:00