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/415Fixes: #5246
Change-Id: If63f92553c46484bf2b61b53a9e6d85cb08e800a
(cherry picked from commit 24137da80d)
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
(cherry picked from commit 046934083b)
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
(cherry picked from commit 4cadeaf6e68d71c2cb36219f72cc4d337e31df88)
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
(cherry picked from commit 10fb4d4d2f)
Trying the pr to check if it works right away
<!-- Describe your changes in detail -->
<!-- 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: afbb856752
Change-Id: I4981b02f900e76e446cf42e6cc6495ffc0883951
(cherry picked from commit c658540b9a)
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
(cherry picked from commit 17e31604ae)
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
(cherry picked from commit 978755e851)
Added support for .is[not]_distinct_from to SQL Server, MySQL, and Oracle.
Fixes: #5137
Change-Id: I3b4d3b199821a55687f83c9a5b63a95d07a64cd5
(cherry picked from commit 207e0b2fc0)
Ensure length parameter added to Enum in
Iea05dc8cd9e33959bb968b394fb10a7dd068c873 is correctly propagated
to new enum objects adapted from this one.
Fixes: #5183
`
Change-Id: I7f20d926f73ec8260938963df87e29894c7e55e2
(cherry picked from commit 9243f6feea)
First (baby) step at replacing engine.execute
calls in test code with the new preferred way
of executing. MSSQL was targeted because it was
the easiest for me to test locally.
Change-Id: Id2e02f0e39007cbfd28ca6a535115f53c6407015
(cherry picked from commit 60f627cbd0)
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
(cherry picked from commit 3e2af98adfdcbf33ff5d8c2da15962c001344d64)
Avoid errors for dialects without schema support.
Also fix typo in test name.
Fixes: #5230
Change-Id: Id0f759b591a6119069b0fc5fc3b02addb85b0597
(cherry picked from commit 50f1e1392a)
A memory growth issue was identified in this test which
caused the profiling results to be inaccurate.
Change-Id: I248dcce5833feada947bc91bdf09a8f925d31d65
(cherry picked from commit 139aac4aba)
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
(cherry picked from commit a32c528c54)
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
(cherry picked from commit 379e878c58)
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
(cherry picked from commit f86ee556add28afd4de31c10fce56b00a0014a4e)
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
(cherry picked from commit 83eb1b23cb)
SQLAlchemy can remain using setuptools even when pep-517 is
the standard installation process. We are omitting the file
for now because it leads to new pip installation issues that need
to be worked out in the greater pip community before SQLAlchemy
opts into this system.
Change-Id: I40b196100c6f16ae1291fcb7f8b5196bba14a300
(cherry picked from commit e127072637)
As part of this change Oracle also gets the concept of a
default isolation level, however since Oracle does not provide a
fixed method of knowing what the isolation level would be without a
server side transaction actually in progress, for now we hardcode
just to "READ COMMITTED".
Enhanced the test suite for isolation level testing in the dialect
test suite and added features to requirements so that the supported
isolation levels can be reported generically for dialects.
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #5200
Change-Id: I2c4d49da9ff80ccc228c21e196ec9a961de53478
(cherry picked from commit 1afca5823efe22c0f8cbc01455bafc573254ab55)
Fixed issue where a lazyload that uses session-local "get" against a target
many-to-one relationship where an object with the correct primary key is
present, however it's an instance of a sibling class, does not correctly
return None as is the case when the lazy loader actually emits a load for
that row.
Fixes: #5210
Change-Id: I89f9946cfeba61d89a272435f76a5a082b1da30c
(cherry picked from commit 900402b9aa901bc9b1ae3f6b525f076076c52529)
SQLAlchemy does not want to opt-in to pep-517 at this time
as this would require a custom build backend interface
which we have not built yet, and the standard is not
widely adopted at this time in any case. Per
[1] [2], the presence of this file indicates a positive opt-in
to pep-517, so it must be omitted from source distributions.
[1] https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
[2] https://www.python.org/dev/peps/pep-0517/#id5Fixes: #5207
Change-Id: If8d26a9edf942047920d273d8be778df7a018b3e
(cherry picked from commit f2a817dd7c)
Migrate is fully legacy at this point so continue to mention
it to provide clarity, but ensure it isn't suggested
as a real alternative. It's unclear if Migrate will be able
to support SQLAlchemy 2.0.
Change-Id: Ia81aaccbd18f197ab533b083e87cc4d04ea05839
(cherry picked from commit a25e2e02e1)
Prep the main documentation for the changes coming up in 1.4
by first removing references to engine.execute() outside
of the "connectionless" section, and using context managers
in all cases. For features that have always been confusing
and are going away, add a note that this feature will
be going away.
Change-Id: I94583444734e36f5432c32cb37f88a9fad15634a
(cherry picked from commit 376708f4a4)
Link the connections intro to the dedicated section
on multiprocessing rather than stating that a separate
engine per process is needed, since this is inaccurate
and vague.
Change-Id: I48c66f88a90db918e864cd198c6aed335e28c7e6
(cherry picked from commit 491333858c)
Fixed issue where a "covering" index, e.g. those which have an INCLUDE
clause, would be reflected including all the columns in INCLUDE clause as
regular columns. A warning is now emitted if these additional columns are
detected indicating that they are currently ignored. Note that full
support for "covering" indexes is part of 🎫`4458`. Pull request
courtesy Marat Sharafutdinov.
Fixes: #5205Closes: #5206
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5206
Pull-request-sha: 512a3817bb
Change-Id: I3196a2bf77dc5a6abd85b2fbf0ebff1b30d4fb00
(cherry picked from commit ee9bd719b7)
Added support for reflection of "computed" columns, which are now returned
as part of the structure returned by :meth:`.Inspector.get_columns`.
When reflecting full :class:`.Table` objects, computed columns will
be represented using the :class:`.Computed` construct.
Also improve the documentation in :meth:`Inspector.get_columns`, correctly
listing all the returned keys.
Fixes: #5063Fixes: #4051Closes: #5064
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5064
Pull-request-sha: ba00fc321ce468f8885aad23b3dd33c789e50fbe
Change-Id: I789986554fc8ac7f084270474d0b2c12046b1cc2
(cherry picked from commit 62b7dace0c)
1. ensure provision.py loads dialect implementations when running
reap_dbs.py. Reapers haven't been working since
598f2f7e55 .
2. add some exclusion rules to allow the sqlite_file target to work;
add to tox.
3. add reap dbs target for SQLite, repair SQLite drop_db routine
which also wasn't doing the right thing for memory databases
etc.
4. Fix logging in provision files, as the main provision logger
is the one that's enabled by reap_dbs and maybe others, have all
the provision files use the provision logger.
Fixes: #5180Fixes: #5168
Change-Id: Ibc1b0106394d20f5bcf847f37b09d185f26ac9b5
(cherry picked from commit 08fdf6da228aab54263abe043c21bcebf3513e72)
We need no tests to run for sqlite_file until we merge
a full fix for it. We'd like Jenkins to include this target.
Change-Id: I2737fa462572f08e2925b232a8f24d1ecd26b3ac
(cherry picked from commit 67e51ea5dc)
Fixed regression / incorrect fix caused by fix for 🎫`5146` where the
Oracle dialect reads from the "all_tab_comments" view to get table comments
but fails to accommodate for the current owner of the table being
requested, causing it to read the wrong comment if multiple tables of the
same name exist in multiple schemas.
Fixes: #5146
Change-Id: Id79fbaa81b0e36cd4af60c48e4ab35c593ace057
(cherry picked from commit f1429823d3)
py.test 5.4.0 emits deprecation warnings for pytest.Class.
make sure we don't raise for these, and log the code that will
be used for 5.4.0 when we bump requirements.
Fixes: #5201
Change-Id: I83e0402c4a6b2365a63b58d052c6989df3a37328
(cherry picked from commit be26fd13c124d5d53496cca98ce371c45c07c205)
Fixed regression in 1.3.14 due to 🎫`4849` where a sys.exc_info()
call failed to be invoked correctly when a flush error would occur. Test
coverage has been added for this exception case.
Fixes: #5196
Change-Id: Ib59a58a3a9d4c9c6f4b751201b794816a9f70225
(cherry picked from commit ceba13d4be)
Adjusted the error message emitted by :meth:`.Query.join` when a left hand
side can't be located that the :meth:`.Query.select_from` method is the
best way to resolve the issue. Also, within the 1.3 series, used a
deterministic ordering when determining the FROM clause from a given column
entity passed to :class:`.Query` so that the same expression is determined
each time.
Fixes: #5194
Change-Id: I2e4065fd31e98c57edf2f11d5e831be44d2c1ea2
(cherry picked from commit 7d8c64f908)
Fixed a reflection bug where table comments could only be retrieved for
tables actually owned by the user but not for tables visible to the user
but owned by someone else. Pull request courtesy Dave Hirschfeld.
Fixes: #5146Closes: #5147
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5147
Pull-request-sha: 0651e3bed0
Change-Id: If970fda10d6adf04d926d38df1a567df1de9f7b9
(cherry picked from commit 0c294d356f)