]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
6 years agoadd F821 which for some reason is some new thing flake8 wants to complain about
Mike Bayer [Thu, 31 Jan 2019 03:00:36 +0000 (21:00 -0600)] 
add F821 which for some reason is some new thing flake8 wants to complain about

Change-Id: I27df129ae883d75217ec07ff6d0139447444cc60

6 years agoFix typo: issue is #4442, not #4222 4471/head
Ville Brofeldt [Tue, 29 Jan 2019 10:50:43 +0000 (12:50 +0200)] 
Fix typo: issue is #4442, not #4222

6 years agoremove py36 from test profiles
Mike Bayer [Sun, 27 Jan 2019 05:55:54 +0000 (00:55 -0500)] 
remove py36 from test profiles

Since we aren't regenerating for py36 we need to take the
obsolete numbers out also.

Change-Id: I67c4268bcec63d7d3a03ab757674780ee8693677

6 years agoMerge "Ensure of_type subclass taken into account with wildcards"
mike bayer [Sat, 26 Jan 2019 22:21:46 +0000 (22:21 +0000)] 
Merge "Ensure of_type subclass taken into account with wildcards"

6 years agoEnsure of_type subclass taken into account with wildcards
Mike Bayer [Sat, 26 Jan 2019 19:53:45 +0000 (14:53 -0500)] 
Ensure of_type subclass taken into account with wildcards

Fixed a regression in 1.2 where a wildcard/load_only loader option would
not work correctly against a loader path where of_type() were used to limit
to a particular subclass.  The fix only works for of_type() of a simple
subclass so far, not a with_polymorphic entity which will be addressed in a
separate issue; it is unlikely this latter case was working previously.

Since we ensure that the entity is broken out into its superclasses
when a wilcard is encountered, we can limit the entity path to the
specific entity given in this case.

Within this issue some additional issues with with_polymorphic()
loaders were found which will be addressed in #4469.

Fixes: #4468
Change-Id: Ie91ec27b49104e019636f870776e294321586a9e

6 years agoVersion 1.3.0b3 placeholder
Mike Bayer [Sat, 26 Jan 2019 02:51:35 +0000 (21:51 -0500)] 
Version 1.3.0b3 placeholder

6 years ago- 1.3.0b2 rel_1_3_0b2
Mike Bayer [Sat, 26 Jan 2019 02:40:01 +0000 (21:40 -0500)] 
- 1.3.0b2

6 years agoVersion 1.2.18 placeholder
Mike Bayer [Sat, 26 Jan 2019 02:32:00 +0000 (21:32 -0500)] 
Version 1.2.18 placeholder

(cherry picked from commit d196c49918ee1e7fbce12e228aa7db33d098908f)

6 years ago- 1.2.17
Mike Bayer [Sat, 26 Jan 2019 02:16:56 +0000 (21:16 -0500)] 
- 1.2.17

(cherry picked from commit 47c245b90cd3cfe76bc0cf078f740d12bf7ba2d1)

6 years agoFix timeout method doc to be for QueuePool
Mike Bayer [Sat, 26 Jan 2019 02:30:55 +0000 (21:30 -0500)] 
Fix timeout method doc to be for QueuePool

Change-Id: I14d4e623a5761963e10bb8f5d99a8ca3684db61b

6 years agoImprove error messages in the area of loader options
Mike Bayer [Wed, 9 Jan 2019 07:01:16 +0000 (02:01 -0500)] 
Improve error messages in the area of loader options

Improved error messages emitted by the ORM in the area of loader option
traversal.  This includes early detection of mis-matched loader strategies
along with a clearer explanation why these strategies don't match.

Fixes: #4433
Change-Id: I3351b64241f7f62ca141a0be95085e6ef8ca6d32

6 years agoFix some long lines that sneaked in with the spelling fixes change
Mike Bayer [Fri, 25 Jan 2019 20:13:48 +0000 (15:13 -0500)] 
Fix some long lines that sneaked in with the spelling fixes change

Change-Id: Icc6d8e564c9d31da2adc39d060e077c3d4811186

6 years agoFix many spell glitches
Lele Gaifax [Mon, 14 Jan 2019 16:26:33 +0000 (11:26 -0500)] 
Fix many spell glitches

This affects mostly docstrings, except in orm/events.py::dispose_collection()
where one parameter gets renamed: given that the method is
empty, it seemed reasonable to me to fix that too.

Closes: #4440
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4440
Pull-request-sha: 779ed75acb6142e1f1daac467b5b14134529bb4b

Change-Id: Ic0553fe97853054b09c2453af76d96363de6eb0e

6 years agoMerge "Add getters for all execution_options"
mike bayer [Fri, 25 Jan 2019 19:55:25 +0000 (19:55 +0000)] 
Merge "Add getters for all execution_options"

6 years agoMerge "Fix mssql quote schema warning"
mike bayer [Fri, 25 Jan 2019 19:54:14 +0000 (19:54 +0000)] 
Merge "Fix mssql quote schema warning"

6 years agoMerge "Implement relationship to AliasedClass; deprecate non primary mappers"
mike bayer [Fri, 25 Jan 2019 16:58:08 +0000 (16:58 +0000)] 
Merge "Implement relationship to AliasedClass; deprecate non primary mappers"

6 years agoFix mssql quote schema warning
Mike Bayer [Fri, 25 Jan 2019 16:36:54 +0000 (11:36 -0500)] 
Fix mssql quote schema warning

The deprecations review didn't include tests of identifier_preparer.quote.force
for backends, so MSSQL slipped through.  We have to fully reimplement
the deprecation warning here so that it passes tests which are now
enabled for all backends.

Change-Id: I9d07e6766e16b5a35b7f7566f1daf94b04346270

6 years agoAdd getters for all execution_options
Daniel Lister [Thu, 24 Jan 2019 21:35:16 +0000 (16:35 -0500)] 
Add getters for all execution_options

Added accessors for execution options to Core and ORM, via
:meth:`.Query.get_execution_options`,
:meth:`.Connection.get_execution_options`,
:meth:`.Engine.get_execution_options`, and
:meth:`.Executable.get_execution_options`.  PR courtesy Daniel Lister.

Fixes: #4406
Closes: #4465
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4465
Pull-request-sha: 9674688bb5e80471a6a421bac06f995c2e64f8f7

Change-Id: I93ba51d7a2d687e255edd6938db15615e56dd237

6 years agoMerge "Use pg_get_constraintdef for CHECK constraint reflection"
mike bayer [Fri, 25 Jan 2019 14:30:54 +0000 (14:30 +0000)] 
Merge "Use pg_get_constraintdef for CHECK constraint reflection"

6 years agoImplement relationship to AliasedClass; deprecate non primary mappers
Mike Bayer [Sun, 30 Dec 2018 01:54:29 +0000 (20:54 -0500)] 
Implement relationship to AliasedClass; deprecate non primary mappers

Implemented a new feature whereby the :class:`.AliasedClass` construct can
now be used as the target of a :func:`.relationship`.  This allows the
concept of "non primary mappers" to no longer be necessary, as the
:class:`.AliasedClass` is much easier to configure and automatically inherits
all the relationships of the mapped class, as well as preserves the
ability for loader options to work normally.

- introduce new name for mapped_table, "persist_selectable".  this is
the selectable that selects against the local mapper and its superclasses,
but does not include columns local only to subclasses.

- relationship gains "entity" which is the mapper or aliasedinsp.

- clarfiy name "entity" vs. "query_entity" in loader strategies.

Fixes: #4423
Fixes: #4422
Fixes: #4421
Fixes: #3348
Change-Id: Ic3609b43dc4ed115006da9ad9189e574dc0c72d9

6 years ago- this is a meth, not a ref
Mike Bayer [Fri, 25 Jan 2019 00:38:42 +0000 (19:38 -0500)] 
- this is a meth, not a ref

Change-Id: I6761732fe0a93673dff27fdf15287b189f31784b

6 years agoUse pg_get_constraintdef for CHECK constraint reflection
Mike Bayer [Thu, 24 Jan 2019 21:56:44 +0000 (16:56 -0500)] 
Use pg_get_constraintdef for CHECK constraint reflection

Revised the query used when reflecting CHECK constraints to make use of the
``pg_get_constraintdef`` function, as the ``consrc`` column is being
deprecated in PG 12.  Thanks to John A Stevenson for the tip.

Fixes: #4463
Change-Id: Ie0ee9bdfddb0635db72b35c2e2e4b27f154162fd

6 years agoMerge "Provide public accessor for Pool.timeout()."
mike bayer [Thu, 24 Jan 2019 21:35:55 +0000 (21:35 +0000)] 
Merge "Provide public accessor for Pool.timeout()."

6 years agoProvide public accessor for Pool.timeout().
Irina Delamare [Thu, 24 Jan 2019 00:23:59 +0000 (19:23 -0500)] 
Provide public accessor for Pool.timeout().

Added public accessor :meth:`.Pool.timeout` that returns the configured
timeout for a :class:`.Pool` object.  Pull request courtesy Irina Delamare.

Fixes: #3689
Closes: #4447
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4447
Pull-request-sha: 0179b0a829e9609429dc698992670d2e6749c10c

Change-Id: I402b065cf9183160f71d9de73e308268356b7deb

6 years ago- all the checkboxes are just embarassing, just do something simple
Mike Bayer [Thu, 24 Jan 2019 17:41:51 +0000 (12:41 -0500)] 
- all the checkboxes are just embarassing, just do something simple

Change-Id: Icb689ffbc780016ec59c549c65e6add20c96951e

6 years agoMerge "Add deprecation warnings to all deprecated APIs"
mike bayer [Thu, 24 Jan 2019 08:08:22 +0000 (08:08 +0000)] 
Merge "Add deprecation warnings to all deprecated APIs"

6 years agoAdd deprecation warnings to all deprecated APIs
Mike Bayer [Fri, 21 Dec 2018 03:05:36 +0000 (22:05 -0500)] 
Add deprecation warnings to all deprecated APIs

A large change throughout the library has ensured that all objects, parameters,
and behaviors which have been noted as deprecated or legacy now emit
``DeprecationWarning`` warnings when invoked.   As the Python 3 interpreter now
defaults to displaying deprecation warnings, as well as that modern test suites
based on tools like tox and pytest tend to display deprecation warnings,
this change should make it easier to note what API features are obsolete.

See the notes added to the changelog and migration notes for further
details.

Fixes: #4393
Change-Id: If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b

6 years agoAdd QueryEvents before_compile_update / before_compile_delete
Mike Bayer [Wed, 23 Jan 2019 02:49:07 +0000 (21:49 -0500)] 
Add QueryEvents before_compile_update / before_compile_delete

Added new event hooks :meth:`.QueryEvents.before_compile_update` and
:meth:`.QueryEvents.before_compile_delete` which complement
:meth:`.QueryEvents.before_compile` in the case of the :meth:`.Query.update`
and :meth:`.Query.delete` methods.

Fixes: #4461
Change-Id: I47884f0e1f07d7e62870c2a918b15f917f9245ab

6 years agoDon't use cx_Oracle.NATIVE_INT in output type handlers
Mike Bayer [Sat, 19 Jan 2019 02:30:21 +0000 (21:30 -0500)] 
Don't use cx_Oracle.NATIVE_INT in output type handlers

Fixed regression in integer precision logic due to the refactor of the
cx_Oracle dialect in 1.2.  We now no longer apply the cx_Oracle.NATIVE_INT
type to result columns sending integer values (detected as positive
precision with scale ==0) which encounters integer overflow issues with
values that go beyond the 32 bit boundary.  Instead, the output variable
is left untyped so that cx_Oracle can choose the best option.

Fixes: #4457
Change-Id: I1e3114c2f37bf028fb1f521a3e9789a77e3a7491

6 years agoCleanup with query aliasing
Mike Bayer [Fri, 18 Jan 2019 04:38:40 +0000 (23:38 -0500)] 
Cleanup with query aliasing

Try to simplify some of the "adapter" stuff in query:

1. identify that join(.., aliased=True) doesn't work if the
right side has no mapper.   The adaption of the right side is
done via the mapper with aliased(), so that doesn't effect
a selectable only.  raise an error, so we can simplify
the code.

2. build fewer adapter objects.   these are confusing to follow
and we should try to figure out exactly what purpose which
one serves where and make that clear.

Change-Id: I18dfcd01e6ad533aa0b8d557fc637ee2766ed050

6 years agoRegenerate callcounts for mysqlclient 1.4.0
Mike Bayer [Fri, 18 Jan 2019 20:46:41 +0000 (15:46 -0500)] 
Regenerate callcounts for mysqlclient 1.4.0

Fixes: #4455
Change-Id: I396230f649f6bb5e396798e63339fcecb3b85eaf

6 years agoMerge "Adapt single inh criteria more specifically"
mike bayer [Fri, 18 Jan 2019 16:31:14 +0000 (16:31 +0000)] 
Merge "Adapt single inh criteria more specifically"

6 years agoFeature mysqlclient
Mike Bayer [Fri, 18 Jan 2019 06:02:07 +0000 (01:02 -0500)] 
Feature mysqlclient

MySQL-Python hasn't been released in about five years and there
is no reason that it should be listed as a viable DBAPI;
all MySQL / MariaDB users should be using mysqlclient or PyMySQL today.

Change-Id: I2f12babe6e60bc7393398400a125d0592e86dbb8

6 years agoAdd example of password URL encoding
Mike Bayer [Fri, 18 Jan 2019 05:53:55 +0000 (00:53 -0500)] 
Add example of password URL encoding

Fixes: #4452
Change-Id: I6d6ef36c4a0aa1e7c064b8aed289a1ce79b5120f

6 years agolink the psycopg2 fast execution document to the Core tutorial executemany section
Mike Bayer [Fri, 18 Jan 2019 05:35:00 +0000 (00:35 -0500)] 
link the psycopg2 fast execution document to the Core tutorial executemany section

Fixes: #4109
Change-Id: I62fcb703b552db842be335c8f9257cc0e8c5cdd5

6 years agoAdapt single inh criteria more specifically
Mike Bayer [Fri, 18 Jan 2019 01:08:10 +0000 (20:08 -0500)] 
Adapt single inh criteria more specifically

Fixed issue where when using single-table inheritance in conjunction with a
joined inheritance hierarchy that uses "with polymorphic" loading, the
"single table criteria" for that single-table entity could get confused for
that of other entities from the same hierarchy used in the same query.The
adaption of the "single table criteria" is made more specific to the target
entity to avoid it accidentally getting adapted to other tables in the
query.

Change-Id: Ia9f915a4b01e8bb9cee365c4c70e00c626f103c4
Fixes: #4454
6 years agoRepair use of deprecated text() typemap, bindparams parameters
Mike Bayer [Thu, 17 Jan 2019 18:16:04 +0000 (13:16 -0500)] 
Repair use of deprecated text() typemap, bindparams parameters

These will emit a deprecation warning once
If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b is merged, modernize these
ahead of time as this should likely be backported to 1.2 as well.

Change-Id: Iae4426a856d5617e8a325b14d8b6fc22333f2cda

6 years agoReinstate elementtree example
Vraj Mohan [Wed, 16 Jan 2019 20:36:54 +0000 (15:36 -0500)] 
Reinstate elementtree example

Partially fixes sqlalchemy/sqlalchemy#4426.

Closes: #4441
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4441
Pull-request-sha: ed90f3b77c2d0f4cc2cd54f40f5af29b489977d2

Change-Id: Ic32e5d8020073da055b12a6aeb61e698a97dc504

6 years ago- pep8 fix
Mike Bayer [Thu, 17 Jan 2019 01:20:45 +0000 (20:20 -0500)] 
- pep8 fix

Change-Id: I5e2e013c3460c035ad80dae7fd08efe5d1676a5d

6 years agoConvert most "See also" phrases into .. seealso::
Mike Bayer [Tue, 15 Jan 2019 21:12:39 +0000 (16:12 -0500)] 
Convert most "See also" phrases into .. seealso::

Change-Id: Ie32598b895c1c5f5bce7c8e1573abbcfe9d434a8
(cherry picked from commit e81d3815abb36c52b0019dee6e4f67990e3d1c7d)

6 years agoMerge "Render N'' for SQL Server unicode literals"
mike bayer [Tue, 15 Jan 2019 17:47:14 +0000 (17:47 +0000)] 
Merge "Render N'' for SQL Server unicode literals"

6 years agoRemove version directives for 0.6, 0.7, 0.8
Mike Bayer [Tue, 15 Jan 2019 15:49:36 +0000 (10:49 -0500)] 
Remove version directives for 0.6, 0.7, 0.8

- fix a few "seealso"s
- ComparableProprerty's "superseded in 0.7" becomes deprecated in 0.7

Backport to currently maintained doc versions 1.2, 1.1

Change-Id: Ib1fcb2df8673dbe5c4ffc47f3896a60d1dfcb4b2

6 years agoPR template tweaks
Mike Bayer [Tue, 15 Jan 2019 15:10:56 +0000 (10:10 -0500)] 
PR template tweaks

Change-Id: I49557362057fef3ea151bc2f4bd8c3c96cdf5935

6 years agoMerge "Relax "ambiguous" association proxy restrictions, support Proxy"
mike bayer [Tue, 15 Jan 2019 15:06:05 +0000 (15:06 +0000)] 
Merge "Relax "ambiguous" association proxy restrictions, support Proxy"

6 years agoRender N'' for SQL Server unicode literals
Mike Bayer [Sun, 13 Jan 2019 23:15:52 +0000 (18:15 -0500)] 
Render N'' for SQL Server unicode literals

The ``literal_processor`` for the :class:`.Unicode` and
:class:`.UnicodeText` datatypes now render an ``N`` character in front of
the literal string expression as required by SQL Server for Unicode string
values rendered in SQL expressions.

Note that this adds full unicode characters to the standard test suite,
which means we also need to bump MySQL provisioning up to utf8mb4.
Modern installs do not seem to be reproducing the 1271 issue locally,
if it reproduces in CI it would be better for us to skip those ORM-centric
tests for MySQL.

Also remove unused _StringType from SQL Server dialect

Fixes: #4442
Change-Id: Id55817b3e8a2d81ddc8b7b27f85e3f1dcc1cea7e

6 years agoMerge "move to inspect_getfullargspec"
mike bayer [Tue, 15 Jan 2019 15:02:17 +0000 (15:02 +0000)] 
Merge "move to inspect_getfullargspec"

6 years agomove to inspect_getfullargspec
Mike Bayer [Mon, 14 Jan 2019 17:22:40 +0000 (12:22 -0500)] 
move to inspect_getfullargspec

Replace inspect_getargspec with inspect_getfullargspec
including a compatibility fallback for Py2k and use
getfullargspec fully.

Change-Id: I92bce0aafc37ce1a360b4f61b75f5892d0911c7e

6 years agoRelax "ambiguous" association proxy restrictions, support Proxy
Mike Bayer [Mon, 14 Jan 2019 23:53:58 +0000 (18:53 -0500)] 
Relax "ambiguous" association proxy restrictions, support Proxy

Fixed issue in association proxy due to :ticket:`3423` which caused the use
of custom :class:`.PropComparator` objects with hybrid attribites, such as
the one demonstrated in  the ``dictlike-polymorphic`` example to not
function within an association proxy.  The strictness that was added in
:ticket:`3423` has been relaxed, and additional logic to accomodate for
an association proxy that links to a custom hybrid have been added.

Fixes: #4446
Change-Id: I8addc80f51094769915ac2dce1a301bd72ee7433

6 years agoPull request template final
Mike Bayer [Mon, 14 Jan 2019 21:51:04 +0000 (16:51 -0500)] 
Pull request template final

Change-Id: Id94b90a58753e044ec3495601fea4c12e79d6e3d

6 years agoanother change to the PR template
Mike Bayer [Mon, 14 Jan 2019 21:38:14 +0000 (16:38 -0500)] 
another change to the PR template

Change-Id: I29b0f60d3ec32249333edaeb6550147bd740d893

6 years agoTry a new pull request template
Mike Bayer [Mon, 14 Jan 2019 21:32:16 +0000 (16:32 -0500)] 
Try a new pull request template

Change-Id: I4c2c176c30eb99157bd037035501f876cb344823

6 years agocorrect paramref to property links to refer to creation function
Mike Bayer [Sun, 13 Jan 2019 17:36:21 +0000 (12:36 -0500)] 
correct paramref to property links to refer to creation function

Change-Id: I2c528bd4639863aa7b8a592beed776d53bab3e5c

6 years agoMerge "Add standalone orm.close_all method and deprecate SessionMaker.close_all"
mike bayer [Sun, 13 Jan 2019 02:46:08 +0000 (02:46 +0000)] 
Merge "Add standalone orm.close_all method and deprecate SessionMaker.close_all"

6 years agoMerge "use ..deprecated directive w/ version in all cases"
mike bayer [Sat, 12 Jan 2019 23:22:47 +0000 (23:22 +0000)] 
Merge "use ..deprecated directive w/ version in all cases"

6 years agoAdd standalone orm.close_all method and deprecate SessionMaker.close_all
Augustin Trancart [Sat, 12 Jan 2019 15:46:01 +0000 (10:46 -0500)] 
Add standalone orm.close_all method and deprecate SessionMaker.close_all

Added a new function :func:`.close_all_sessions` which takes
over the task of the :meth:`.Session.close_all` method, which
is now deprecated as this is confusing as a classmethod.
Pull request courtesy Augustin Trancart.

Fixes: #4412
Closes: #4438
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4438
Pull-request-sha: 7833d12a9898c82d50716427144bf3276c22ab3f

Change-Id: Ib35eaa520ae886f3f8f550f9712fc3b139e00b60

6 years agouse ..deprecated directive w/ version in all cases
Mike Bayer [Tue, 8 Jan 2019 22:46:55 +0000 (17:46 -0500)] 
use ..deprecated directive w/ version in all cases

These changes should be ported from 1.3 back to 1.0 or
possibly 0.9 to the extent they are relevant in each
version. In 1.3 we hope to turn all deprecation documentation
into warnings.

Change-Id: I205186cde161af9389af513a425c62ce90dd54d8

6 years agocherry-pick changelog update for 1.2.17
Mike Bayer [Fri, 11 Jan 2019 15:15:39 +0000 (10:15 -0500)] 
cherry-pick changelog update for 1.2.17

6 years agocherry-pick changelog from 1.2.16
Mike Bayer [Fri, 11 Jan 2019 15:15:38 +0000 (10:15 -0500)] 
cherry-pick changelog from 1.2.16

6 years agohappy new year
Mike Bayer [Fri, 11 Jan 2019 15:06:10 +0000 (10:06 -0500)] 
happy new year

Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911

6 years agoLeave bytestring exception messages as bytestrings
Mike Bayer [Thu, 10 Jan 2019 17:03:40 +0000 (12:03 -0500)] 
Leave bytestring exception messages as bytestrings

Fixed a regression introduced in version 1.2 where a refactor
of the :class:`.SQLAlchemyError` base exception class introduced an
inappropriate coercion of a plain string message into Unicode under
python 2k, which is not handled by the Python interpreter for characters
outside of the platform's encoding (typically ascii).  The
:class:`.SQLAlchemyError` class now passes a bytestring through under
Py2K for ``__str__()`` as is the behavior of exception objects in general
under Py2K, does a safe coercion to unicode utf-8 with
backslash fallback for ``__unicode__()``.  For Py3K the message is
typically unicode already, but if not is again safe-coerced with utf-8
with backslash fallback for the ``__str__()`` method.

Fixes: #4429
Change-Id: I2289da3f2c45c7d0041fa43d838958f7614defc3

6 years agoMerge "Skip expression-based index reflection for SQLite"
mike bayer [Thu, 10 Jan 2019 02:07:24 +0000 (02:07 +0000)] 
Merge "Skip expression-based index reflection for SQLite"

6 years agoSkip expression-based index reflection for SQLite
Mike Bayer [Wed, 9 Jan 2019 16:42:02 +0000 (11:42 -0500)] 
Skip expression-based index reflection for SQLite

Reflection of an index based on SQL expressions are now skipped with a
warning, in the same way as that of the Postgresql dialect, where we currently
do not support reflecting indexes that have SQL expressions within them.
Previously, an index with columns of None were produced which would break
tools like Alembic.

Fixes: #4431
Change-Id: I1363ade912d206b42669331e2be2bb6f444b65a2

6 years agoRender correct DDL for unsetting table comments
Mike Bayer [Wed, 9 Jan 2019 16:18:02 +0000 (11:18 -0500)] 
Render correct DDL for unsetting table comments

Fixed issue where the DDL emitted for :class:`.DropTableComment`, which
will be used by an upcoming version of Alembic, was incorrect for the MySQL
and Oracle databases.

Fixes: #4436
Change-Id: I196de09495a37adface4caa9dcbc29a6d0ad159a

6 years agoUpdate index.rst - Added link to Drill dialect. 4432/head
Charles S. Givre [Tue, 8 Jan 2019 19:45:19 +0000 (14:45 -0500)] 
Update index.rst - Added link to Drill dialect.

Added link to Apache Drill dialect.

6 years agoPost black reformatting
Mike Bayer [Sun, 6 Jan 2019 06:19:47 +0000 (01:19 -0500)] 
Post black reformatting

Applied on top of a pure run of black -l 79 in
I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9,  this set of changes
resolves all remaining flake8 conditions for those codes
we have enabled in setup.cfg.

Included are resolutions for all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.

Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe

6 years agoRun black -l 79 against all source files
Mike Bayer [Sun, 6 Jan 2019 06:14:26 +0000 (01:14 -0500)] 
Run black -l 79 against all source files

This is a straight reformat run using black as is, with no edits
applied at all.

The black run will format code consistently, however in
some cases that are prevalent in SQLAlchemy code it produces
too-long lines.   The too-long lines will be resolved in the
following commit that will resolve all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.

Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9

6 years agoAssorted pre-Black fixes
Mike Bayer [Sun, 6 Jan 2019 03:42:08 +0000 (22:42 -0500)] 
Assorted pre-Black fixes

Fixes to the test suite, a few errant imports, and setup.py:

- mysql and postgresql have unused 'json' imports; remove
- postgresql is exporting the 'json' symbol, remove
- make sure setup.py can find __version__ using " or '
- retry logic in provision create database for postgresql fixed
- refactor test_magazine to use cls.tables rather than globals
- remove unused class in test_scoping
- add a comment to test_deprecations that this test suite itself
  is deprecated
- don't use mapper() and orm_mapper() in test_unitofwork, just
  use mapper()
- remove dupe test_scalar_set_None test in test_attributes
- Python 2.7 and above includes unittest.SkipTest, remove pre-2.7
  fallback
- use imported SkipTest in profiling
- declarative test_reflection tests with "reflectable_autoincrement"
  already don't run on oracle or firebird; remove conditional logic
  for these, which also removes an "id" symbol
- clean up test in test_functions, remove print statement
- remove dupe test_literal_processor_coercion_native_int_out_of_range
  in test/sql/test_types.py
- fix psycopg2_hstore ref

Change-Id: I7b3444f8546aac82be81cd1e7b6d8b2ad6834fe6

6 years agoPrep for flake8 refactoring
Mike Bayer [Fri, 4 Jan 2019 03:28:09 +0000 (22:28 -0500)] 
Prep for flake8 refactoring

a few code changes ahead of time to handle some __all__
issues better.  also include new flake8 rules, since the
existing flake8 doesn't pass in any case.

Change-Id: I1efdf75124ae7bcac719c22e505bb5b13db06c04

6 years agorework the exclusions spec expression
Mike Bayer [Mon, 31 Dec 2018 03:02:12 +0000 (22:02 -0500)] 
rework the exclusions spec expression

The expression was expecting spaces which means we were skipping
Postgresql window function tests and possibly other things.

Change-Id: I57c4aed558f4011f2f7b882a2d9b1fee210f9eaf

6 years agocommit 1b774808c926665047bf353222ecd191679a95d1
Lele Gaifax [Mon, 31 Dec 2018 02:16:11 +0000 (21:16 -0500)] 
commit 1b774808c926665047bf353222ecd191679a95d1
Author: Lele Gaifax <lele@metapensiero.it>
Date:   Tue Dec 25 12:35:41 2018 +0100

    Consistently use "PostgreSQL", fixing also a few doc glitches

commit 0e382aaee4427193926f0dc10ad29056bc12c85e
Author: Lele Gaifax <lele@metapensiero.it>
Date:   Tue Dec 25 12:08:49 2018 +0100

    Remove duplicated words

Change-Id: Iaa586b9412f46a50fe6ff3bbb92e07d6cb1905c8

6 years agoMerge "Check collection less than two items remaining before firing scalar backref...
mike bayer [Sat, 29 Dec 2018 07:59:58 +0000 (07:59 +0000)] 
Merge "Check collection less than two items remaining before firing scalar backref remove"

6 years agoMerge "Call __del() before remove()"
mike bayer [Sat, 29 Dec 2018 07:58:21 +0000 (07:58 +0000)] 
Merge "Call __del() before remove()"

6 years agoAdd missing disambiguation to non-primary mapper example
Mike Bayer [Fri, 28 Dec 2018 14:33:07 +0000 (09:33 -0500)] 
Add missing disambiguation to non-primary mapper example

The mapping to B over a join defines an alternate primary key
based on all the primary key columns in the join unless we
re-define it explicitly.   Similarly, people expect that
``.id`` looks the same.  make sure these line up with the
old mapping.

Change-Id: I1ab064c57019e79c34293f6588d1e033f7083974

6 years agoCheck collection less than two items remaining before firing scalar backref remove
Mike Bayer [Sun, 23 Dec 2018 00:16:50 +0000 (19:16 -0500)] 
Check collection less than two items remaining before firing scalar backref remove

Fixed long-standing issue where duplicate collection members would cause a
backref to delete the association between the member and its parent object
when one of the duplicates were removed, as occurs as a side effect of
swapping two objects in one statement.

Fixes: #1103
Change-Id: Ic12877f7bd5a4eb688091725a78410748e7fdf16

6 years agoCall __del() before remove()
Mike Bayer [Fri, 28 Dec 2018 03:10:45 +0000 (22:10 -0500)] 
Call __del() before remove()

The "remove" event for collections is now called before the item is removed
in the case of the ``collection.remove()`` method, as is consistent with the
behavior for most other forms of collection item removal (such as
``__delitem__``, replacement under ``__setitem__``).  The ``pop()`` methods
are now the only exception as the target item is not available until after
the pop operation proceeds.

This allows ``remove()`` to be consistent in its behavior with all
the other collection operations, allows the "before_delete" hook
to be local to "pop()" operations only, and removes some method overhead.

We are also looking here to gain some more predictability in terms
of the fix for #1103.

Change-Id: I4fdea911517d65cc300fae0e9c351a471e52e4ab

6 years agoImplement SynonymProperty.get_history()
Mike Bayer [Thu, 27 Dec 2018 17:39:15 +0000 (12:39 -0500)] 
Implement SynonymProperty.get_history()

Implemented the ``.get_history()`` method, which also implies availability
of :attr:`.AttributeState.history`, for :func:`.synonym` attributes.
Previously, trying to access attribute history via a synonym would raise an
``AttributeError``.

Fixes: #3777
Change-Id: I20810a8b1a1bf630dbcb6622193c13cf4236b94a

6 years ago- remove non-working dialects some of which are 404's
Mike Bayer [Mon, 24 Dec 2018 05:07:22 +0000 (00:07 -0500)] 
- remove non-working dialects some of which are 404's
- put the five major dialect names on the front page
- remove old change messages

Change-Id: Ibf1dc2c499f10f98efb6c97d6c53e442e7746200

6 years agoMerge "Add before_mapper_configured event"
mike bayer [Sun, 23 Dec 2018 15:44:37 +0000 (15:44 +0000)] 
Merge "Add before_mapper_configured event"

6 years agoMerge "Maintain compiled_params / replacement_expressions within expanding IN"
mike bayer [Sat, 22 Dec 2018 13:54:11 +0000 (13:54 +0000)] 
Merge "Maintain compiled_params / replacement_expressions within expanding IN"

6 years agoMaintain compiled_params / replacement_expressions within expanding IN
Mike Bayer [Fri, 21 Dec 2018 22:35:12 +0000 (17:35 -0500)] 
Maintain compiled_params / replacement_expressions within expanding IN

Fixed issue in "expanding IN" feature where using the same bound parameter
name more than once in a query would lead to a KeyError within the process
of rewriting the parameters in the query.

Fixes: #4394
Change-Id: Ibcadce9fefbcb060266d9447c2044ee6efeccf5a

6 years agoMerge "Handle PostgreSQL enums in remote schemas"
mike bayer [Fri, 21 Dec 2018 22:23:07 +0000 (22:23 +0000)] 
Merge "Handle PostgreSQL enums in remote schemas"

6 years agoadd pull request template
Mike Bayer [Fri, 21 Dec 2018 19:13:41 +0000 (14:13 -0500)] 
add pull request template

Change-Id: I850c246e4f0feb62dca083909e5d010ce8288a3d

6 years agoHandle PostgreSQL enums in remote schemas
Mike Bayer [Fri, 21 Dec 2018 16:04:14 +0000 (11:04 -0500)] 
Handle PostgreSQL enums in remote schemas

Fixed issue where a :class:`.postgresql.ENUM` or a custom domain present
in a remote schema would not be recognized within column reflection if
the name of the enum/domain or the name of the schema required quoting.
A new parsing scheme now fully parses out quoted or non-quoted tokens
including support for SQL-escaped quotes.

Fixed issue where multiple :class:`.postgresql.ENUM` objects referred to
by the same :class:`.MetaData` object would fail to be created if
multiple objects had the same name under different schema names.  The
internal memoization the Postgresql dialect uses to track if it has
created a particular :class:`.postgresql.ENUM` in the database during
a DDL creation sequence now takes schema name into account.

Fixes: #4416
Change-Id: I8cf03069e10b12f409e9b6796e24fc5850979955

6 years agoRewrite the convert_unicode docs and add tons of dragons
Mike Bayer [Fri, 21 Dec 2018 17:13:13 +0000 (12:13 -0500)] 
Rewrite the convert_unicode docs and add tons of dragons

These flags will all be going away as Python 3 has solved
all of this.

Change-Id: I4f581d8dd7826dd823b671d0d8e72250284236c8

6 years agoMerge "Fix the "greatest" example."
mike bayer [Thu, 20 Dec 2018 15:32:12 +0000 (15:32 +0000)] 
Merge "Fix the "greatest" example."

6 years agoMerge "Omit include of no longer existing files"
mike bayer [Thu, 20 Dec 2018 15:29:34 +0000 (15:29 +0000)] 
Merge "Omit include of no longer existing files"

6 years agoOmit include of no longer existing files
Michael Howitz [Mon, 17 Dec 2018 16:04:44 +0000 (11:04 -0500)] 
Omit include of no longer existing files

Warnings are generated during setup.py install such as:

```
Getting distribution for 'SQLAlchemy==1.2.15'.
warning: no files found matching '*.jpg' under directory 'doc'
warning: no files found matching '*.mako' under directory 'doc'
warning: no files found matching 'distribute_setup.py'
warning: no files found matching 'sa2to3.py'
warning: no files found matching 'ez_setup.py'
```

This change removes those expressions from MANIFEST.in.

Closes: #4408
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4408
Pull-request-sha: 448b3a9dc8f25d841f20bcd67130acaea68cb745

Change-Id: Id6373611fb384e230427f87b9e75672d78483000

6 years agoFix the "greatest" example.
Konstantin Tretyakov [Mon, 17 Dec 2018 22:21:03 +0000 (17:21 -0500)] 
Fix the "greatest" example.

The current example code does not pass `**kw` down to the `compiler.process` calls, thus the example does not work when invoked with, `literal_binds=True`.

Besides, the calls to `process` each argument twice are wasteful, and reusing the built-in `case` expression instead of hard-coding the SQL statements is slightly nicer overall, isn't it?

Closes: #4402
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4402
Pull-request-sha: 24ee93f63e21fccae6cbc1cc1c154dd56f1e1963

Change-Id: I02424d9eb2b35abd5cdec5c2cd5d464a56e7fae6

6 years agoMerge "Add missing parameter to docstring"
mike bayer [Mon, 17 Dec 2018 21:22:58 +0000 (21:22 +0000)] 
Merge "Add missing parameter to docstring"

6 years agoAdd missing parameter to docstring
Agam Rafaeli [Mon, 17 Dec 2018 17:58:19 +0000 (12:58 -0500)] 
Add missing parameter to docstring

Closes: #4410
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4410
Pull-request-sha: 070a0f44f3a6ce651e6b8e9dcc84d2d507d00845

Change-Id: I7a026bf6a2041e7686d90d5f155b88d8001f2ba8

6 years agoSet a reading order to the compatibility import file
Agam Rafaeli [Mon, 17 Dec 2018 16:20:09 +0000 (11:20 -0500)] 
Set a reading order to the compatibility import file

The order is as follows:
1. Imports, in the same format of "import X"
2. Members denoting versions of python
3. Members of imports that are shadowed for usage across the system
4. Global variables
5. If conditions of imports. (internally organized by this order)
6. Function definitions

Closes: #4409
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4409
Pull-request-sha: a7eb52d39f9758572e6a3314865bb633260aa8e1

Change-Id: I2fa44d1aebd7575df968f2e3f3fc7d474fa3c6d7

6 years agoDocument and support nested composites
Mike Bayer [Wed, 12 Dec 2018 17:51:20 +0000 (12:51 -0500)] 
Document and support nested composites

Composites can behave in a "nested" fashion by defining the
class in that way.   To make the constructor more convenient,
a callable can be passed to :func:`.composite` instead of the
class itself.  This works now, so add a test to ensure this
pattern remains available.

Change-Id: Ia009f274fca7269f41d6d824e0f70b6fb0ada081

6 years agocherry-pick changelog update for 1.2.16
Mike Bayer [Tue, 11 Dec 2018 21:56:37 +0000 (16:56 -0500)] 
cherry-pick changelog update for 1.2.16

6 years agocherry-pick changelog from 1.2.15
Mike Bayer [Tue, 11 Dec 2018 21:56:37 +0000 (16:56 -0500)] 
cherry-pick changelog from 1.2.15

6 years agoAdd before_mapper_configured event
Chris Wilson [Mon, 10 Dec 2018 21:37:51 +0000 (16:37 -0500)] 
Add before_mapper_configured event

This event is intended to allow a specific mapper to be skipped during the
configure step, by returning a value of `.orm.interfaces.EXT_SKIP` which means
the mapper will be skipped within this configure run. The "new mappers" flag
will remain set in this case and the configure operation will occur again.

This event, and its return value, make it possible to query one base while a
different one still needs configuration, which cannot be completed at this
time.

Fixes: #4397
Change-Id: I122e556f6a4ff842ad15315dcf39e19bb7f9a744
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4403

6 years agoMerge "Refer to existing of_type when resolving string attribute name"
mike bayer [Sat, 8 Dec 2018 14:19:28 +0000 (14:19 +0000)] 
Merge "Refer to existing of_type when resolving string attribute name"

6 years agoMerge "Take instance into account when determining AssociationProxyInstance"
mike bayer [Sat, 8 Dec 2018 14:18:53 +0000 (14:18 +0000)] 
Merge "Take instance into account when determining AssociationProxyInstance"

6 years agoTake instance into account when determining AssociationProxyInstance
Mike Bayer [Fri, 7 Dec 2018 18:08:29 +0000 (13:08 -0500)] 
Take instance into account when determining AssociationProxyInstance

Fixed a regression in 1.3.0b1 caused by :ticket:`3423` where association
proxy objects that access an attribute that's only present on a polymorphic
subclass would raise an ``AttributeError`` even though the actual instance
being accessed was an instance of that subclass.

Fixes: #4401
Change-Id: Ie62c48aa9142adff45cbf9a297184987c72f30f3

6 years agoRefer to existing of_type when resolving string attribute name
Mike Bayer [Fri, 7 Dec 2018 21:01:04 +0000 (16:01 -0500)] 
Refer to existing of_type when resolving string attribute name

Fixed bug where chaining of mapper options using
:meth:`.RelationshipProperty.of_type` in conjunction with a chained option
that refers to an attribute name by string only would fail to locate the
attribute.

Fixes: #4400
Change-Id: I01bf449ec4d8f56bb8c34e25153c1c9b31ff8012

6 years agoAdd versioned_update_old_row example
Mike Bayer [Fri, 7 Dec 2018 19:01:23 +0000 (14:01 -0500)] 
Add versioned_update_old_row example

A modification to the "turn UPDATE into INSERT" recipe that
also UPDATEs the previous row.  The example is using timestamps
to maintain a relationship between two objects.

Change-Id: Ifdb8ee73616190384263bbe88c71d9278d616f6b