summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | fix linter JOIN logic; fix PostgreSQL ARRAY op comparisonMike Bayer2021-08-157-9/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjusted the "from linter" warning feature to accommodate for a chain of joins more than one level deep where the ON clauses don't explicitly match up the targets, such as an expression such as "ON TRUE". This mode of use is intended to cancel the cartesian product warning simply by the fact that there's a JOIN from "a to b", which was not working for the case where the chain of joins had more than one element. this incurs a bit more compiler overhead that comes out in profiling but is not extensive. Added the "is_comparison" flag to the PostgreSQL "overlaps", "contained_by", "contains" operators, so that they work in relevant ORM contexts as well as in conjunction with the "from linter" feature. Fixes: #6886 Change-Id: I078dc3fe6d4f7871ffe4ebac3e71e62f3f213d12
* | | fix black check for correct files and update test_typesMike Bayer2021-08-162-2/+2
|/ / | | | | | | Change-Id: I5e21821ad203a91f9942fd8d29f516ed21824e50
* | clarify with_polymorphic re: rows loadedMike Bayer2021-08-141-6/+48
| | | | | | | | | | Change-Id: Iaec90932b5cb49e16ec95756f8c6129ba305c88d References: #6878
* | Merge "Unify native and non-native valid values for ``Enum``"mike bayer2021-08-133-3/+78
|\ \
| * | Unify native and non-native valid values for ``Enum``Federico Caselli2021-04-103-3/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify behaviour :class:`_schema.Enum` in native and non-native implementations regarding the accepted values for an enum with aliased elements. When :paramref:`_schema.Enum.omit_aliases` is ``False`` all values, alias included, are accepted as valid values. When :paramref:`_schema.Enum.omit_aliases` is ``True`` only non aliased values are accepted as valid values. Fixes: #6146 Change-Id: I6f40789c1ca56e533990882deadcc6a377d4fc40
* | | add all the machine names in uppercaseMike Bayer2021-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | windows seems to be returning the name in uppercase, we might have to revert this whole thing if things continue to not work Change-Id: I365a07e3521f9f43a3d9d5f93da7788a8a052ff0
* | | Merge "limit greenlet dependency to pypi-listed platforms"mike bayer2021-08-117-7/+64
|\ \ \
| * | | limit greenlet dependency to pypi-listed platformsMike Bayer2021-08-117-7/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setup requirements have been modified such ``greenlet`` is a default requirement only for those platforms that are well known for ``greenlet`` to be installable and for which there is already a pre-built binary on pypi; the current list is ``x86_64 aarch64 ppc64le amd64 win32``. For other platforms, greenlet will not install by default, which should enable installation and test suite running of SQLAlchemy 1.4 on platforms that don't support ``greenlet``, excluding any asyncio features. In order to install with the ``greenlet`` dependency included on a machine architecture outside of the above list, the ``[asyncio]`` extra may be included by running ``pip install sqlalchemy[asyncio]`` which will then attempt to install ``greenlet``. Additionally, the test suite has been repaired so that tests can complete fully when greenlet is not installed, with appropriate skips for asyncio-related tests. Fixes: #6136 Change-Id: I8f3a1c00a4a8b6a273484af1da1f7aaadf588ae7
* | | | Merge "cx_oracle patches"mike bayer2021-08-111-18/+99
|\ \ \ \
| * | | | cx_oracle patchesMike Bayer2021-07-291-18/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | provided by cx_oracle developers Change-Id: Ie30b0993d0da2ee1359042816d77d08f762c6b13
* | | | | Fix example with deprecated codeJoão Sampaio2021-08-111-2/+2
| | | | | | | | | | | | | | | Just a few lines above, it is said that creating a mapping with `mapper()` is deprecated in favor of `mapper_registry.map_imperatively()`. This PR fixes an example in the documentation that still uses the old function.
* | | | | Merge "create concise + deterministic cache key for unboundload.options"mike bayer2021-08-103-14/+128
|\ \ \ \ \
| * | | | | create concise + deterministic cache key for unboundload.optionsMike Bayer2021-08-093-14/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue in loader strategies where the use of the :meth:`_orm.Load.options` method, particularly when nesting multiple calls, would generate an overly long and more importantly non-deterministic cache key, leading to very large cache keys which were also not allowing efficient cache usage, both in terms of total memory used as well as number of entries used in the cache itself. Fixes: #6869 Change-Id: I42bd3564d55a5fb95a21d0e7eef30d50c1274da0
* | | | | | Merge "add columns_clause_froms and related use cases"mike bayer2021-08-098-14/+350
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | add columns_clause_froms and related use casesMike Bayer2021-08-078-14/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new attribute :attr:`_sql.Select.columns_clause_froms` that will retrieve the FROM list implied by the columns clause of the :class:`_sql.Select` statement. This differs from the old :attr:`_sql.Select.froms` collection in that it does not perform any ORM compilation steps, which necessarily deannotate the FROM elements and do things like compute joinedloads etc., which makes it not an appropriate candidate for the :meth:`_sql.Select.select_from` method. Additionally adds a new parameter :paramref:`_sql.Select.with_only_columns.maintain_column_froms` that transfers this collection to :meth:`_sql.Select.select_from` before replacing the columns collection. In addition, the :attr:`_sql.Select.froms` is renamed to :meth:`_sql.Select.get_final_froms`, to stress that this collection is not a simple accessor and is instead calculated given the full state of the object, which can be an expensive call when used in an ORM context. Additionally fixes a regression involving the :func:`_orm.with_only_columns` function to support applying criteria to column elements that were replaced with either :meth:`_sql.Select.with_only_columns` or :meth:`_orm.Query.with_entities` , which had broken as part of :ticket:`6503` released in 1.4.19. Fixes: #6808 Change-Id: Ib5d66cce488bbaca06dab4f68fb5cdaa73e8823e
* | | | | | Merge "Dispatch independent ctes on compound select"mike bayer2021-08-083-0/+46
|\ \ \ \ \ \
| * | | | | | Dispatch independent ctes on compound selectEric Masseran2021-08-083-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix issue in :class:`_sql.CTE` where new :meth:`_sql.HasCTE.add_cte` method added in version 1.4.21 / :ticket:`6752` failed to function correctly for "compound select" structures such as :func:`_sql.union`, :func:`_sql.union_all`, :func:`_sql.except`, etc. Pull request courtesy Eric Masseran. Fixes: #6752 Closes: #6849 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6849 Pull-request-sha: 1c4b4d72b2789cf89ff5043ca964ebdd6c9a6617 Change-Id: I49a16a4fc2af8299502011f3a02d8a2ad93255e3
* | | | | | | Merge "dont qualify literal_binds with literal_execute"mike bayer2021-08-075-1/+69
|\ \ \ \ \ \ \
| * | | | | | | dont qualify literal_binds with literal_executeMike Bayer2021-08-075-1/+69
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this appears to be unnecessary and prevents end-user literal_binds case from working. Fixed issue where the ``literal_binds`` compiler flag, as used externally to render bound parameters inline, would fail to work when used with a certain class of parameters known as "literal_execute", which covers things like LIMIT and OFFSET values for dialects where the drivers don't allow a bound parameter, such as SQL Server's "TOP" clause. The issue locally seemed to affect only the MSSQL dialect. Fixes: #6863 Change-Id: Ia74cff5b0107b129a11b9b965883552b2962e449
* | | | | | | Merge "Refactor mypy plugin"mike bayer2021-08-078-313/+452
|\ \ \ \ \ \ \
| * | | | | | | Refactor mypy pluginBryan Forbes2021-08-078-313/+452
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A major refactor of the mypy plugin Closes: #6764 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6764 Pull-request-sha: 3e2295b2da7b57a6669f26db0df78f6409934184 Change-Id: I067d56dcfbc998ddd1b22a448f756859428b9e31
* | | | | | | | Merge "Modernize tests - dml_values"mike bayer2021-08-079-65/+84
|\ \ \ \ \ \ \ \
| * | | | | | | | Modernize tests - dml_valuesGord Thompson2021-07-269-65/+84
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | Change-Id: Ida86ed40c43d91813151621b847376976773a5f9
* | | | | | | | Merge "Add count example to 2.0 migration table"mike bayer2021-08-072-4/+16
|\ \ \ \ \ \ \ \
| * | | | | | | | Add count example to 2.0 migration tableFederico Caselli2021-07-242-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also update some further load_only(str) left in the docs Fixes: #6794 Change-Id: If3f0ef82a4cdcc8adceef55ab1b1a6a99f4f2a08
* | | | | | | | | Merge "Modernize tests - remaining core SQL"mike bayer2021-08-071-8/+0
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | Modernize tests - remaining core SQLGord Thompson2021-07-231-8/+0
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I7d8c1f451c32dea28173b2206e66db1d0927fccf
* | | | | | | | | Merge "accommodate for untracked boundparam lambda in offline_string"mike bayer2021-08-074-9/+53
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | accommodate for untracked boundparam lambda in offline_stringMike Bayer2021-08-054-9/+53
| | |_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed an issue in the ``CacheKey.to_offline_string()`` method used by the dogpile.caching example where attempting to create a proper cache key from the special "lambda" query generated by the lazy loader would fail to include the parameter values, leading to an incorrect cache key. Fixes: #6858 Change-Id: Ice27087583c6f3ff79cf7d5b879e5dd0a4e58158
* | | | | | | | | Merge "Provide default for implicitly_named_constraints"mike bayer2021-08-071-0/+6
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | |
| * | | | | | | | Provide default for implicitly_named_constraintsGord Thompson2021-08-031-0/+6
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | … so third-party dialect testing won't fail with: "AttributeError: 'Requirements' object has no attribute 'implicitly_named_constraints'" Change-Id: Iafa3e36f3dd169c338dd6eaee21c73aa35e854cc
* | | | | | | | update local_session_caching.py example for 1.4Mike Bayer2021-08-051-3/+7
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #6858 Change-Id: I9b4113243f9ef32f27dcd1f7e9751923283eba2d
* | | | | | | Merge "accommodate for cloned bindparams w/ maintain_key"mike bayer2021-07-294-2/+48
|\ \ \ \ \ \ \
| * | | | | | | accommodate for cloned bindparams w/ maintain_keyMike Bayer2021-07-294-2/+48
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where a bound parameter object that was "cloned" would cause a name conflict in the compiler, if more than one clone of this parameter were used at the same time in a single statement. This could occur in particular with things like ORM single table inheritance queries that indicated the same "discriminator" value multiple times in one query. Fixes: #6824 Change-Id: Iba7a786fc5a2341ff7d07fc666d24ed790ad4fe8
* | | | | | | Merge "Fix type"mike bayer2021-07-291-1/+2
|\ \ \ \ \ \ \
| * | | | | | | Fix typeKazantcev Andrey2021-07-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/sqlalchemy/sqlalchemy2-stubs/pull/132#issuecomment-883159494 Closes: #6789 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6789 Pull-request-sha: 36e9075a8ee0ff699deea8ceef6e72ed4bc1d854 Change-Id: I87fe210b5d69c1e2500fb8e1440592ff44ceaacf
* | | | | | | | Merge "Support generics in code to allow Column[int] etc"mike bayer2021-07-296-1/+28
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ |/| | | | | | |
| * | | | | | | Support generics in code to allow Column[int] etcFederico Caselli2021-07-276-1/+28
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #6804 Fixes: #6759 Change-Id: Ie7f32c38a22dbfa059b5709b883ff464b16031ae
* | | | | | | accommodate plain core textual statementsMike Bayer2021-07-273-4/+44
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the horizontal sharding extension would not correctly accommodate for a plain textual SQL statement passed to :meth:`_orm.Session.execute`. Fixes: #6816 Change-Id: Ie2b71b06d10793443dbd5e1b271c56cbf9431bb3
* | | | | | Modernize tests - dml_whereclauseGord Thompson2021-07-2612-44/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the unit of work would internally use a 2.0-deprecated SQL expression form, emitting a deprecation warning when SQLALCHEMY_WARN_20 were enabled. Fixes: #6812 Change-Id: I0a031e728527a1c3382848b6ddc793939362b128
* | | | | | New issue templates formsFederico Caselli2021-07-264-80/+115
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Noting fancy. we could add checkbox and/or dropdowns if needed **To test**: to go my fork. Link https://github.com/CaselIT/sqlalchemy/issues/new/choose See docs at https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema Closes: #6809 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6809 Pull-request-sha: 21beb5a44104ced9e43bb5342a4cdf5f5efcb02a Change-Id: I74c671aa2790b9f08c20b0659625c8a91b5b9c72
* | | | | Add mypy tests on github.Federico Caselli2021-07-224-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support skipping mypy tests based on interpreter version Change-Id: I98963318dbb2e7e097ad5518e0e4022349ca9779
* | | | | Version 1.4.23 placeholderMike Bayer2021-07-212-1/+5
| | | | |
* | | | | - 1.4.22rel_1_4_22Mike Bayer2021-07-219-77/+84
| |_|/ / |/| | |
* | | | Apply new uniquing rules for future ORM selectsMike Bayer2021-07-216-18/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where usage of the :meth:`_result.Result.unique` method with an ORM result that included column expressions with unhashable types, such as ``JSON`` or ``ARRAY`` using non-tuples would silently fall back to using the ``id()`` function, rather than raising an error. This now raises an error when the :meth:`_result.Result.unique` method is used in a 2.0 style ORM query. Additionally, hashability is assumed to be True for result values of unknown type, such as often happens when using SQL functions of unknown return type; if values are truly not hashable then the ``hash()`` itself will raise. For legacy ORM queries, since the legacy :class:`_orm.Query` object uniquifies in all cases, the old rules remain in place, which is to use ``id()`` for result values of unknown type as this legacy uniquing is mostly for the purpose of uniquing ORM entities and not column values. Fixes: #6769 Change-Id: I5747f706f1e97c78867b5cf28c73360497273808
* | | | Merge "Modernize tests - legacy_select"mike bayer2021-07-2117-147/+210
|\ \ \ \
| * | | | Modernize tests - legacy_selectGord Thompson2021-07-2117-147/+210
| |/ / / | | | | | | | | | | | | Change-Id: I04057cc3d3f93de60b02999803e2ba6a23cdf68d
* | | | Merge "dont warn for dictionary passed positionally"mike bayer2021-07-2112-51/+101
|\ \ \ \
| * | | | dont warn for dictionary passed positionallyMike Bayer2021-07-2112-51/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where use of the :paramref:`_sql.case.whens` parameter passing a dictionary positionally and not as a keyword argument would emit a 2.0 deprecation warning, referring to the deprecation of passing a list positionally. The dictionary format of "whens", passed positionally, is still supported and was accidentally marked as deprecated. Removes warning filter for case statement. Fixes: #6786 Change-Id: I8efd1882563773bec89ae5e34f0dfede77fc4683
* | | | | implement cache key for return_defaults tokenMike Bayer2021-07-215-6/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed critical caching issue where the ORM's persistence feature using INSERT..RETURNING would cache an incorrect query when mixing the "bulk save" and standard "flush" forms of INSERT. Fixes: #6793 Change-Id: Ifeb61c1226d3fa6d5e1c2e29b6f5ff77a27d6a2d