| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I14db8e9c69a832b0f5dae8036db3c0a70bb49edd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we don't have any automatic deprecation warning for 2.0
unless SQLALCHEMY_WARN_20 is set, applications that are not
being monitored for deprecations have no way to guard against
2.0 being released on pypi unless they add a requirements
rule.
make sure we are putting out a major warning for people who
may have not noticed that SQLAlchemy 2.0 will break compatibility
with legacy use patterns.
Fixes: #8983
Change-Id: I7d50db52c9a0fe3165b0131aab2fce9af80d51dd
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed regression where the base compat module was calling upon
``platform.architecture()`` in order to detect some system properties,
which results in an over-broad system call against the system-level
``file`` call that is unavailable under some circumstances, including
within some secure environment configurations.
Fixes: #8995
Change-Id: Ib6171e75aff5a60a79dab81a0be21bee2456318b
(cherry picked from commit e852362bfdf9a18dfd91137f4a2d7c2dfee30082)
|
|
|
|
|
| |
Change-Id: I8287f3e1a975534c8a01a41c9dcc7e5e9f08bb52
(cherry picked from commit 9f4ac8d155f58b59cf314cfbc73195ed51a0c146)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can cache the annotated cache key for Table, but
for selectables it's not safe, as it fails to pass the
anon_map along and creates many redudant structures in
observed test scenario. It is likely safe for a
Column that's mapped to a Table also, however this is
not implemented here. Will have to see if that part
needs adjusting.
Fixed critical memory issue identified in cache key generation, where for
very large and complex ORM statements that make use of lots of ORM aliases
with subqueries, cache key generation could produce excessively large keys
that were orders of magnitude bigger than the statement itself. Much thanks
to Rollo Konig Brock for their very patient, long term help in finally
identifying this issue.
Also within TypeEngine objects, when we generate elements
for instance variables, skip the None elements at least.
this also saves on tuple complexity.
Fixes: #8790
Change-Id: I448ddbfb45ae0a648815be8dad4faad7d1977427
(cherry picked from commit 88c240d907a9ae3b5caf766009edd196a30cece3)
|
|
|
|
|
|
|
|
|
|
|
| |
Repaired a deprecation warning class decorator that was preventing key
objects such as :class:`_engine.Connection` from having a proper
``__weakref__`` attribute, causing operations like Python standard library
``inspect.getmembers()`` to fail.
Fixes: #8115
Change-Id: Ifd0bc2325fb9dc9e1431998c308b7fc081968373
(cherry picked from commit cc7cc3c9ec73055703acc78c8d92eb0242e5cd20)
|
|
|
|
|
|
|
|
| |
still can't figure out the warnings with some of the older
changelog files.
Fixes: #7946
Change-Id: Id657ab23008eed0b133fed65b2f9ea75a626215c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed issue where support for logging "stacklevel" implemented in
:ticket:`7612` required adjustment to work with recently released Python
3.11.0b1, also repairs the unit tests which tested this feature.
Install greenlet from a py311 compat patch.
re: the stacklevel thing, this is going to be very inconvenient
if we have to keep hardcoding numbers everywhere for every
new python version
Change-Id: I0c8f7293e98c0ca5cc544538284bfd1d3020cb1f
References: https://github.com/python-greenlet/greenlet/issues/288
Fixes: #8019
(cherry picked from commit 43ff5b82dc0d91cacd625ac8943622ab340958c5)
|
|
|
|
|
|
|
|
|
|
| |
Allow setting contextvar values inside async adapted event handlers.
Previously the value set to the contextvar would not be properly
propagated.
Fixes: #7937
Change-Id: I787aa869f8d057579e13e32c749f05f184ffd02a
(cherry picked from commit 640d163bd8bf61e87790255558b6f704a0d06174)
|
|
|
|
|
| |
Change-Id: I42ed77f559e3ee5b8c600d98457ee37803ef0ea6
(cherry picked from commit 139c6ec0fb1f930be9b64545262d2580f6cbc83e)
|
|
|
|
| |
Change-Id: Ic38dbc640aa0fe8a784a5b5e57c45a41eb0ea01b
|
|
|
|
|
|
| |
Fixes: #7419
Change-Id: I0c604875a80287acff3bab732f67601a5e2db98c
(cherry picked from commit 533f5718904b620be8d63f2474229945d6f8ba5d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed regression where the row objects returned for ORM queries, which are
now the normal :class:`_sql.Row` objects, would not be interpreted by the
:meth:`_sql.ColumnOperators.in_` operator as tuple values to be broken out
into individual bound parameters, and would instead pass them as single
values to the driver leading to failures. The change to the "expanding IN"
system now accommodates for the expression already being of type
:class:`.TupleType` and treats values accordingly if so. In the uncommon
case of using "tuple-in" with an untyped statement such as a textual
statement with no typing information, a tuple value is detected for values
that implement ``collections.abc.Sequence``, but that are not ``str`` or
``bytes``, as always when testing for ``Sequence``.
Added :class:`.TupleType` to the top level ``sqlalchemy`` import namespace.
Fixes: #7292
Change-Id: I8286387e3b3c3752b3bd4ae3560d4f31172acc22
(cherry picked from commit 0c44a1e77cfde0f841a4a64140314c6b833efdab)
|
|
|
|
|
|
|
|
|
|
|
| |
this is the last warning to remove.
Also fixes some mistakes I made with the new
Base20DeprecationWarning and LegacyAPIWarning classes created,
where functions in deprecations.py were still hardcoded to
RemovedIn20Warning.
Change-Id: I9a6045ac9b813fd2f9668c4bc518c46a7774c6ef
|
|
|
|
|
|
|
|
|
| |
most of the work for aliased / from_joinpoint has been done
already as I added all new tests for these and moved
most aliased/from_joinpoint to test/orm/test_deprecations.py
already
Change-Id: Ia23e332dec183de17b2fb9d89d946af8d5e89ae7
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed installation issue where the ``sqlalchemy.dialects.mysql`` module
would not be importable if "greenlet" were not installed.
This was actually breaking the sphinx build for when greenlet
were not installed.
Fixes: #7204
Change-Id: Ia351c124a2f1ca44bafe20a97267ce20cb55808f
|
|
|
|
|
|
|
|
| |
the hybridmethod internal seems to be confusing
a recent version of sphinx autodoc, add attribute it's searching
for.
Change-Id: I27f671a51f857b62337cc2374bbc87383ae9710d
|
|
|
|
|
|
|
| |
while we still support python 3.6 vendor a simple version
of this for now in the one place we currently use it.
Change-Id: Ibcfc8b004b17e2ac79f9123ccb76c5eb25243f90
|
|
|
|
|
|
|
|
|
| |
Fixes: #6915
Closes: #6916
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6916
Pull-request-sha: 6ec484d3d14b7dd7053d10a5d550bd74eb524c8b
Change-Id: I2c87fbed44870110e35a69ee9a9e678671eeb8f0
|
|
|
|
|
|
| |
Fixes: #6804
Fixes: #6759
Change-Id: Ie7f32c38a22dbfa059b5709b883ff464b16031ae
|
|
|
|
|
|
| |
Also replace http://pypi.python.org/pypi with https://pypi.org/project
Change-Id: I84b5005c39969a82140706472989f2a30b0c7685
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug in asyncio implementation where the greenlet adaptation system
failed to propagate ``BaseException`` subclasses, most notably including
``asyncio.CancelledError``, to the exception handling logic used by the
engine to invalidate and clean up the connection, thus preventing
connections from being correctly disposed when a task was cancelled.
Fixes: #6652
Change-Id: Id3809e6c9e7bced46a7a3b5a0d1906c4168dc4fc
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed an issue that presented itself when using the :class:`_pool.NullPool`
or the :class:`_pool.StaticPool` with an async engine. This mostly affected
the aiosqlite dialect.
Fixes: #6575
Change-Id: Ic1e27d99ffcb20ed4de82ea78f430a0f3b629d86
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Added ``asyncio.exceptions.TimeoutError``,
``asyncio.exceptions.CancelledError`` as so-called "exit exceptions", a
class of exceptions that include things like ``GreenletExit`` and
``KeyboardInterrupt``, which are considered to be events that warrant
considering a DBAPI connection to be in an unusable state where it should
be recycled.
Fixes: #6592
Change-Id: Idcfa7aaa2d7660838b907388db9c6457afa6edbd
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adjusted the means by which classes such as :class:`_orm.scoped_session`
and :class:`_asyncio.AsyncSession` are generated from the base
:class:`_orm.Session` class, such that custom :class:`_orm.Session`
subclasses such as that used by Flask-SQLAlchemy don't need to implement
positional arguments when they call into the superclass method, and can
continue using the same argument styles as in previous releases.
Fixes: #6285
References: https://github.com/pallets/flask-sqlalchemy/issues/953
Change-Id: I8612ab33743625e70eb158efceb0636d783c92a5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resolved various deprecation warnings which were appearing as of Python
version 3.10.0b1.
block aiomysql on python 3.10 as they are using the "loop" argument
that's removed
sqlcipher-binary has no builds on 3.10, block it for 3.10
Fixes: #6540
Fixes: #6543
Change-Id: Iec1e3881fb289878881ae043b1a18c3ecdf5f077
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new description to errors.rst and adds support
for any SQLAlchemy warning to refer to an errors.rst code.
Fixes: #6148
Closes: #6250
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6250
Pull-request-sha: dbcaeb54e31517fe88f6f8c515f1024002675f13
Change-Id: I4303c62ac9b1f13f67a34f825687014f1771c98c
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new approach has been applied to the warnings system in SQLAlchemy to
accurately predict the appropriate stack level for each warning
dynamically. This allows evaluating the source of SQLAlchemy-generated
warnings and deprecation warnings to be more straightforward as the warning
will indicate the source line within end-user code, rather than from an
arbitrary level within SQLAlchemy's own source code.
Fixes: #6241
Change-Id: I9ecf3b3ea77424d15e8d4c0aa47350602c0568d7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Applied consistent behavior to the use case of
calling ``.commit()`` or ``.rollback()`` inside of an existing
``.begin()`` context manager, with the addition of potentially
emitting SQL within the block subsequent to the commit or rollback.
This change continues upon the change first added in
:ticket:`6155` where the use case of calling "rollback" inside of
a ``.begin()`` contextmanager block was proposed:
* calling ``.commit()`` or ``.rollback()`` will now be allowed
without error or warning within all scopes, including
that of legacy and future :class:`_engine.Engine`, ORM
:class:`_orm.Session`, asyncio :class:`.AsyncEngine`. Previously,
the :class:`_orm.Session` disallowed this.
* The remaining scope of the context manager is then closed;
when the block ends, a check is emitted to see if the transaction
was already ended, and if so the block returns without action.
* It will now raise **an error** if subsequent SQL of any kind
is emitted within the block, **after** ``.commit()`` or
``.rollback()`` is called. The block should be closed as
the state of the executable object would otherwise be undefined
in this state.
Fixes: #6288
Change-Id: I8b21766ae430f0fa1ac5ef689f4c0fb19fc84336
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed a regression introduced by :ticket:`6337` that would create an
``asyncio.Lock`` which could be attached to the wrong loop when
instantiating the async engine before any asyncio loop was started, leading
to an asyncio error message when attempting to use the engine under certain
circumstances.
Fixes: #6409
Change-Id: I8119c56b44a7bd70a650c0ea676892d4d7814a8b
|
|
|
|
|
|
|
|
|
| |
Fixed an issue with the (deprecated in 1.4)
:meth:`_schema.ForeignKeyConstraint.copy` method that caused an error when
invoked with the ``schema`` argument.
Fixes: #6353
Change-Id: I03330d9ec254d64377f2b2e86af69a4eaff43ac6
|
|
|
|
|
| |
Fixes: #6166
Change-Id: I1355e9a8b6455ca377892214e9426c8f70441f98
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Scaled back the warning message added in :ticket:`5171` to not warn for
overlapping columns in an inheritance scenario where a particular
relationship is local to a subclass and therefore does not represent an
overlap.
Add errors documentation for the warning and also expand
``util.warn()`` to include a code parameter.
Fixes: #6171
Change-Id: Icb1f12d8d645d439ffd2bbb7371c6b00042b6ae3
|
|
|
|
|
|
|
|
| |
importlib_metadata deprecates the .get() method and provides
a different method .select() as of 3.7.1. Work around
the deprecation warning in this case.
Change-Id: I0f1849219e13a1c546f7bd24047d447823a15552
|
|
|
|
|
|
|
|
| |
Added support for the aiosqlite database driver for use with the
SQLAlchemy asyncio extension.
Fixes: #5920
Change-Id: Id11a320516a44e886a6f518d2866a0f992413e55
|
|
|
|
|
|
|
|
| |
Uses the flake8 option per-file-ignores that was introduced in a recent
version of flake8 (3.7.+) to avoid having lots of "noqa" in import
only files
Change-Id: Ib4871d63bad7e578165615df139cbf6093479201
|
|
|
|
|
|
|
|
|
| |
* remove the c version of distill params since it's actually slower than
the python one
* add a function to langhelpers to check if the cextensions are active
* minor cleanup to the OrderedSet implementation
Change-Id: Iec3d0c3f0f42cdf51f802aaca342ba37b8783b85
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These were revealed by running `pylint --disable all --enable spelling --spelling-dict en_US` over all sources.
Closes: #5868
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5868
Pull-request-sha: bb249195d92e3b806e81ecf1192d5a1b3cd5db48
Change-Id: I96080ec93a9fbd20ce21e9e16265b3c77f22bb14
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue where mixin attribute rules were not taking
effect correctly for attributes pulled from dataclasses
using the approach added in #5745.
Fixes: #5876
Change-Id: I45099a42de1d9611791e72250fe0edc69bed684c
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tests here are failing for python 3.6 due to the lack
of asyncio.run(). It seems to be non-trivial to vendor
a working version of this in Python 3.6 as the tests here
are running it in alternate threads.
The python documentation imports everything directly from the
asyncio package, and it seems that py < 3.8 does not have the
asyncio.exception module
Closes: #5865
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5865
Pull-request-sha: 35cc1fa3f6ff962676f571ae30851f4b4d96762a
Change-Id: I9398c9fb2aa87f3228ce2f59277de732091bd541
|
|\ |
|
| |
| |
| |
| |
| | |
Fixes: #5832
Change-Id: Ia2ed8f1d1ec54e5f6e1a8f817a69446fdb3b7f6d
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Log an informative message if a connection is not closed
and the gc is reclaiming it when using an async dpapi, that
does not support running IO at that stage.
The ``AsyncAdaptedQueue`` used by default on async dpapis
should instantiate a queue only when it's first used
to avoid binding it to a possibly wrong event loop.
Fixes: #5823
Change-Id: Ibfc50e209b1937ae3d6599ae7997f028c7a92c33
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To allow the "connection" pytest fixture and others work
correctly in conjunction with setup/teardown that expects
to be external to the transaction, remove and prevent any usage
of "xdist" style names that are hardcoded by pytest to run
inside of fixtures, even function level ones. Instead use
pytest autouse fixtures to implement our own
r"setup|teardown_test(?:_class)?" methods so that we can ensure
function-scoped fixtures are run within them. A new more
explicit flow is set up within plugin_base and pytestplugin
such that the order of setup/teardown steps, which there are now
many, is fully documented and controllable. New granularity
has been added to the test teardown phase to distinguish
between "end of the test" when lock-holding structures on
connections should be released to allow for table drops,
vs. "end of the test plus its teardown steps" when we can
perform final cleanup on connections and run assertions
that everything is closed out.
From there we can remove most of the defensive "tear down everything"
logic inside of engines which for many years would frequently dispose
of pools over and over again, creating for a broken and expensive
connection flow. A quick test shows that running test/sql/ against
a single Postgresql engine with the new approach uses 75% fewer new
connections, creating 42 new connections total, vs. 164 new
connections total with the previous system.
As part of this, the new fixtures metadata/connection/future_connection
have been integrated such that they can be combined together
effectively. The fixture_session(), provide_metadata() fixtures
have been improved, including that fixture_session() now strongly
references sessions which are explicitly torn down before
table drops occur afer a test.
Major changes have been made to the
ConnectionKiller such that it now features different "scopes" for
testing engines and will limit its cleanup to those testing
engines corresponding to end of test, end of test class, or
end of test session. The system by which it tracks DBAPI
connections has been reworked, is ultimately somewhat similar to
how it worked before but is organized more clearly along
with the proxy-tracking logic. A "testing_engine" fixture
is also added that works as a pytest fixture rather than a
standalone function. The connection cleanup logic should
now be very robust, as we now can use the same global
connection pools for the whole suite without ever disposing
them, while also running a query for PostgreSQL
locks remaining after every test and assert there are no open
transactions leaking between tests at all. Additional steps
are added that also accommodate for asyncio connections not
explicitly closed, as is the case for legacy sync-style
tests as well as the async tests themselves.
As always, hundreds of tests are further refined to use the
new fixtures where problems with loose connections were identified,
largely as a result of the new PostgreSQL assertions,
many more tests have moved from legacy patterns into the newest.
An unfortunate discovery during the creation of this system is that
autouse fixtures (as well as if they are set up by
@pytest.mark.usefixtures) are not usable at our current scale with pytest
4.6.11 running under Python 2. It's unclear if this is due
to the older version of pytest or how it implements itself for
Python 2, as well as if the issue is CPU slowness or just large
memory use, but collecting the full span of tests takes over
a minute for a single process when any autouse fixtures are in
place and on CI the jobs just time out after ten minutes.
So at the moment this patch also reinvents a small version of
"autouse" fixtures when py2k is running, which skips generating
the real fixture and instead uses two global pytest fixtures
(which don't seem to impact performance) to invoke the
"autouse" fixtures ourselves outside of pytest.
This will limit our ability to do more with fixtures
until we can remove py2k support.
py.test is still observed to be much slower in collection in the
4.6.11 version compared to modern 6.2 versions, so add support for new
TOX_POSTGRESQL_PY2K and TOX_MYSQL_PY2K environment variables that
will run the suite for fewer backends under Python 2. For Python 3
pin pytest to modern 6.2 versions where performance for collection
has been improved greatly.
Includes the following improvements:
Fixed bug in asyncio connection pool where ``asyncio.TimeoutError`` would
be raised rather than :class:`.exc.TimeoutError`. Also repaired the
:paramref:`_sa.create_engine.pool_timeout` parameter set to zero when using
the async engine, which previously would ignore the timeout and block
rather than timing out immediately as is the behavior with regular
:class:`.QueuePool`.
For asyncio the connection pool will now also not interact
at all with an asyncio connection whose ConnectionFairy is
being garbage collected; a warning that the connection was
not properly closed is emitted and the connection is discarded.
Within the test suite the ConnectionKiller is now maintaining
strong references to all DBAPI connections and ensuring they
are released when tests end, including those whose ConnectionFairy
proxies are GCed.
Identified cx_Oracle.stmtcachesize as a major factor in Oracle
test scalability issues, this can be reset on a per-test basis
rather than setting it to zero across the board. the addition
of this flag has resolved the long-standing oracle "two task"
error problem.
For SQL Server, changed the temp table style used by the
"suite" tests to be the double-pound-sign, i.e. global,
variety, which is much easier to test generically. There
are already reflection tests that are more finely tuned
to both styles of temp table within the mssql test
suite. Additionally, added an extra step to the
"dropfirst" mechanism for SQL Server that will remove
all foreign key constraints first as some issues were
observed when using this flag when multiple schemas
had not been torn down.
Identified and fixed two subtle failure modes in the
engine, when commit/rollback fails in a begin()
context manager, the connection is explicitly closed,
and when "initialize()" fails on the first new connection
of a dialect, the transactional state on that connection
is still rolled back.
Fixes: #5826
Fixes: #5827
Change-Id: Ib1d05cb8c7cf84f9a4bfd23df397dc23c9329bfe
|
|
|
|
| |
Change-Id: Ic5bb19ca8be3cb47c95a0d3315d84cb484bac47c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in I4940d184a4dc790782fcddfb9873af3cca844398 we reworked how async
tests run but apparently the async tests in test/ext/asyncio
are reporting success without being run. This patch pushes
pytestplugin further so that it won't instrument any test
or function overall that declares itself async. This removes
the need for the __async_wrap__ flag and also allows us to
use a more strict "run_async_test" function that always
runs the asyncio event loop from the top.
Also start working asyncio into main testing suite.
Change-Id: If7144e951a9db67eb7ea73b377f81c4440d39819
|
|
|
|
| |
Change-Id: I4940d184a4dc790782fcddfb9873af3cca844398
|
|
|
|
|
|
|
|
|
|
| |
Added an alternate resolution scheme to Declarative that will extract the
SQLAlchemy column or mapped property from the "metadata" dictionary of a
dataclasses.Field object. This allows full declarative mappings to be
combined with dataclass fields.
Fixes: #5745
Change-Id: I1165bc025246a4cb9fc099b1b7c46a6b0f799b23
|