summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* add --notimingintensive; block from github jobstiming_intensiveMike Bayer2020-10-065-19/+20
| | | | | | | | | | | | | | | | | | this provides a front-end option to disable tests marked as timing_intensive, all of which are in test_pool, which are more fragile and aren't consistent on the github runners. also remove /reduce unnecessary time.sleep() from two other pool tests that are not timing intensive. note that this removes test_hanging_connect_within_overflow from the github runs via the timing_intensive requirement. I've also removed MockReconnectTest from exclusions as those are really important tests and they use mocks so should not have platform dependent issues. Need to see what the windows failures are. Change-Id: Icb3d284a2a952e2495d80fa91e22e0b32a54340f
* Merge "Fetch first support"mike bayer2020-10-0516-144/+1021
|\
| * Fetch first supportFederico Caselli2020-10-0216-144/+1021
| | | | | | | | | | | | | | | | | | Add support to ``FETCH {FIRST | NEXT} [ count ] {ROW | ROWS} {ONLY | WITH TIES}`` in the select for the supported backends, currently PostgreSQL, Oracle and MSSQL. Fixes: #5576 Change-Id: Ibb5871a457c0555f82b37e354e7787d15575f1f7
* | Merge "Improve some documentations"mike bayer2020-10-055-40/+41
|\ \
| * | Improve some documentationsFederico Caselli2020-09-295-40/+41
| | | | | | | | | | | | Change-Id: Ibcb0da3166b94aa58fa92d544c3e5cf75844546e
* | | Enable pypy tests on github workflowFederico Caselli2020-10-0210-5/+24
| |/ |/| | | | | | | Fixes: #5223 Change-Id: I0952e54ed9af2952ea340be1945311376ffc1ad2
* | Merge "use execute_20 to preserve compiled cache"mike bayer2020-10-022-46/+86
|\ \
| * | use execute_20 to preserve compiled cacheMike Bayer2020-10-022-46/+86
| | | | | | | | | | | | | | | Fixes: #5420 Change-Id: I3e5a255207da752b7b7cc9b8f41ad5e2ccd0b447
* | | accommodate for null in sqlite regex handlerMike Bayer2020-10-022-1/+3
|/ / | | | | | | | | Fixes: #5624 Change-Id: Ic20dcde0a1e96b9981c63cac3cd34c7fdc7bd395
* | Merge "raise on lower-case column shared to multiple tables"mike bayer2020-09-303-1/+30
|\ \
| * | raise on lower-case column shared to multiple tablesMike Bayer2020-09-303-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where an error was not raised for lower-case :func:`_column` added to lower-case :func:`_table` object. This now raises :class:`_exc.ArgumentError` which has always been the case for upper-case :class:`_schema.Column` and :class:`_schema.Table`. Fixes: #5618 Change-Id: Ifcbdf27c022fd2996a5b99559df71fc1c1e0f19c
* | | fix too-short underlineMike Bayer2020-09-301-1/+2
|/ / | | | | | | Change-Id: Id9ac0b45f0859199e7db61ef5d4fac956b74b2ba
* | Merge "Support for multiple hosts in PostgreSQL connection string"mike bayer2020-09-303-0/+57
|\ \
| * | Support for multiple hosts in PostgreSQL connection stringRamonWill2020-09-233-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide support for multiple hosts in the PostgreSQL connection string. A user requested for SQLAlchemy to support multiple hosts within a PostgreSQL URL string. The proposed fix allows this. In the event that the url contains multiple hosts the proposed code will convert the query["hosts"] tuple into a single string. This allows the hosts to then get converted into a valid dsn variable in the psycopg2 connect function. 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!** Fixes: #4392 Closes: #5554 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5554 Pull-request-sha: 3f7a0ab8df9f1411a9f1ac0e152583bc7bf0c365 Change-Id: I3f3768d51b8331de786ffdc025b7ecfc662eafe5
* | | Scan for tables without relying upon whereclauseMike Bayer2020-09-295-26/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where an UPDATE statement against a JOIN using MySQL multi-table format would fail to include the table prefix for the target table if the statement had no WHERE clause, as only the WHERE clause were scanned to detect a "multi table update" at that particular point. The target is now also scanned if it's a JOIN to get the leftmost table as the primary table and the additional entries as additional FROM entries. Fixes: #5617 Change-Id: I26d74afebe06e28af28acf960258f170a1627823
* | | bump variance on test_string, test_unicodeMike Bayer2020-09-291-2/+2
| |/ |/| | | | | | | | | | | | | a recent rerun of profiles added more profiling data that's failing over small differences. 15% variance is fine for these tests that are looking for thousands of encode calls. Change-Id: I33dac346b2ff07f86b4bc278a7309ca9b7efbaab
* | Add reflection for Identity columnsFederico Caselli2020-09-2821-121/+683
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for reflecting "identity" columns, which are now returned as part of the structure returned by :meth:`_reflection.Inspector.get_columns`. When reflecting full :class:`_schema.Table` objects, identity columns will be represented using the :class:`_schema.Identity` construct. Fixed compilation error on oracle for sequence and identity column ``nominvalue`` and ``nomaxvalue`` options that require no space in them. Improved test compatibility with oracle 18. As part of the support for reflecting :class:`_schema.Identity` objects, the method :meth:`_reflection.Inspector.get_columns` no longer returns ``mssql_identity_start`` and ``mssql_identity_increment`` as part of the ``dialect_options``. Use the information in the ``identity`` key instead. The mssql dialect will assume that at least MSSQL 2005 is used. There is no hard exception raised if a previous version is detected, but operations may fail for older versions. Fixes: #5527 Fixes: #5324 Change-Id: If039fe637c46b424499e6bac54a2cbc0dc54cb57
* | upgrade to black 20.8b1Mike Bayer2020-09-28169-738/+1386
| | | | | | | | | | | | | | It's better, the majority of these changes look more readable to me. also found some docstrings that had formatting / quoting issues. Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
* | Add deprecation warning for .join().alias()Gord Thompson2020-09-2813-127/+166
| | | | | | | | | | | | | | | | | | The :meth:`_sql.Join.alias` method is deprecated and will be removed in SQLAlchemy 2.0. An explicit select + subquery, or aliasing of the inner tables, should be used instead. Fixes: #5010 Change-Id: Ic913afc31f0d70b0605f9a7af2742a0de1f9ad19
* | Merge "build the full compilestate every time"mike bayer2020-09-283-220/+421
|\ \
| * | build the full compilestate every timeMike Bayer2020-09-273-220/+421
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the ORMSelectCompileState was trying to get away with not building out the "froms" list of the state, but we need this for select.froms. Build this out and add some tests for select(), including some other state-oriented use cases. Fixes: #5614 Change-Id: I29ca200f292cbae87c722bc97a89d7c453d7d27a
* | | Merge "dont use uninstrument event to dispose registry entry"mike bayer2020-09-285-9/+14
|\ \ \
| * | | dont use uninstrument event to dispose registry entryMike Bayer2020-09-275-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | since 450f5c0d6519a439f4025c3892fe4c we've been seeing errors during the uninstrument_class event where first we saw an internal weakref being collected earlier than seen, then fixing that we saw the listener collection changing during iteration for similar reasons. we would assume the issue is because of the interaction between mapper / instrumentation/ registry during a test teardown and the usage of the uninstrument_class event within this interaction. this interaction is too fundamental to be relying upon this event in any case and when I wrote this new code i was planning on changing that part in any case, I just forgot. Change-Id: I15744e01bb4d3349bfd529593ebd23eae658eaab
* | | | set pytest rootdirMike Bayer2020-09-271-2/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | With pytest 6.1.0 the root directory calculation logic has changed and is unreliable on our jenkins setup. make sure this is set explicitly. Change-Id: I1d48b887030c32d2f3361fc36e65e8a988d2ba81 References: https://github.com/pytest-dev/pytest/issues/7807
* | | Merge "Accommodate for same base class multiple times in inherits list"mike bayer2020-09-283-1/+34
|\ \ \
| * | | Accommodate for same base class multiple times in inherits listMike Bayer2020-09-273-1/+34
| |/ / | | | | | | | | | | | | | | | | | | | | | Improved declarative inheritance scanning to not get tripped up when the same base class appears multiple times in the base inheritance list. Fixes: #4699 Change-Id: I932e735cd2e2c1efa935936c84219924225d10f1
* | | Repair erroneous "future" symbolMike Bayer2020-09-272-8/+3
|/ / | | | | | | | | | | | | | | | | | | | | the change in 1e800285508ecd869c6874fed failed to fully remove the "future" symbol which then got confused against the import of the "future" package itself, which is also not needed. remove it entirely. pin pytest < 6.1 to see if new error condition may be avoided Change-Id: Ibe45040120d3772c39faef4a61ed26f90b60c79e
* | Support pytest 6.xMike Bayer2020-09-261-7/+4
| | | | | | | | | | | | | | pytest has removed support for pytest.Class().collect() and we need to use from_parent. Change-Id: Ia5fed9b22e76c99f71489283acee207f996f52a4
* | formatting fixes, some content additionMike Bayer2020-09-251-15/+29
| | | | | | | | Change-Id: I807f9763252cdb18ba8702cf42fdb2a7d4c72b52
* | Merge "new docs WIP"mike bayer2020-09-2522-1070/+1854
|\ \
| * | new docs WIPMike Bayer2020-09-2422-1070/+1854
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This WIP is part of the final push for 1.4's docs to fully "2.0-ize" what we can, and have it all ready. So far this includes a rewrite of the 2.0 migration, set up for the 1.4 /2.0 docs style, and a total redesign of the index page using a new flex layout in zzzeeksphinx. It also reworks some of the API reference sections to have more subheaders. zzzeeksphinx is also enhanced to provide automatic summaries for all api doc section. Change-Id: I01d360cb9c8749520246b96ee6496143c6037918
* | Merge "Improve Asyncpg json handling"mike bayer2020-09-242-24/+146
|\ \
| * | Improve Asyncpg json handlingFederico Caselli2020-09-232-24/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set default type codec for ``json`` and ``jsonb`` types when using the asyncpg driver. By default asyncpg will not decode them and return strings instead. Fixes: #5584 Change-Id: I41348eff8096ccf87b952d7e797c0694c6c4b5c4
* | | Add pypi shieldsMike Bayer2020-09-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | These are all available from the same shields.io source, courtesy @dolfinus Fixes: #5594 Change-Id: I985c415f50627d328384a8fddf9a1457663ee00d
* | | try out the github stale hook.Mike Bayer2020-09-231-0/+24
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This will mark an issue with the "stale" label after 5 days and close after 7. The goal is that it will mark "question" issues as stale automatically. it doesn't give us a way to link it to that label however, and we have to define it in terms of labels to exclude. Change-Id: I7c34f4e8fdf4ee0a15baa93b5831e5cdcf72dcc8
* | Merge "Deprecate negative slice indexes"mike bayer2020-09-228-36/+198
|\ \
| * | Deprecate negative slice indexesMike Bayer2020-09-228-36/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "slice index" feature used by :class:`_orm.Query` as well as by the dynamic relationship loader will no longer accept negative indexes in SQLAlchemy 2.0. These operations do not work efficiently and load the entire collection in, which is both surprising and undesirable. These will warn in 1.4 unless the :paramref:`_orm.Session.future` flag is set in which case they will raise IndexError. Fixes: #5606 Change-Id: I5f5dcf984a8f41ab3d0e233ef7553e77fd99a771
* | | Merge "Tweak docker config for mssql"mike bayer2020-09-221-2/+1
|\ \ \
| * | | Tweak docker config for mssqlGord Thompson2020-09-201-2/+1
| | |/ | |/| | | | | | | Change-Id: Iae6fca41976f9cd7a3870f18eadfbea146d572dd
* | | Expect collected weak reference in ORM listenerMike Bayer2020-09-221-0/+3
| |/ |/| | | | | | | | | | | | | | | CI is showing that this listener may be triggered when the target, a mapped class, has been garbage collected. I'm not able to reproduce this locally. Change-Id: Iad96c088a9a3dc28c4bcd716e293c03d3b312efd
* | Merge "restore slice methods to dynamic query"mike bayer2020-09-222-1/+23
|\ \
| * | restore slice methods to dynamic queryMike Bayer2020-09-212-1/+23
| |/ | | | | | | | | | | | | in f0f08db5715e41cc08e57dbc76a85300b these got lost, put them back and test Change-Id: Id1962e1f5d6160fe222becec5a8e32ec6a40017a
* | Raise if unique() not applied to 2.0 joined eager load resultsMike Bayer2020-09-219-31/+213
|/ | | | | | | | | | | | | | | | | | | | | | The automatic uniquing of rows on the client side is turned off for the new :term:`2.0 style` of ORM querying. This improves both clarity and performance. However, uniquing of rows on the client side is generally necessary when using joined eager loading for collections, as there will be duplicates of the primary entity for each element in the collection because a join was used. This uniquing must now be manually enabled and can be achieved using the new :meth:`_engine.Result.unique` modifier. To avoid silent failure, the ORM explicitly requires the method be called when the result of an ORM query in 2.0 style makes use of joined load collections. The newer :func:`_orm.selectinload` strategy is likely preferable for eager loading of collections in any case. This changeset also fixes an issue where ORM-style "single entity" results would not apply unique() correctly if results were returned as tuples. Fixes: #4395 Change-Id: Ie62e0cb68ef2a6d2120e968b79575a70d057212e
* Merge "Stringify correctly for non-str exception argument"mike bayer2020-09-203-5/+36
|\
| * Stringify correctly for non-str exception argumentAndrzej Bartosiński2020-09-203-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where a non-string object sent to :class:`_exc.SQLAlchemyError` or a subclass, as occurs with some third party dialects, would fail to stringify correctly. Pull request courtesy Andrzej Bartosiński. Fixes: #5599 Closes: #5600 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5600 Pull-request-sha: cdccccc42a6ac8de771593a43ee8675bfd8dbeb6 Change-Id: Icd710d9015abc80f61a84893d75fbb33ee0fe46e
* | Fix has_table() for mssql temporary tablesGord Thompson2020-09-193-14/+49
|/ | | | | | | | | Fixes: #5597 Fixes the issue where :meth:`_reflection.has_table` always returns ``False`` for temporary tables. Change-Id: I03ab04c849a157ce8fd28c07ec3bf4407b0f2c94
* Merge "Complete deprecation of from_self()"mike bayer2020-09-1918-541/+1962
|\
| * Complete deprecation of from_self()Mike Bayer2020-09-1818-541/+1962
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For most from_self() tests, move them into test/orm/test_deprecated.py and replace the existing test with one that uses aliased() plus a subquery. This then revealed a few more issues. Related items: * Added slice() method to GenerativeSelect, to match that of orm.Query and to make possible migration of one of the from_self() tests. moved the utility functions used for this from orm/util into sql/util. * repairs a caching issue related to subqueryload where information being derived from the cached path info was mixing up with query information based on the per-query state, specifically an AliasedClass that is per query. * for the above issue, it seemed like path_registry maybe had to change so that it represents AliasedClass objects as their cache key rather than on identity, but it wasn't needed. still seems like it would be more correct. * enhances the error message raised by coercions for a case such as when an AliasedClass holds onto a select() object and not a subquery(); will name the original and resolved object for clarity (although how is AliasedClass able to accept a Select() object in the first place?) * Added _set_propagate_attrs() to Query so that again if it's passed to AliasedClass, it doesn't raise an error during coercion, but again maybe that should also be rejected up front Fixes: #5368 Change-Id: I5912aa611d899acc87a75eb5ee9f95990592f210
* | Add support for Azure authentication optionsGord Thompson2020-09-174-3/+38
|/ | | | | Fixes: #5592 Change-Id: I0688e5ea0fc6b01a0b72f397daea8f57a2ec0766
* Merge "Create a framework to allow all SQLALCHEMY_WARN_20 to pass"mike bayer2020-09-1646-1102/+1484
|\