summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Improve v2 documentationFederico Caselli2022-12-143-12/+161
| |/ / / | | | | | | | | | | | | | | | | Fixes: #7659 Change-Id: Ic9b758c7eed568f33dd0a745031f96de7666baf1
* | | | Fix equality comparison between a PG Range and a different class instanceLele Gaifax2022-12-153-4/+18
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issue #8984, making the method `Range.__eq__` return `NotImplemented` when the argument is an instance of a different class. Closes: #8985 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8985 Pull-request-sha: b8f601f038a2203af02a99ab190ebbc1c489549a Change-Id: Iaf0b651a22a9f346c8f18b3a53e3339bf61bb33f
* | | Merge "warn when backref will replace existing userland descriptor" into mainmike bayer2022-12-145-3/+149
|\ \ \
| * | | warn when backref will replace existing userland descriptorMike Bayer2022-12-145-3/+149
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | A warning is emitted if a backref name used in :func:`_orm.relationship` names an attribute on the target class which already has a method or attribute assigned to that name, as the backref declaration will replace that attribute. Fixes: #4629 Change-Id: I0059b35ce60f43b0f3d8be008f12411154484ea1
* | | Merge "catch all BaseException in pool and revert failed checkouts" into mainmike bayer2022-12-143-17/+94
|\ \ \ | |/ / |/| |
| * | catch all BaseException in pool and revert failed checkoutsMike Bayer2022-12-133-17/+94
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a long-standing race condition in the connection pool which could occur under eventlet/gevent monkeypatching schemes in conjunction with the use of eventlet/gevent ``Timeout`` conditions, where a connection pool checkout that's interrupted due to the timeout would fail to clean up the failed state, causing the underlying connection record and sometimes the database connection itself to "leak", leaving the pool in an invalid state with unreachable entries. This issue was first identified and fixed in SQLAlchemy 1.2 for :ticket:`4225`, however the failure modes detected in that fix failed to accommodate for ``BaseException``, rather than ``Exception``, which prevented eventlet/gevent ``Timeout`` from being caught. In addition, a block within initial pool connect has also been identified and hardened with a ``BaseException`` -> "clean failed connect" block to accommodate for the same condition in this location. Big thanks to Github user @niklaus for their tenacious efforts in identifying and describing this intricate issue. Fixes: #8974 Change-Id: I95a0e1f080d0cee6f1a66977432a586fdf87f686
* | check index_list pragma for number of columns returnedMike Bayer2022-12-134-1/+36
|/ | | | | | | | | | | Fixed regression caused by new support for reflection of partial indexes on SQLite added in 1.4.45 for :ticket:`8804`, where the ``index_list`` pragma command in very old versions of SQLite (possibly prior to 3.8.9) does not return the current expected number of columns, leading to exceptions raised when reflecting tables and indexes. Fixes: #8969 Change-Id: If317cdcfc6782f7e180df329b6ea0ddb48ce2269
* Type annotations for sqlalchemy.ext.horizontal_shardGleb Kisenkov2022-12-114-53/+210
| | | | | | | | | | | The horizontal sharding extension is now pep-484 typed. Thanks to Gleb Kisenkov for their efforts on this. Closes: #8948 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8948 Pull-request-sha: e40e768492685aa9ce57c4762c571f935e3fd3c7 Change-Id: I2374e174c9433846c453c20a37ec5e5584fd3b31
* add color directivesMike Bayer2022-12-111-6/+9
| | | | | | See https://tox.wiki/en/latest/faq.html#tox-4-known-regressions Change-Id: I3c7291a660dc167bce3151e02cd123edc4707ca1
* adjust for tox changes to passenvMike Bayer2022-12-112-1/+22
| | | | | | | | | Fixed issue in tox.ini file where changes in the tox 4.0 series to the format of "passenv" caused tox to not function correctly, in particular raising an error as of tox 4.0.6. Change-Id: I659c8fc523a71deaa02a89103c9e7241cf81d831 References: https://github.com/tox-dev/tox/issues/2676
* cherry-pick changelog update for 1.4.46Mike Bayer2022-12-101-0/+4
|
* cherry-pick changelog from 1.4.45Mike Bayer2022-12-1013-128/+133
|
* look out for extras=None in freezeMike Bayer2022-12-093-1/+55
| | | | | | | | | Fixed issue where :meth:`_engine.Result.freeze` method would not work for textual SQL using either :func:`_sql.text` or :meth:`_engine.Connection.exec_driver_sql`. Fixes: #8963 Change-Id: Ia131c6ac41a4adf32eb1bf1abf23930ef395f16c
* fix typoMike Bayer2022-12-091-1/+1
| | | | Change-Id: I09d1d1c9505c1cad8ed21b675a105b0dbbb02e00
* Merge "Better syncronize async result docs with plain ones." into mainmike bayer2022-12-097-284/+272
|\
| * Better syncronize async result docs with plain ones.Federico Caselli2022-12-097-284/+272
| | | | | | | | | | | | | | | | | | | | Removed non-functional method ``merge`` from :class:`_asyncio.AsyncResult`. This method was non-functional and non-testes since the first introduction of asyncio in SQLAlchemy. Fixes: #7158 Fixes: #8952 Change-Id: Ibc3d17be8a8b7cab9bf2074f0408f74b4c4b161d
* | Specify view columns in HasTableTestGord Thompson2022-12-091-4/+7
|/ | | | | | | | | Fixes: #8960 Avoid test errors on databases that do not support CREATE VIEW vv AS SELECT * FROM Change-Id: Ic9e892aa4466030b9b325c11228dad15cf59a258
* fix construct_params() for render_postcompile; add new APIMike Bayer2022-12-085-83/+576
| | | | | | | | | | | | | | | | | | | | | The :meth:`.SQLCompiler.construct_params` method, as well as the :attr:`.SQLCompiler.params` accessor, will now return the exact parameters that correspond to a compiled statement that used the ``render_postcompile`` parameter to compile. Previously, the method returned a parameter structure that by itself didn't correspond to either the original parameters or the expanded ones. Passing a new dictionary of parameters to :meth:`.SQLCompiler.construct_params` for a :class:`.SQLCompiler` that was constructed with ``render_postcompile`` is now disallowed; instead, to make a new SQL string and parameter set for an alternate set of parameters, a new method :meth:`.SQLCompiler.construct_expanded_state` is added which will produce a new expanded form for the given parameter set, using the :class:`.ExpandedState` container which includes a new SQL statement and new parameter dictionary, as well as a positional parameter tuple. Fixes: #6114 Change-Id: I9874905bb90f86799b82b244d57369558b18fd93
* Merge "disable polymorphic adaption in most cases" into mainmike bayer2022-12-089-75/+508
|\
| * disable polymorphic adaption in most casesMike Bayer2022-12-079-75/+508
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improved a fix first made in version 1.4 for :ticket:`8456` which scaled back the usage of internal "polymorphic adapters", that are used to render ORM queries when the :paramref:`_orm.Mapper.with_polymorphic` parameter is used. These adapters, which are very complex and error prone, are now used only in those cases where an explicit user-supplied subquery is used for :paramref:`_orm.Mapper.with_polymorphic`, which includes only the use case of concrete inheritance mappings that use the :func:`_orm.polymorphic_union` helper, as well as the legacy use case of using an aliased subquery for joined inheritance mappings, which is not needed in modern use. For the most common case of joined inheritance mappings that use the built-in polymorphic loading scheme, which includes those which make use of the :paramref:`_orm.Mapper.polymorphic_load` parameter set to ``inline``, polymorphic adapters are now no longer used. This has both a positive performance impact on the construction of queries as well as a substantial simplification of the internal query rendering process. The specific issue targeted was to allow a :func:`_orm.column_property` to refer to joined-inheritance classes within a scalar subquery, which now works as intuitively as is feasible. ORM context, mapper, strategies now use ORMAdapter in all cases instead of straight ColumnAdapter; added some more parameters to ORMAdapter to make this possible. ORMAdapter now includes a "trace" enumeration that identifies the use path for the adapter and can aid in debugging. implement __slots__ for the ExternalTraversal hierarchy up to ORMAdapter. Within this change, we have to change the ClauseAdapter.wrap() method, which is only used in one polymorphic codepath, to use copy.copy() instead of `__dict__` access (apparently `__reduce_ex__` is implemented for objects with `__slots__`), and we also remove pickling ability, which should not be needed for adapters (this might have been needed for 1.3 and earlier in order for Query to be picklable, but none of that state is present within Query / select() / etc. anymore). Fixes: #8168 Change-Id: I3f6593eb02ab5e5964807c53a9fa4894c826d017
* | Oracle COLUMN_VALUE is a column name, not a keywordMike Bayer2022-12-076-14/+58
|/ | | | | | | | | Fixed issue in Oracle compiler where the syntax for :meth:`.FunctionElement.column_valued` was incorrect, rendering the name ``COLUMN_VALUE`` without qualifying the source table correctly. Fixes: #8945 Change-Id: Ia04bbdc68168e78b67a74bb3834a63f5d5000627
* move more Session weakref tests to test_memusageMike Bayer2022-12-072-161/+169
| | | | | | | | py311 may be more sensitive here, or maybe the machines are acting differently these days, in any case move memory / GC sensitive tests to test_memusage. Change-Id: I218295150efc2f7ea88da9960ff10fda63dc60b1
* sort materialize view names in testMike Bayer2022-12-061-1/+1
| | | | | | saw this fail on CI with views in reverse order Change-Id: I953f379f36924673a49b94cf5e7f54d071044113
* take mariadb-connector out of dbapi main jobMike Bayer2022-12-061-1/+2
| | | | | | | | | | | | | | mariadb-connector seems to have their release situation "fixed", but for 1.1.5post3 they are requiring mariadb-connector-c 3.3.1, Fedora 36 which is quite bleeding edge only has 3.2.7. There's no way we can easily have a version specifier that will look at underlying client libraries. since mariadb-connector's main branch seems to work way ahead of where we will normally have client libraries set up, it's not really worth testing in CI right now. Change-Id: Idcb034da6d06620b5e212582bbc63a246a9fe58b
* Version 2.0.0b5 placeholderMike Bayer2022-12-052-1/+5
|
* - 2.0.0b4rel_2_0_0b4Mike Bayer2022-12-0525-297/+320
|
* Merge "Add tests for issue #8168; slight internal adjustments" into mainmike bayer2022-12-054-11/+161
|\
| * Add tests for issue #8168; slight internal adjustmentsMike Bayer2022-12-054-11/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | The issue in #8168 was improved, but not completely fixed, by #8456. This includes some small changes to ORM context that are a prerequisite for getting ORM adaptation to be better. Have these in 2.0.0b4 so that we have at least a better starting point. References: #8168 Change-Id: I51dbe333b156048836d074fbba1d850f9eb67fd2
* | changelog updatesMike Bayer2022-12-0511-40/+55
| | | | | | | | | | | | | | prep for 2.0.0b4 Change-Id: I2bf7249f6ed0c120b9d04d81eaecdf8593729c83 (cherry picked from commit 42876aabb5f893e1922676eb809e6b37c0519ed8)
* | rename some GitHub actions to use test names as prefix, as introduced in ↵Jonathan Vanasco2022-12-052-3/+3
| | | | | | | | | | rel_1_4 (#8933) Change-Id: I7f3aa96447ade605becbdef01bc19f3b78dbd6d1
* | Merge "Add compatibility properties to Range; implement pep-484" into mainmike bayer2022-12-052-82/+182
|\ \ | |/ |/|
| * Add compatibility properties to Range; implement pep-484Lele Gaifax2022-12-052-82/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a bunch of properties to new PG Range class for compatibility with other implementations, providing a more similar API to access emptiness and bounds status. The naming conventions here derive from PostgreSQL itself, see https://www.postgresql.org/docs/9.3/functions-range.html . pep-484 also implemented by Mike, as this is a pretty type-intensive module. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Closes: #8927 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8927 Pull-request-sha: 8b9e7b7e3345673b43aeabd7ec88b88dc3cfa7eb Change-Id: I0b1d49311517ee1cc1377a974ed0a860ea5756e4
* | Merge "Rewrite positional handling, test for "numeric"" into mainmike bayer2022-12-0528-348/+989
|\ \
| * | Rewrite positional handling, test for "numeric"Federico Caselli2022-12-0528-348/+989
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed how the positional compilation is performed. It's rendered by the compiler the same as the pyformat compilation. The string is then processed to replace the placeholders with the correct ones, and to obtain the correct order of the parameters. This vastly simplifies the computation of the order of the parameters, that in case of nested CTE is very hard to compute correctly. Reworked how numeric paramstyle behavers: - added support for repeated parameter, without duplicating them like in normal positional dialects - implement insertmany support. This requires that the dialect supports out of order placehoders, since all parameters that are not part of the VALUES clauses are placed at the beginning of the parameter tuple - support for different identifiers for a numeric parameter. It's for example possible to use postgresql style placeholder $1, $2, etc Added two new dialect based on sqlite to test "numeric" fully using both :1 style and $1 style. Includes a workaround for SQLite's not-really-correct numeric implementation. Changed parmstyle of asyncpg dialect to use numeric, rendering with its native $ identifiers Fixes: #8926 Fixes: #8849 Change-Id: I7c640467d49adfe6d795cc84296fc7403dcad4d6
* | Type annotations for sqlalchemy.ext.automapGleb Kisenkov2022-12-053-62/+244
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An attempt to annotate `lib/sqlalchemy/ext/automap.py` with type hints (issue [#6810](https://github.com/sqlalchemy/sqlalchemy/issues/6810#issuecomment-1127062951)). More info on how I approach it could be found in [the earlier PR](https://github.com/sqlalchemy/sqlalchemy/pull/8775). This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] 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. - [x] 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: #8874 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8874 Pull-request-sha: 834d58d77c2cfd09ea874f01eb7b75a2ea0db7cd Change-Id: Ie64b2be7a51ddc83ef8f23385fb63db5b5c1bc17
* Merge "adjustments for unreliable gc" into mainmike bayer2022-12-055-39/+60
|\
| * adjustments for unreliable gcMike Bayer2022-12-045-39/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sporadic (and at the moment persistent) test failures related to aiosqlite seem to have in common that Python gc stops working fully when we run a lot of tests with aiosqlite. The failures are not limited to aiosqlite as they are more involving places where we assume or expect gc.collect() to get rid of things, and it doesn't. Identify (based on reproducible case on the d3 CI runner) the spots where this happens and add fixes. test/orm/test_transaction.py test_gced_delete_on_rollback has always been a very sensitive test with a lot of issues, so here we move it to the test_memusage suite and limit it only to when the memusage suite is running. Change-Id: I683412d0effe8732c45980b40722e5bb63431177
* | Merge "Fixed an invalid syntax in an except statement" into mainmike bayer2022-12-051-1/+1
|\ \
| * | Fixed an invalid syntax in an except statementwiseaidev2022-12-051-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Description As the title suggests, I have fixed an invalid syntax in the docs for an `except` statement while reading the unusual. ### 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: - [x] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] 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: #8715 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8715 Pull-request-sha: e8be2bc4a5401ab2a5a0fc1d2e50d41fa437ae80 Change-Id: If8512bf1853f7cdb1ae655f0945cd922fff6fbce
* | Merge "Fix grammar (whatsnew_20.rst)" into mainmike bayer2022-12-051-1/+1
|\ \
| * | Fix grammar (whatsnew_20.rst)Sam Bull2022-12-051-1/+1
| |/ | | | | | | | | | | | | | | | | | | None Closes: #8835 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8835 Pull-request-sha: 7488c752d90ce305076ba06b7a4077dc67c0ea66 Change-Id: Iad959dcff21bd1aa593793c4a38cb795529468e8
* | doc change - Add new external dialect for openGaussj003562872022-12-051-0/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> Added new external dialect for [openGauss](https://www.opengauss.org/en/). ### 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: - [x] A documentation / typographical error fix - Good to go, no issue or tests are needed - [ ] 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: #8803 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8803 Pull-request-sha: ca5a7f1310b2ce93ce33618e0609abe23b41a3da Change-Id: Ia8ca38f98f346fa3cc910ceb7af47f8c903eb587
* Merge "disallow same-named columns, unchecked replacement in Table" into mainmike bayer2022-12-0411-73/+419
|\
| * disallow same-named columns, unchecked replacement in TableMike Bayer2022-12-0411-73/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where table reflection using :paramref:`.Table.extend_existing` would fail to deduplicate a same-named column if the existing :class:`.Table` used a separate key. The :paramref:`.Table.autoload_replace` parameter would allow the column to be skipped but under no circumstances should a :class:`.Table` ever have the same-named column twice. Additionally, changed deprecation warnings to exceptions as were implemented in I1d58c8ebe081079cb669e7ead60886ffc1b1a7f5 . Fixes: #8925 Change-Id: I83d0f8658177a7ffbb06e01dbca91377d1a98d49
* | Merge "Order_by and group_by accept labels" into mainmike bayer2022-12-046-12/+62
|\ \
| * | Order_by and group_by accept labelsFederico Caselli2022-12-036-12/+62
| |/ | | | | | | | | | | Improve typing to accept labels in ordey_by mand group_by. Change-Id: I33e5d6f64633d39a220108d412ef84d6478b25e6
* | Some test pipeline updatesFederico Caselli2022-12-031-16/+18
|/ | | | | | Add back pypy, python 3.12 Change-Id: Ie3b3b890d75b3939b3d5f684ec7eadadfe06a5ea
* add spaces, leading underscore to oracle checksMike Bayer2022-12-023-7/+76
| | | | | | | | | | | | Expand the test suite from #8708 which unfortunately did not exercise the bound parameter codepaths completely. Continued fixes for Oracle fix :ticket:`8708` released in 1.4.43 where bound parameter names that start with underscores, which are disallowed by Oracle, were still not being properly escaped in all circumstances. Fixes: #8708 Change-Id: Ic389c09bd7c53b773e5de35f1a18ef20769b92a7
* add backports for 2.0/ 1.4 changesMike Bayer2022-12-0214-9/+41
| | | | Change-Id: I5aab8b25337f67385fc998954ab1fa883c175cc2
* Merge "Fix positional compiling bugs" into mainmike bayer2022-12-0212-97/+572
|\