[Sqlalchemy-commits] commit/sqlalchemy: 15 new changesets
Brought to you by:
zzzeek
From: Bitbucket <com...@bi...> - 2015-10-11 16:45:00
|
15 new commits in sqlalchemy: https://bitbucket.org/zzzeek/sqlalchemy/commits/fc73036865a0/ Changeset: fc73036865a0 Branch: None User: Gorka Eguileor Date: 2015-09-24 13:35:13+00:00 Summary: Preserve order in update method In some DBs the UPDATE operation is order dependent, so the operation behaves differently depending on the order of the values. As an example, imagine a volumes table with columns 'status' and 'previous_status' and we want to update a volume that has 'available' in the status column. If the SQL query is performed as: UPDATE volumes SET previous_status=status, status='new' WHERE id=1; This will result in a volume with 'new' status and 'available' previous_status both on SQLite and MariaDB, but if we reverse the columns: UPDATE volumes SET status='new', previous_status=status WHERE id=1; We will get the same result in SQLite but will result in a volume with status and previous_status set to 'new' in MariaDB, which is not what we want. So order must be taken into consideration in some cases and it should be allowed to ve specified via the Query update method or the values method of an update. This patch fixes this issue by preserving the order of parameters in updates and allowing to receive not only dictionaries in update and values but also ordered dictionaries and list/tuples of value pairs (like dict and OrderedDict do). fixes #3541 Affected #: 10 files https://bitbucket.org/zzzeek/sqlalchemy/commits/9fb76d759678/ Changeset: 9fb76d759678 Branch: None User: Gorka Eguileor Date: 2015-09-29 18:29:33+00:00 Summary: Only preserve order in updates if tuple/dict To avoid penalties for updates that do not require ordering, we will only use OrderedDict for updates that receive a tuple or list of pairs, and all kinds of dictionaries (dict, sqlalchemy's OrderedDict, or collections.OrderedDict) will be treateated as unordered updates, just like we were doing before. This way this new feature will not change how updates behave for any existing code and will only affect those that use the new ordered feature. This patch reverts update tests to how they were before as well as adds a couple of tests to confirm that OrderedDicts are really treated like normal dicts. Affected #: 11 files https://bitbucket.org/zzzeek/sqlalchemy/commits/ddb43cebf68b/ Changeset: ddb43cebf68b Branch: None User: Gorka Eguileor Date: 2015-09-30 16:45:05+00:00 Summary: Postpone parameters change in ordered updates Postpone as much as possible the change of update parameters to OrderedDict from list or tuple of pairs. This way we won't have problems with query's update method. Affected #: 5 files https://bitbucket.org/zzzeek/sqlalchemy/commits/ef816f23290a/ Changeset: ef816f23290a Branch: None User: Gorka Eguileor Date: 2015-10-02 16:22:33+00:00 Summary: Only check once if parameters are ordered Instead of checking multiple times if parameters are a dictionary in the form of a tuple or list of value pairs, we check it only once and then store it in the statement so it can be used on compilation time. Affected #: 4 files https://bitbucket.org/zzzeek/sqlalchemy/commits/c6ba1a7d4c2b/ Changeset: c6ba1a7d4c2b Branch: None User: Gorka Eguileor Date: 2015-10-05 08:42:09+00:00 Summary: Remove dict comprehension for py26 compatibility Remove added dict comprehensions that make this patch set non python 2.6 compatible. Affected #: 2 files https://bitbucket.org/zzzeek/sqlalchemy/commits/44e5a31ccee5/ Changeset: 44e5a31ccee5 Branch: None User: Gorka Eguileor Date: 2015-10-08 11:24:02+00:00 Summary: Reduce the numbers of calls to isinstance Change _process_colparams method to remove duplicate isinstance calls and try to speed up processing of the parameters. Affected #: 3 files https://bitbucket.org/zzzeek/sqlalchemy/commits/58ad3b5ed782/ Changeset: 58ad3b5ed782 Branch: pr200 User: zzzeek Date: 2015-10-09 21:18:00+00:00 Summary: Merge remote-tracking branch 'origin/pr/200' into pr200 Affected #: 8 files https://bitbucket.org/zzzeek/sqlalchemy/commits/2a8a06e33af6/ Changeset: 2a8a06e33af6 Branch: None User: zzzeek Date: 2015-10-11 16:00:39+00:00 Summary: - repair laziness about setting time zone here, which is leaking out depending on connection pool state Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/e6779d84376e/ Changeset: e6779d84376e Branch: None User: zzzeek Date: 2015-10-11 16:08:53+00:00 Summary: - repair flake8 issues Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/affcfd1e529c/ Changeset: affcfd1e529c Branch: None User: zzzeek Date: 2015-10-11 16:26:45+00:00 Summary: - modernize some very old global-engine tests w/ bad teardowns Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/48ad282e379d/ Changeset: 48ad282e379d Branch: None User: zzzeek Date: 2015-10-11 16:27:31+00:00 Summary: - repair laziness about setting time zone here, which is leaking out depending on connection pool state (cherry picked from commit 2a8a06e33af60705faf3e7601ec7b3e31e44f8fb) Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/9b7a00d93bc3/ Changeset: 9b7a00d93bc3 Branch: None User: zzzeek Date: 2015-10-11 16:28:20+00:00 Summary: - repair flake8 issues (cherry picked from commit e6779d84376e32941be36a97c75ecd4ab6d480d8) Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/fa829d0e1b68/ Changeset: fa829d0e1b68 Branch: rel_1_0 User: zzzeek Date: 2015-10-11 16:32:33+00:00 Summary: - modernize some very old global-engine tests w/ bad teardowns (cherry picked from commit affcfd1e529ccb11f56203f5805711a15072a7ab) Conflicts: test/dialect/postgresql/test_query.py Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/08fa2f29e707/ Changeset: 08fa2f29e707 Branch: rel_0_9 User: zzzeek Date: 2015-10-11 16:34:12+00:00 Summary: - repair laziness about setting time zone here, which is leaking out depending on connection pool state (cherry picked from commit 2a8a06e33af60705faf3e7601ec7b3e31e44f8fb) (cherry picked from commit 48ad282e379d49cf6d6eb97dc0739fa0f29f5464) Conflicts: test/dialect/postgresql/test_query.py Affected #: 1 file https://bitbucket.org/zzzeek/sqlalchemy/commits/322f8f18f519/ Changeset: 322f8f18f519 Branch: None User: zzzeek Date: 2015-10-11 16:44:29+00:00 Summary: - exclude this from unpredictable gc Affected #: 1 file Repository URL: https://bitbucket.org/zzzeek/sqlalchemy/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |