]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
5 years agoMerge "Pass connection to TablesTest.insert_data()"
mike bayer [Wed, 15 Apr 2020 18:31:30 +0000 (18:31 +0000)] 
Merge "Pass connection to TablesTest.insert_data()"

5 years agoPass connection to TablesTest.insert_data()
Mike Bayer [Tue, 14 Apr 2020 19:30:28 +0000 (15:30 -0400)] 
Pass connection to TablesTest.insert_data()

towards the goal of reducing verbosity and repetition
in test fixtures as well as that we are moving to
connection only for execution, move the insert_data()
classmethod to accept a connection and adjust all
fixtures to use it.

Change-Id: I3bf534acca0d5f4cda1d4da8ae91f1155b829b09

5 years agoSet up absolute references for create_engine and related
Mike Bayer [Tue, 14 Apr 2020 20:39:42 +0000 (16:39 -0400)] 
Set up absolute references for create_engine and related

includes more replacements for create_engine(), Connection,
disambiguation of Result from future/baked

Change-Id: Icb60a79ee7a6c45ea9056c211ffd1be110da3b5e

5 years agoMerge "Run search and replace of symbolic module names"
mike bayer [Tue, 14 Apr 2020 19:48:20 +0000 (19:48 +0000)] 
Merge "Run search and replace of symbolic module names"

5 years agoMerge "Clean up .execute calls in test_results.py"
mike bayer [Tue, 14 Apr 2020 19:01:53 +0000 (19:01 +0000)] 
Merge "Clean up .execute calls in test_results.py"

5 years agoMerge "Clean up .execute calls in test_select.py"
mike bayer [Tue, 14 Apr 2020 19:01:18 +0000 (19:01 +0000)] 
Merge "Clean up .execute calls in test_select.py"

5 years agoMerge "Clean up .execute in test/sql/test_returning.py"
mike bayer [Tue, 14 Apr 2020 18:58:50 +0000 (18:58 +0000)] 
Merge "Clean up .execute in test/sql/test_returning.py"

5 years agoMerge "Clean up .execute in test/sql/test_query.py"
mike bayer [Tue, 14 Apr 2020 18:57:34 +0000 (18:57 +0000)] 
Merge "Clean up .execute in test/sql/test_query.py"

5 years agoMerge "Clean up .execute in test/sql/test_deprecations.py"
mike bayer [Tue, 14 Apr 2020 18:54:24 +0000 (18:54 +0000)] 
Merge "Clean up .execute in test/sql/test_deprecations.py"

5 years agoMerge "Clean up .execute in test/sql/test_resultset.py"
mike bayer [Tue, 14 Apr 2020 18:53:35 +0000 (18:53 +0000)] 
Merge "Clean up .execute in test/sql/test_resultset.py"

5 years agoMerge "Clean up .execute calls in remaining suite tests"
mike bayer [Tue, 14 Apr 2020 18:50:28 +0000 (18:50 +0000)] 
Merge "Clean up .execute calls in remaining suite tests"

5 years agoMerge "Clean up .execute calls in test_sequence.py"
mike bayer [Tue, 14 Apr 2020 18:48:58 +0000 (18:48 +0000)] 
Merge "Clean up .execute calls in test_sequence.py"

5 years agoMerge "Clean up .execute calls in test_insert.py"
mike bayer [Tue, 14 Apr 2020 18:48:13 +0000 (18:48 +0000)] 
Merge "Clean up .execute calls in test_insert.py"

5 years agoRun search and replace of symbolic module names
Mike Bayer [Tue, 14 Apr 2020 17:15:21 +0000 (13:15 -0400)] 
Run search and replace of symbolic module names

Replaces a wide array of Sphinx-relative doc references
with an abbreviated absolute form now supported by
zzzeeksphinx.

Change-Id: I94bffcc3f37885ffdde6238767224296339698a2

5 years agoMerge "Enable zzzeeksphinx module prefixes"
mike bayer [Tue, 14 Apr 2020 17:04:26 +0000 (17:04 +0000)] 
Merge "Enable zzzeeksphinx module prefixes"

5 years agoEnable zzzeeksphinx module prefixes
Mike Bayer [Sun, 12 Apr 2020 19:18:02 +0000 (15:18 -0400)] 
Enable zzzeeksphinx module prefixes

zzzeeksphinx 1.1.2 in git can now convert short
prefix names in a configured lookup to fully qualified module
names, so that
we can have succinct and portable pyrefs
that still resolve absolutely.
It also includes a formatter that will format all pyrefs
in a fully consistent way regardless of the package path,
by unconditionally removing all package tokens but always
leaving class names in place including for methods, which
means we no longer have to deal with tildes in pyrefs.

The most immediate goal of the absolute prefixes is
that we have lots of
"ambiguous" names that appear in muliple places, like select(),
ARRAY, ENUM etc.   With the incoming future packages there
is going to be lots of name overlap so it is necessary
that all names eventually use absolute package paths
when Sphinx receives them.

In multiple stages, pyrefs will be converted using the
zzzeeksphinx tools/fix_xrefs.py tool so that doclinks can
be made absolute using symbolic prefixes.

For this review, the actual search and replace of symbols
is not performed, instead some general cleanup to prepare
the docs as well as a lookup file used by the tool
to do the conversion.   this relatively small patch will
be backported
with appropriate changes to 1.3, 1.2, 1.1 and the tool
can then be run on each branch individually.  We are shooting
for almost no warnings at all for master (still a handful
I can't figure out which don't seem to have any impact)
, very few for 1.3,
and for 1.2 / 1.1 we hope for a significant reduction
in warnings.

Overall for all versions pyrefs should
always point to the correct target, if they are in fact
hyperlinked.  it's better for a ref to go nowhere and
be plain text than go to the wrong thing.  Right now,
hundreds of API links are pointing to the wrong thing
as they are ambiguous names such as refresh(), insert(),
update(), select(), join(), JSON etc. and Sphinx sends these all
to essesntially random destinations among as many as five
or six possible choices per symbol.  A shorthand system
that allows us to use absolute refs without having
to type out a full blown absoulte module is the only
way this is going to work, and we should ultimately
seek to abandon any use of prefix dot for lookups.  Everything
should be on an underscore token so at the very least the module
spaces can be reorganized without having to search and replace
the entire documentation every time.

Change-Id: I484a7329034af275fcdb322b62b6255dfeea9151

5 years agoClean up .execute in test/sql/test_returning.py
Gord Thompson [Tue, 14 Apr 2020 11:34:35 +0000 (05:34 -0600)] 
Clean up .execute in test/sql/test_returning.py

Change-Id: I390b0c9926345f9f4deec06b51d1a11a18a72ca9

5 years agoAdjust changelog files for removed directories
Mike Bayer [Mon, 13 Apr 2020 22:39:47 +0000 (18:39 -0400)] 
Adjust changelog files for removed directories

unreleased_11 and unreleased_12 are gone so remove these

also there's no place for the 4065 file to go, this is an old
and very small change and it looks like the file was not published in any
case, so just remove it.

Change-Id: I2b890ac4c7142e7b4462a7f45d7caa856edf3d4f

5 years agoSquashed commit of the following:
Mike Bayer [Mon, 13 Apr 2020 22:29:46 +0000 (18:29 -0400)] 
Squashed commit of the following:

commit 571da00f2c6fe905591b398a1e2fbc8ee2d05873
Author: jonathan vanasco <jonathan@2xlp.com>
Date:   Mon Apr 13 18:16:23 2020 -0400

    more examples, as suggested

commit c7b154eaf47719923c41498453571e04b6de1141
Author: jonathan vanasco <jonathan@2xlp.com>
Date:   Mon Apr 13 17:24:47 2020 -0400

    consolidating README

commit ff294507b664e9c414944a7509a0f71338957fbf
Author: jonathan vanasco <jonathan@2xlp.com>
Date:   Mon Apr 6 14:59:45 2020 -0400

    adding example readme

plus some mike changes

Change-Id: I09a11164df034ddcfe7c4e7d52308ea0b1ec509c

5 years agoAdd missing definitions to glossary
Mike Bayer [Mon, 13 Apr 2020 19:24:23 +0000 (15:24 -0400)] 
Add missing definitions to glossary

improve formatting

Change-Id: Iea3b72187d7c8020e18babb72a53c39c5aeec68c

5 years agoMerge remote-tracking branch 'origin/pr/5241'
Mike Bayer [Mon, 13 Apr 2020 18:07:37 +0000 (14:07 -0400)] 
Merge remote-tracking branch 'origin/pr/5241'

Change-Id: Ia2662c5fd9c7f544586a9450626cba738e5e9e7d

5 years agoMerge "Clean up .execute in test/sql/test_types.py"
mike bayer [Mon, 13 Apr 2020 15:47:19 +0000 (15:47 +0000)] 
Merge "Clean up .execute in test/sql/test_types.py"

5 years agoMerge "Repair find tables"
mike bayer [Mon, 13 Apr 2020 15:30:05 +0000 (15:30 +0000)] 
Merge "Repair find tables"

5 years agoMerge "Add ``comment`` attribute to :class:`.Column` ``__repr__`` method."
mike bayer [Mon, 13 Apr 2020 15:26:45 +0000 (15:26 +0000)] 
Merge "Add ``comment`` attribute to :class:`.Column` ``__repr__`` method."

5 years agoClean up .execute in test/sql/test_types.py
Gord Thompson [Mon, 13 Apr 2020 12:31:07 +0000 (06:31 -0600)] 
Clean up .execute in test/sql/test_types.py

Change-Id: I917264ecefcc7e2fd60e7170a0a0ad83d8167571

5 years agoClean up .execute in test/sql/test_query.py
Gord Thompson [Sun, 12 Apr 2020 23:38:04 +0000 (17:38 -0600)] 
Clean up .execute in test/sql/test_query.py

Change-Id: I3f3a3b3f7a7ec67ef475a9792372e1c9a600fafb

5 years agoMerge "Use define_tables for IsOrIsNotDistinctFromTest"
mike bayer [Mon, 13 Apr 2020 01:33:49 +0000 (01:33 +0000)] 
Merge "Use define_tables for IsOrIsNotDistinctFromTest"

5 years agoClean up .execute in test/sql/test_deprecations.py
Gord Thompson [Sun, 12 Apr 2020 21:27:06 +0000 (15:27 -0600)] 
Clean up .execute in test/sql/test_deprecations.py

Change-Id: I488f0992d5f26e164a903cbced11422046403647

5 years agoClean up .execute in test/sql/test_resultset.py
Gord Thompson [Sun, 12 Apr 2020 17:58:58 +0000 (11:58 -0600)] 
Clean up .execute in test/sql/test_resultset.py

Change-Id: Ie4bb2b8e94361d15a3f1f1c21ce1c59cff1cf735

5 years agoClean up .execute calls in remaining suite tests
Gord Thompson [Sun, 12 Apr 2020 13:03:25 +0000 (07:03 -0600)] 
Clean up .execute calls in remaining suite tests

Change-Id: Ib5c7f46067bcf5b162060476cc323bf671db101a

5 years agoClean up .execute calls in test_sequence.py
Gord Thompson [Sat, 11 Apr 2020 23:03:46 +0000 (17:03 -0600)] 
Clean up .execute calls in test_sequence.py

Change-Id: If92353297fc1b4bc843f6ec74cb29079b52c611b

5 years agoClean up .execute calls in test_results.py
Gord Thompson [Sat, 11 Apr 2020 20:11:55 +0000 (14:11 -0600)] 
Clean up .execute calls in test_results.py

Change-Id: I08b9046a48270f664ea8b8ba38d8be7763973a40

5 years agoAdd ``comment`` attribute to :class:`.Column` ``__repr__`` method.
Federico Caselli [Sat, 11 Apr 2020 18:50:37 +0000 (20:50 +0200)] 
Add ``comment`` attribute to :class:`.Column` ``__repr__`` method.

Fixes #4138

Change-Id: Ia93f7d7b1d2f38509421725fbe152a2ff163d5f3

5 years agoClean up .execute calls in test_select.py
Gord Thompson [Sat, 11 Apr 2020 18:27:22 +0000 (12:27 -0600)] 
Clean up .execute calls in test_select.py

Change-Id: I97dfb59d13a7c27c79c3dbcbcb5ba61948569e46

5 years agoFix almost all read-level sphinx warnings
Mike Bayer [Sat, 11 Apr 2020 17:46:56 +0000 (13:46 -0400)] 
Fix almost all read-level sphinx warnings

There are some related to changelog that I can't figure out
and are likely due to something in the changelog extension.
also one thing with a "collection" I can't figure out.

Change-Id: I0a9e6f4291c3589aa19a4abcb9245cd22a266fe0

5 years agoClean up .execute calls in test_insert.py
Gord Thompson [Sat, 11 Apr 2020 16:52:15 +0000 (10:52 -0600)] 
Clean up .execute calls in test_insert.py

Change-Id: I87e144d00577b53baab203c675caeaf8ad46cb5c

5 years agoMerge "The :meth:`.Inspector.reflecttable` was renamed to :meth:`.Inspector.reflect_t...
mike bayer [Sat, 11 Apr 2020 16:11:59 +0000 (16:11 +0000)] 
Merge "The :meth:`.Inspector.reflecttable` was renamed to :meth:`.Inspector.reflect_table`."

5 years agoThe :meth:`.Inspector.reflecttable` was renamed to :meth:`.Inspector.reflect_table`.
Federico Caselli [Fri, 10 Apr 2020 19:38:02 +0000 (21:38 +0200)] 
The :meth:`.Inspector.reflecttable` was renamed to :meth:`.Inspector.reflect_table`.

Fixes: #5244
Change-Id: I2b12fd69ed24ce1ede8f6ed5cb14cc7761308ee3

5 years agoUse define_tables for IsOrIsNotDistinctFromTest
Mike Bayer [Fri, 10 Apr 2020 20:58:41 +0000 (16:58 -0400)] 
Use define_tables for IsOrIsNotDistinctFromTest

In Ie8127ef29f1ec91e7afb88e1429538c27a321784 Mike
failed to notice that this test is build on TablesTest and
has just the one test function, which means the table is
built up by the fixture.

Change-Id: I855431bc976fe8ec96559ec1a22bb294aecf3c40

5 years agoMerge "Fix distinct_from test for Firebird et al."
mike bayer [Fri, 10 Apr 2020 20:53:54 +0000 (20:53 +0000)] 
Merge "Fix distinct_from test for Firebird et al."

5 years agoMerge "Evaluate fixes for cx_Oracle 8 API changes"
mike bayer [Fri, 10 Apr 2020 20:50:47 +0000 (20:50 +0000)] 
Merge "Evaluate fixes for cx_Oracle 8 API changes"

5 years agoEvaluate fixes for cx_Oracle 8 API changes
Mike Bayer [Fri, 10 Apr 2020 16:23:32 +0000 (12:23 -0400)] 
Evaluate fixes for cx_Oracle 8 API changes

in [1] we have reported some behavioral changes in cx_Oracle
symbols.   As it is unclear if these are intended changes in
cx_Oracle, test workarounds for these changes against
cx_Oracle master.

[1] https://github.com/oracle/python-cx_Oracle/issues/415

Fixes: #5246
Change-Id: If63f92553c46484bf2b61b53a9e6d85cb08e800a

5 years agoRepair CTE a in b tests
Mike Bayer [Fri, 10 Apr 2020 18:28:54 +0000 (14:28 -0400)] 
Repair CTE a in b tests

In I27cac9bd265c86ff2a3381ff9f844f60ef991cfc we modernized
the default tests and converted the "a in b" CTE tests to combinations,
however apparently the existing tests were not testing all
combinations and had repeats instead.   The combinations
decorator has made this much easier to spot, so use
the correct combinations that were originally intended.

Change-Id: Icd904887bff00c31525497d0b1508fabaf052dc9

5 years agoMerge "Remove code deprecated before version 1.1"
mike bayer [Fri, 10 Apr 2020 17:52:47 +0000 (17:52 +0000)] 
Merge "Remove code deprecated before version 1.1"

5 years agoModernize test_defaults
Mike Bayer [Thu, 9 Apr 2020 22:03:30 +0000 (18:03 -0400)] 
Modernize test_defaults

Use modern execution patterns, goal is so that these same tests
can work for the future engine

break sequence tests into test_sequences suite

sequence tests that are testing implicit execution patterns
at least move into their own suite that will go into test_deprecations
eventually.

Change-Id: I27cac9bd265c86ff2a3381ff9f844f60ef991cfc

5 years agoimprove linux build 5241/head
Federico Caselli [Thu, 9 Apr 2020 21:02:12 +0000 (23:02 +0200)] 
improve linux build

Change-Id: I9bde5fb2cd9997c620d8ee3173fcd7fc6d80cae7

5 years agoFix distinct_from test for Firebird et al.
Gord Thompson [Wed, 8 Apr 2020 11:40:36 +0000 (05:40 -0600)] 
Fix distinct_from test for Firebird et al.

Firebird (and perhaps others) allow us to CREATE TABLE inside a transaction but we can't INSERT INTO that table unless we COMMIT first.

Change-Id: Ie8127ef29f1ec91e7afb88e1429538c27a321784

5 years agoRepair find tables
Mike Bayer [Thu, 9 Apr 2020 15:15:03 +0000 (11:15 -0400)] 
Repair find tables

The recipe given out on the ML for improving ABC
fails in 1.4 due to find_tables() missing out on subqueries,
which is due to the refactor of Alias into multiple sub-types.

Change-Id: Idd2803b26a84b28db28e0b8c328b8f24550577e4

5 years agoallow for no spaced near the = in the tag_build
Federico Caselli [Wed, 8 Apr 2020 22:56:42 +0000 (00:56 +0200)] 
allow for no spaced near the = in the tag_build

Change-Id: I67b524025467fc2ee1faf34f3fe241a19b9c72f3

5 years agoremove duplicated pip update command
Federico Caselli [Wed, 8 Apr 2020 22:43:48 +0000 (00:43 +0200)] 
remove duplicated pip update command

Change-Id: I5f1d888a13dbdf4c9ded85a6922c9ffcdaea5a0f

5 years agoRemove code deprecated before version 1.1
Federico Caselli [Wed, 8 Apr 2020 18:26:21 +0000 (20:26 +0200)] 
Remove code deprecated before version 1.1

- Remove deprecated method ``get_primary_keys` in the :class:`.Dialect` and
  :class:`.Inspector` classes.
- Remove deprecated event ``dbapi_error`` and the method ``ConnectionEvents.dbapi_error`.
- Remove support for deprecated engine URLs of the form ``postgres://``.
- Remove deprecated dialect ``mysql+gaerdbms``.
- Remove deprecated parameter ``quoting`` from :class:`.mysql.ENUM`
  and :class:`.mysql.SET` in the ``mysql`` dialect.
- Remove deprecated function ``comparable_property``. and function
  ``comparable_using`` in the declarative extension.
- Remove deprecated function ``compile_mappers``.
- Remove deprecated method ``collection.linker``.
- Remove deprecated method ``Session.prune`` and parameter ``Session.weak_identity_map``.
  This change also removes the class ``StrongInstanceDict``.
- Remove deprecated parameter ``mapper.order_by``.
- Remove deprecated parameter ``Session._enable_transaction_accounting`.
- Remove deprecated parameter ``Session.is_modified.passive``.
- Remove deprecated class ``Binary``. Please use :class:`.LargeBinary`.
- Remove deprecated methods ``Compiled.compile``, ``ClauseElement.__and__`` and
  ``ClauseElement.__or__`` and attribute ``Over.func``.
- Remove deprecated ``FromClause.count`` method.
- Remove deprecated parameter ``Table.useexisting``.
- Remove deprecated parameters ``text.bindparams`` and ``text.typemap``.

- Remove boolean support for the ``passive`` parameter in ``get_history``.
- Remove deprecated ``adapt_operator`` in ``UserDefinedType.Comparator``.

Fixes: #4643
Change-Id: Idcd390c77bf7b0e9957907716993bdaa3f1a1763

5 years agoremove tag_build from setup.cfg
Federico Caselli [Wed, 8 Apr 2020 22:27:09 +0000 (00:27 +0200)] 
remove tag_build from setup.cfg

Change-Id: I547aecb28cda29607371138bf3a0c559a786c818

5 years agoAdd github workflow to generate wheel running after a release has beed created
Federico Caselli [Wed, 8 Apr 2020 20:17:42 +0000 (22:17 +0200)] 
Add github workflow to generate wheel running after a release has beed created

Change-Id: I916491f8f6bdbf7de7970a0ad4b24b9965003786

5 years agoChange ``orm.future`` to ``future.orm`` 5240/head
Federico Caselli [Wed, 8 Apr 2020 17:19:02 +0000 (19:19 +0200)] 
Change ``orm.future`` to ``future.orm``

Change-Id: I7fcf8b691134a0c52fbbf7879da071a41ec28102

5 years agotop link to 2.0 from the 1.4 docs
Mike Bayer [Wed, 8 Apr 2020 15:39:54 +0000 (11:39 -0400)] 
top link to 2.0 from the 1.4 docs

as these two versions are highly interrelated

Change-Id: I353ba3d40584781a547435e3ba2b3c36d926ba94

5 years agocherry-pick changelog update for 1.3.17
Mike Bayer [Wed, 8 Apr 2020 02:47:20 +0000 (22:47 -0400)] 
cherry-pick changelog update for 1.3.17

5 years agocherry-pick changelog from 1.3.16
Mike Bayer [Wed, 8 Apr 2020 02:47:20 +0000 (22:47 -0400)] 
cherry-pick changelog from 1.3.16

5 years agoMerge "Use dot-separated name resolution for relationship target"
mike bayer [Wed, 8 Apr 2020 01:48:20 +0000 (01:48 +0000)] 
Merge "Use dot-separated name resolution for relationship target"

5 years agoUse dot-separated name resolution for relationship target
Mike Bayer [Tue, 7 Apr 2020 21:37:14 +0000 (17:37 -0400)] 
Use dot-separated name resolution for relationship target

The string argument accepted as the first positional argument by the
:func:`.relationship` function when using the Declarative API is no longer
interpreted using the Python ``eval()`` function; instead, the name is dot
separated and the names are looked up directly in the name resolution
dictionary without treating the value as a Python expression.  However,
passing a string argument to the other :func:`.relationship` parameters
that necessarily must accept Python expressions will still use ``eval()``;
the documentation has been clarified to ensure that there is no ambiguity
that this is in use.

Fixes: #5238
Change-Id: Id802f403190adfab0ca034afe2214ba10fd9cfbb

5 years agoGracefully skip isolation level if no row returned
Mike Bayer [Tue, 7 Apr 2020 23:21:01 +0000 (19:21 -0400)] 
Gracefully skip isolation level if no row returned

Fixed issue in MySQL dialect when connecting to a psuedo-MySQL database
such as that provided by ProxySQL, the up front check for isolation level
when it returns no row will not prevent the dialect from continuing to
connect. A warning is emitted that the isolation level could not be
detected.

Fixes: #5239
Change-Id: I4a240386a0d38bd90733819495ce50e37fe2234c

5 years agoMerge "Add github action workflow to run tests on master and on pr to master"
mike bayer [Tue, 7 Apr 2020 16:19:55 +0000 (16:19 +0000)] 
Merge "Add github action workflow to run tests on master and on pr to master"

5 years agoMerge "Broaden is[not]_distinct_from support"
mike bayer [Tue, 7 Apr 2020 01:04:09 +0000 (01:04 +0000)] 
Merge "Broaden is[not]_distinct_from support"

5 years agoMerge "Clean up (engine|db).execute for oracle"
mike bayer [Mon, 6 Apr 2020 21:54:52 +0000 (21:54 +0000)] 
Merge "Clean up (engine|db).execute for oracle"

5 years agoClean up (engine|db).execute for oracle
Gord Thompson [Tue, 31 Mar 2020 15:59:16 +0000 (09:59 -0600)] 
Clean up (engine|db).execute for oracle

Change-Id: I6064fe348394152b2a47e83e43c469a153d34d27

5 years agoEnsure length parameter of Enum is adapted to new objects
Mike Bayer [Mon, 6 Apr 2020 20:19:23 +0000 (16:19 -0400)] 
Ensure length parameter of Enum is adapted to new objects

Ensure length parameter added to Enum in
Iea05dc8cd9e33959bb968b394fb10a7dd068c873 is correctly propagated
to new enum objects adapted from this one.

Fixes: #5183
`

Change-Id: I7f20d926f73ec8260938963df87e29894c7e55e2

5 years agoMerge "Add length parameter in `Enum`"
mike bayer [Mon, 6 Apr 2020 20:11:20 +0000 (20:11 +0000)] 
Merge "Add length parameter in `Enum`"

5 years agoAdd length parameter in `Enum`
Federico Caselli [Tue, 24 Mar 2020 20:06:04 +0000 (21:06 +0100)] 
Add length parameter in `Enum`

The `Enum` type now supports the parameter `Enum.length`
to specify the length of the VARCHAR column to create when using
non native enums by setting `Enum.native_enum` to `False`

Fixes: #5183
Change-Id: Iea05dc8cd9e33959bb968b394fb10a7dd068c873

5 years agoMerge "fix typo on testing.skip_if assertion"
mike bayer [Mon, 6 Apr 2020 16:51:32 +0000 (16:51 +0000)] 
Merge "fix typo on testing.skip_if assertion"

5 years agoApply fix to ComputedReflectionFixtureTest
Gord Thompson [Sat, 4 Apr 2020 19:39:50 +0000 (13:39 -0600)] 
Apply fix to ComputedReflectionFixtureTest

Avoid errors for dialects without schema support.
Also fix typo in test name.

Fixes: #5230
Change-Id: Id0f759b591a6119069b0fc5fc3b02addb85b0597

5 years agoEnsure context.attrbutes dictionary is reset each time
Mike Bayer [Sat, 4 Apr 2020 21:18:46 +0000 (17:18 -0400)] 
Ensure context.attrbutes dictionary is reset each time

A memory growth issue was identified in this test which
caused the profiling results to be inaccurate.

Change-Id: I248dcce5833feada947bc91bdf09a8f925d31d65

5 years agoKey subqueryloaders on the property object, not string key
Mike Bayer [Fri, 3 Apr 2020 20:00:22 +0000 (16:00 -0400)] 
Key subqueryloaders on the property object, not string key

Fixed bug in :func:`.orm.selectinload` loading option where two or more
loaders that represent different relationships with the same string key
name as referenced from a single :func:`.orm.with_polymorphic` construct
with multiple subclass mappers would fail to invoke each subqueryload
separately, instead making use of a single string-based slot that would
prevent the other loaders from being invoked.

Fixes: #5228
Change-Id: Id0d1db8029ca88c13c0068115fe673adb7a68407

5 years agoAdd github action workflow to run tests on master and on pr to master
Federico Caselli [Fri, 3 Apr 2020 18:11:24 +0000 (14:11 -0400)] 
Add github action workflow to run tests on master and on pr to master

Trying the pr to check if it works right away

### Description
<!-- Describe your changes in detail -->

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #5222
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5222
Pull-request-sha: afbb8567525f3841554d3ba599ef4d713c78e647

Change-Id: I4981b02f900e76e446cf42e6cc6495ffc0883951

5 years agoRun autoflush for column attribute load operations
Mike Bayer [Fri, 3 Apr 2020 00:45:44 +0000 (20:45 -0400)] 
Run autoflush for column attribute load operations

The "autoflush" behavior of :class:`.Query` will now trigger for nearly
all ORM level attribute load operations, including when a deferred
column is loaded as well as when an expired column is loaded.   Previously,
autoflush on load of expired or unloaded attributes was limited to
relationship-bound attributes only.   However, this led to the issue
where column-based attributes that also depended on other rows, or even
other columns in the same row, in order to express the correct value,
would show an effectively stale value when accessed as there could be
pending changes in the session left to be flushed.    Autoflush
is now disabled only in some cases where attributes are being unexpired in
the context of a history operation.

Fixes: #5226
Change-Id: Ibd965b30918cd273ae020411a704bf2bb1891f59

5 years agoBroaden is[not]_distinct_from support
Gord Thompson [Thu, 2 Apr 2020 17:51:11 +0000 (11:51 -0600)] 
Broaden is[not]_distinct_from support

Added support for .is[not]_distinct_from to SQL Server, MySQL, and Oracle.

Fixes: #5137
Change-Id: I3b4d3b199821a55687f83c9a5b63a95d07a64cd5

5 years agoRepair caching / traversals for values
Mike Bayer [Wed, 1 Apr 2020 22:31:16 +0000 (18:31 -0400)] 
Repair caching / traversals for values

The test suite wasn't running the copy_internals most fixtures,
enable that and try to get all cases working.

Set up selectable.values to do tuple conversion within compilation
step.  at the same time, disable caching for selectable.values
for the moment and make it equivalent to dml_multi_values.

fix cache / compare / copy cases for dml_values and dml_multi_values
which weren't fully tested or covered.

Change-Id: I484ca6e9cb2b66c2e6a321698f2abc0838db1460

5 years agoTry to measure new style caching in the ORM, take two
Mike Bayer [Mon, 9 Mar 2020 21:12:35 +0000 (17:12 -0400)] 
Try to measure new style caching in the ORM, take two

Supercedes: If78fbb557c6f2cae637799c3fec2cbc5ac248aaf

Trying to see if by making the cache key memoized, we
still can have the older "identity" form of caching
which is the cheapest of all, at the same time as the
newer "cache key each time" version that is not nearly
as cheap; but still much cheaper than no caching at all.

Also needed is a per-execution update of _keymap when
we invoke from a cached select, so that Column objects
that are anonymous or otherwise adapted will match up.
this is analogous to the adaption of bound parameters
from the cache key.

Adds test coverage for the keymap / construct_params()
 changes related to caching.  Also hones performance
to a large extent for statement construction and
cache key generation.

Also includes a new memoized attribute
approach that vastly simplifies the previous approach
of "group_expirable_memoized_property" and finally
integrates cleanly with _clone(), _generate(), etc.
no more hardcoding of attributes is needed, as well
as that most _reset_memoization() calls are no longer
needed as the reset is inherent in a _generate() call;
this also has dramatic performance improvements.

Change-Id: I95c560ffcbfa30b26644999412fb6a385125f663

5 years agoFix databases -> dialects
Mike Bayer [Wed, 1 Apr 2020 17:51:35 +0000 (13:51 -0400)] 
Fix databases -> dialects

The change in I5343a2d270ed5a8c654b9fe13dff40cdf54649ed
left the name "databases" present in one spot, which is usually
not reached unless tests are being run on only partial files
where not every dialect has been imported.

Change-Id: I5a8776b412eaf2476f8a93eebc31448b6f9218ee

5 years agofix typo on testing.skip_if assertion
Federico Caselli [Tue, 31 Mar 2020 19:13:21 +0000 (21:13 +0200)] 
fix typo on testing.skip_if assertion

Change-Id: I3f2eeffb0b59971a6025f9ce69250d6421751d16

5 years agoMerge "Clean up (engine|db).execute for sqlite"
mike bayer [Tue, 31 Mar 2020 16:30:41 +0000 (16:30 +0000)] 
Merge "Clean up (engine|db).execute for sqlite"

5 years agoMerge "Clean up (engine|db).execute for mysql"
mike bayer [Tue, 31 Mar 2020 16:29:00 +0000 (16:29 +0000)] 
Merge "Clean up (engine|db).execute for mysql"

5 years agoMerge "Clean up .execute calls in PostgreSQL tests"
mike bayer [Tue, 31 Mar 2020 16:28:23 +0000 (16:28 +0000)] 
Merge "Clean up .execute calls in PostgreSQL tests"

5 years agoClean up .execute calls in PostgreSQL tests
Gord Thompson [Sat, 28 Mar 2020 23:34:05 +0000 (17:34 -0600)] 
Clean up .execute calls in PostgreSQL tests

Fixes: #5220
Change-Id: I789e45dffc2b177ebb15ea3268bb965be8b06397

5 years agoClean up (engine|db).execute for sqlite
Gord Thompson [Tue, 31 Mar 2020 13:19:13 +0000 (07:19 -0600)] 
Clean up (engine|db).execute for sqlite

Change-Id: Ie43e5b3a34ecc64ab77410e42f3e8de8bbc1e2d8

5 years agoClean up (engine|db).execute for mysql
Gord Thompson [Tue, 31 Mar 2020 12:33:55 +0000 (06:33 -0600)] 
Clean up (engine|db).execute for mysql

Change-Id: Ibc3509630a7c418b500ec7c6587f311326b75c93

5 years agoFix one more db.execute in mssql test
Gord Thompson [Tue, 31 Mar 2020 12:04:59 +0000 (06:04 -0600)] 
Fix one more db.execute in mssql test

Change-Id: Ia34da0d3bbaaa3e98a5318191a38a5c3354061c9

5 years agoFix sqlite memory req
Mike Bayer [Mon, 30 Mar 2020 19:04:53 +0000 (15:04 -0400)] 
Fix sqlite memory req

this is only used by test/requirements.py right now for the
profiling tests but it was not returning the correct answer
during a regenerate operation.

Change-Id: Id9747b4fe562b8bea9b21c465b626b1b19e6956b

5 years agoupdates to 2.0 migration notes
Mike Bayer [Mon, 30 Mar 2020 18:06:28 +0000 (14:06 -0400)] 
updates to 2.0 migration notes

- make sure when we refer to 2.0 code we use the future.select()
pattern, not session.query()

- add more imports to examples

- note code examples that are "new" vs. "old"

Change-Id: I001e180231783cc77192013bf0a1501c7540e90f

5 years agoRemove ORDER BY pk from subqueryload, selectinload
Mike Bayer [Mon, 30 Mar 2020 15:04:24 +0000 (11:04 -0400)] 
Remove ORDER BY pk from subqueryload, selectinload

Modified the queries used by subqueryload and selectinload to no longer
ORDER BY the primary key of the parent entity;  this ordering was there to
allow the rows as they come in to be copied into lists directly with a
minimal level of Python-side collation.   However, these ORDER BY clauses
can negatively impact the performance of the query as in many scenarios
these columns are derived from a subquery or are otherwise not actual
primary key columns such that SQL planners cannot make use of indexes. The
Python-side collation uses the native itertools.group_by() to collate the
incoming rows, and has been modified to allow multiple
row-groups-per-parent to be assembled together using list.extend(), which
should still allow for relatively fast Python-side performance.  There will
still be an ORDER BY present for a relationship that includes an explicit
order_by parameter, however this is the only ORDER BY that will be added to
the query for both kinds of loading.

Fixes: #5162
Change-Id: I8befd1303c1af7cc24cbf005f39bc01c8b2745f3

5 years agoMerge "String compiler can now literal compile datetime objects"
mike bayer [Mon, 30 Mar 2020 13:57:08 +0000 (13:57 +0000)] 
Merge "String compiler can now literal compile datetime objects"

5 years agoMerge "Add a third labeling mode for SELECT statements"
mike bayer [Mon, 30 Mar 2020 13:06:04 +0000 (13:06 +0000)] 
Merge "Add a third labeling mode for SELECT statements"

5 years agoAdd a third labeling mode for SELECT statements
Mike Bayer [Sun, 29 Mar 2020 18:24:39 +0000 (14:24 -0400)] 
Add a third labeling mode for SELECT statements

Enhanced the disambiguating labels feature of the
:func:`~.sql.expression.select` construct such that when a select statement
is used in a subquery, repeated column names from different tables are now
automatically labeled with a unique label name, without the need to use the
full "apply_labels()" feature that conbines tablename plus column name.
The disambigated labels are available as plain string keys in the .c
collection of the subquery, and most importantly the feature allows an ORM
:func:`.orm.aliased` construct against the combination of an entity and an
arbitrary subquery to work correctly, targeting the correct columns despite
same-named columns in the source tables, without the need for an "apply
labels" warning.

The existing labeling style is now called
LABEL_STYLE_TABLENAME_PLUS_COL.  This labeling style will remain used
throughout the ORM as has been the case for over a decade, however,
the new disambiguation scheme could theoretically replace this scheme
entirely.  The new scheme would dramatically alter how SQL looks
when rendered from the ORM to be more succinct but arguably harder
to read.

The tablename_columnname scheme used by Join.c is unaffected here,
as that's still hardcoded to that scheme.

Fixes: #5221
Change-Id: Ib47d9e0f35046b3afc77bef6e65709b93d0c3026

5 years agoMerge "Remove support for python 3.4"
mike bayer [Mon, 30 Mar 2020 01:47:50 +0000 (01:47 +0000)] 
Merge "Remove support for python 3.4"

5 years agoRemove support for python 3.4
Federico Caselli [Sun, 29 Mar 2020 18:57:08 +0000 (20:57 +0200)] 
Remove support for python 3.4

Also remove no longer used compat code

Change-Id: Ifda239fd84b425e43f4028cb55a5b3b8efa4dfc6

5 years agoString compiler can now literal compile datetime objects
Federico Caselli [Tue, 24 Mar 2020 21:55:46 +0000 (22:55 +0100)] 
String compiler can now literal compile datetime objects

Add ability to literal compile a :class:`DateTime`, :class:`Date`
or :class:"Time" when using the string dialect for debugging purposes.
This change does not impact real dialect implementation that retain
their current behavior.

Fixes: #5052
Change-Id: Ia3fad2be905c6d35b0106b9a2388c7508f067e90

5 years agoMerge "Repair queries from #5134 to ORDER BY outside the subquery"
mike bayer [Sun, 29 Mar 2020 18:41:55 +0000 (18:41 +0000)] 
Merge "Repair queries from #5134 to ORDER BY outside the subquery"

5 years agoRepair queries from #5134 to ORDER BY outside the subquery
Mike Bayer [Sun, 29 Mar 2020 16:06:29 +0000 (12:06 -0400)] 
Repair queries from #5134 to ORDER BY outside the subquery

ORDER BY has to be on the outermost query to guarantee ordering
as these tests were failing for SQL Server.   Also add
new tests that don't use from_self() as this is also going to
be removed in 2.0.

Also propose some from_self() alternatives.  References #5221

Change-Id: Ia2a669f45fcaada607e73d9225849fd74d25f6e5

5 years agoFix typo in resultproxy.c and test compatibility with python 3.5
Federico Caselli [Sat, 28 Mar 2020 10:04:44 +0000 (11:04 +0100)] 
Fix typo in resultproxy.c and test compatibility with python 3.5

- Fix typo in resultproxy.c that would error on windows.
- add -Wundef to C flags when linux is detected so that undefined
symbols emit a warning
- a few adjustments for tests to succeed on python 3.5
- note minimum version still documented here as 3.4 but this should
move to at least 3.5 if not 3.6 for SQLAlchemy 1.4

Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b

5 years agointroduce "autobegin" concept for Connection
Mike Bayer [Thu, 26 Mar 2020 21:26:57 +0000 (17:26 -0400)] 
introduce "autobegin" concept for Connection

because engine.connect() and engine.begin() should feature
identical internal behavior, with the sole exception that
one rolls back and the end and the other commits at the end,
while also supporting execution options like transaction isolation level
at the connection level, include that engine.connect() will
return a connection that uses autobegin in the same way as the
session will.   This is solely to support the "begin" event
noting that a transaction is begun which is tracked on the
connection.    Behavior and design should be very similar to that
of the ORM session and "Transaction" should no longer be a very
explicit object.

Change-Id: I9c317d242ca7a435de0f17b1618355e29a10d1bc

5 years agotypo: missing comma 5215/head
michitaro.koike [Thu, 26 Mar 2020 07:09:42 +0000 (16:09 +0900)] 
typo: missing comma

5 years agoFix typos in migration_20 documentation
Federico Caselli [Wed, 25 Mar 2020 19:47:25 +0000 (20:47 +0100)] 
Fix typos in migration_20 documentation

Change-Id: I9ea9fc5bffe8615de432e2bb113e0a14bdf05e54