summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | clarify the Uuid datatype handles Python uuid objects by defaultMike Bayer2023-03-311-0/+30
| |/ / |/| | | | | | | | | | | Change-Id: I28147bfb4eb0762e9482d4f38bc1d89355152ad4 References: #9573
* | | Merge "assign correct typing to deferred(), query_property()" into mainmike bayer2023-03-303-5/+26
|\ \ \
| * | | assign correct typing to deferred(), query_property()Mike Bayer2023-03-303-5/+26
| |/ / | | | | | | | | | | | | | | | | | | | | | Fixed typing for :func:`_orm.deferred` and :func:`_orm.query_expression` to work correctly with 2.0 style mappings. Fixes: #9536 Change-Id: Idb88c0a11b7896093234b3cc31595f64b552cba0
* | | Merge "Minor improvements in collections.pyx" into mainmike bayer2023-03-301-8/+12
|\ \ \ | |/ / |/| |
| * | Minor improvements in collections.pyxMatus Valo2023-03-141-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Description This PR introduces minor improvements to collections.pyx: * Adds missed type annotations yielding slightly more optimised code * Adds missed `cpdef` methods used internally * Marks private methods with `@cython.final` Fixes #9477 ### 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: - [ ] 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: #9478 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9478 Pull-request-sha: c006c76c2c50491ea1be9c723c278da16c151397 Change-Id: I74b3df2bc790db49e331b8f8085c797249364b07
* | | Merge "warn for all unmapped expressions" into mainmike bayer2023-03-304-11/+46
|\ \ \
| * | | warn for all unmapped expressionsMike Bayer2023-03-244-11/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expanded the warning emitted when a plain :func:`_sql.column` object is present in a Declarative mapping to include any arbitrary SQL expression that is not declared within an appropriate property type such as :func:`_orm.column_property`, :func:`_orm.deferred`, etc. These attributes are otherwise not mapped at all and remain unchanged within the class dictionary. As it seems likely that such an expression is usually not what's intended, this case now warns for all such otherwise ignored expressions, rather than just the :func:`_sql.column` case. Fixes: #9537 Change-Id: Ic4ca7a071a28adf4ea8680690025d927522a0805
* | | | add mypy issue 13856 to bug reporting templateMike Bayer2023-03-301-0/+15
| |_|/ |/| | | | | | | | | | | Change-Id: Ie25810bfb188794858ba39e246a72b06c484e474 References: #9567
* | | Merge "disable raise sql for the delete cascade" into mainmike bayer2023-03-293-3/+92
|\ \ \
| * | | disable raise sql for the delete cascadeMike Bayer2023-03-283-3/+92
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Towards maintaining consistency with unit-of-work changes made for :ticket:`5984` and :ticket:`8862`, both of which disable "lazy='raise'" handling within :class:`_orm.Session` processes that aren't triggered by attribute access, the :meth:`_orm.Session.delete` method will now also disable "lazy='raise'" handling when it traverses relationship paths in order to process the "delete" and "delete-orphan" cascade rules. Previously, there was no easy way to generically call :meth:`_orm.Session.delete` on an object that had "lazy='raise'" set up such that only the necessary relationships would be loaded. As "lazy='raise'" is primarily intended to catch SQL loading that emits on attribute access, :meth:`_orm.Session.delete` is now made to behave like other :class:`_orm.Session` methods including :meth:`_orm.Session.merge` as well as :meth:`_orm.Session.flush` along with autoflush. Fixes: #9549 Change-Id: Ie049e66ce2bd35900eae4af0e9b795633303ca63
* | | Merge "Improve from_select typing" into mainmike bayer2023-03-283-4/+18
|\ \ \
| * | | Improve from_select typingFederico Caselli2023-03-273-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly type :paramref:`_dml.Insert.from_select.names` to accept a list of string or columns or mapped attributes. Fixes: #9514 Change-Id: I2a3396454e79bd2113fc3d57d1252a2e6d141310
* | | | Merge "check for recursion with container types" into mainmike bayer2023-03-274-8/+148
|\ \ \ \
| * | | | check for recursion with container typesMike Bayer2023-03-274-8/+148
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue in ORM Annotated Declarative where using a recursive type (e.g. using a nested Dict type) would result in a recursion overflow in the ORM's annotation resolution logic, even if this datatype were not necessary to map the column. Fixes: #9553 Change-Id: Ied99dc0d47276c6e9c23fa9df5fc65f7736d65cf
* | | | Merge "support DeclarativeBase for versioned history example" into mainmike bayer2023-03-275-19/+95
|\ \ \ \
| * | | | support DeclarativeBase for versioned history exampleMike Bayer2023-03-275-19/+95
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue in "versioned history" example where using a declarative base that is derived from :class:`_orm.DeclarativeBase` would fail to be mapped. Additionally, repaired the given test suite so that the documented instructions for running the example using Python unittest now work again. Change-Id: I164a5b8dbdd01e3d815eb356f7b7cadf226ca296 References: #9546
* | | | Fix creating zero length char with MySQL dialectJ. Nick Koston2023-03-273-6/+39
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where string datatypes such as :class:`.CHAR`, :class:`.VARCHAR`, :class:`.TEXT`, as well as binary :class:`.BLOB`, could not be produced with an explicit length of zero, which has special meaning for MySQL. Pull request courtesy J. Nick Koston. Fixes: #9544 Closes: #9543 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9543 Pull-request-sha: dc17fc3e93f0ba90881c4efb06016ddf83c7af8b Change-Id: I96925d45f16887f5dfd68a5d4f9284b3abc46d25
* | | docs: 📚 fix duplicate word typo (#9539)Tom Wolfskämpf2023-03-251-1/+1
| | |
* | | Merge "automatically provision hstore for pg13+" into mainmike bayer2023-03-252-13/+17
|\ \ \
| * | | automatically provision hstore for pg13+Federico Caselli2023-03-152-13/+17
| | | | | | | | | | | | | | | | Change-Id: I5cd7e9e9ab8a1dae2bd467a1e4299d7f26183301
* | | | Merge "use clone, not constructor, in ↵mike bayer2023-03-224-6/+85
|\ \ \ \ | | | | | | | | | | | | | | | BindParameter.render_literal_execute()" into main
| * | | | use clone, not constructor, in BindParameter.render_literal_execute()Mike Bayer2023-03-224-6/+85
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the :meth:`_sql.BindParameter.render_literal_execute` method would fail when called on a parameter that also had ORM annotations associated with it. In practice, this would be observed as a failure of SQL compilation when using some combinations of a dialect that uses "FETCH FIRST" such as Oracle along with a :class:`_sql.Select` construct that uses :meth:`_sql.Select.limit`, within some ORM contexts, including if the statement were embedded within a relationship primaryjoin expression. Fixes: #9526 Change-Id: I2f512b6760a90293d274e60b06a891f10b276ecc
* | | | Merge "return None for no parententity on Proxy" into mainmike bayer2023-03-223-2/+69
|\ \ \ \ | |/ / / |/| | |
| * | | return None for no parententity on ProxyMike Bayer2023-03-213-2/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed regression where accessing the expression value of a hybrid property on a class that was either unmapped or not-yet-mapped (such as calling upon it within a :func:`_orm.declared_attr` method) would raise an internal error, as an internal fetch for the parent class' mapper would fail and an instruction for this failure to be ignored were inadvertently removed in 2.0. Fixes: #9519 Change-Id: If195d26a5ddd2312a373004eb7a1403e1d11e7a4
* | | | fix update in nested_sets exampleMike Bayer2023-03-211-1/+3
| | | | | | | | | | | | | | | | | | | | Fixes: #9520 Change-Id: I3dbf62bd9b70fb226cf7c641719df8ac53ec1427
* | | | add tip that reflection is not necessary for an existing databaseMike Bayer2023-03-211-2/+13
|/ / / | | | | | | | | | | | | | | | | | | a new user spent many days misled by this paragraph thinking they were required to use reflection for an existing database. Change-Id: I4c6757b931481db7a8d4202334382143e1491935
* | | dont render VARCHAR length for PG castsMike Bayer2023-03-196-40/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed critical regression in PostgreSQL dialects such as asyncpg which rely upon explicit casts in SQL in order for datatypes to be passed to the driver correctly, where a :class:`.String` datatype would be cast along with the exact column length being compared, leading to implicit truncation when comparing a ``VARCHAR`` of a smaller length to a string of greater length regardless of operator in use (e.g. LIKE, MATCH, etc.). The PostgreSQL dialect now omits the length from ``VARCHAR`` when rendering these casts. Fixes: #9511 Change-Id: If094146d8cfd989a0b780872f38e86fd41ebfec2
* | | cherry-pick changelog update for 1.4.48Mike Bayer2023-03-181-0/+4
| | |
* | | cherry-pick changelog from 1.4.47Mike Bayer2023-03-189-98/+103
| | |
* | | Version 2.0.8 placeholderMike Bayer2023-03-182-1/+5
| | |
* | | - 2.0.7rel_2_0_7Mike Bayer2023-03-185-22/+25
| | |
* | | add forwards portMike Bayer2023-03-181-0/+1
| | | | | | | | | | | | Change-Id: If82a883fef40d3cf4717b927024b0b83a8e47a5d
* | | implement content hashing for custom_op, not identityMike Bayer2023-03-184-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed critical SQL caching issue where use of the :meth:`_sql.Operators.op` custom operator function would not produce an appropriate cache key, leading to reduce the effectiveness of the SQL cache. Fixes: #9506 Change-Id: I3eab1ddb5e09a811ad717161a59df0884cdf70ed
* | | Merge "add explicit overload for composite -> callable" into mainmike bayer2023-03-174-3/+39
|\ \ \
| * | | add explicit overload for composite -> callableMike Bayer2023-03-174-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed typing issue where :func:`_orm.composite` would not allow an arbitrary callable as the source of the composite class. Fixes: #9502 Change-Id: I5b098b70b2fb7b48f54eaccbb7d5d3d9bdebc781
* | | | Merge "Improved wheel pipeline" into mainmike bayer2023-03-174-16/+73
|\ \ \ \ | |/ / / |/| | |
| * | | Improved wheel pipelineFederico Caselli2023-03-174-16/+73
| |/ / | | | | | | | | | | | | | | | | | | | | | - ensure that the compiled extensions are used - speed up job by parallelizing more Fixes: #9434 Change-Id: Ief750b28733ba24bb5ff8c105e1a4c9b7b928700
* | | Merge "Add override hook PGDialect.set_backslash_escapes()" into mainmike bayer2023-03-152-4/+16
|\ \ \
| * | | Add override hook PGDialect.set_backslash_escapes()Matt del Valle2023-03-132-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Description Refactor out the lines in `PGDialect.initialize()` that set backslash escapes into their own method to provide an override hook for [`sqlalchemy-redshift`](https://github.com/sqlalchemy-redshift/sqlalchemy-redshift) to use. Fixes #9442 ### Checklist 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. Closes: #9475 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9475 Pull-request-sha: 5565afeac20ea3612c3f427f58efacd8487ac159 Change-Id: I9b652044243ab231c19ab55ebc8ee24534365d61
* | | | Merge "use utc for datetimetz multirange tests" into mainmike bayer2023-03-151-2/+14
|\ \ \ \ | |_|/ / |/| | |
| * | | use utc for datetimetz multirange testsMike Bayer2023-03-141-2/+14
| | |/ | |/| | | | | | | | | | | | | | | | these tests failed the day before DST here, so just use utc Fixes: #9471 Change-Id: I3f5c940b4e7d36943bd3ad34cc06b9563371d171
* | | Implementation of CITEXT , unittest and documentationJulian David Rath2023-03-1510-11/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new PostgreSQL type :class:`_postgresql.CITEXT`. Pull request courtesy Julian David Rath. Fixes: #9416 Closes: #9417 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9417 Pull-request-sha: 23a83a342ad6d820ee5749ebccda04e54c373f7d Change-Id: I54699b9457426c20afbdc0acaa41dc57644b0536
* | | remove "listeners" docstringMike Bayer2023-03-151-5/+0
| | | | | | | | | | | | | | | | | | | | | this should have been removed with #4638. Fixes: #9492 Change-Id: If82dba7e63382e921aceb0c01d88f0977b7f5e8d
* | | Document generic type parameters to FunctionElement and GenericFunction (#9079)Stephen Rosen2023-03-141-0/+18
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Document type parameters to FunctionElement Add a note to FunctionElement which indicates that the type is a typing.Generic class and points at GenericFunction examples for a specific example usage. A minimal reference is made to type checkers and IDEs as use-cases in order to try to contextualize this as an optional feature which supports particular use cases. Append to the GenericFunction examples a case which uses `DateTime` but also includes the generic type parameter (`datetime.datetime`). * Fix type annotated function usage example
* | Bump pypa/cibuildwheel from 2.12.0 to 2.12.1 (#9474)dependabot[bot]2023-03-131-1/+1
|/ | | | | | | | | | | | | | | | Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.12.0 to 2.12.1. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.12.0...v2.12.1) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Version 2.0.7 placeholderMike Bayer2023-03-132-1/+5
|
* - 2.0.6rel_2_0_6Mike Bayer2023-03-139-72/+79
|
* simplify AttachedDB test for SQLiteMike Bayer2023-03-131-68/+42
| | | | | | | | This test is failing on windows due to the new SQlite provisioning that seemed to be failing to delete schema files as they are still used by the main connection. Change-Id: I51093212ebfe1053f26b279c56c8fec0408806da
* document no-pep681 workaroundsMike Bayer2023-03-122-6/+50
| | | | | | | | | | | | | | | | | | | Mypy 1.1.1 has been released which includes a non-compliant pep-681 implementation that fails with SQLAlchemy's :class:`.MappedAsDataclass` and similar features. In order to work around this issue until Mypy is able to release a fix, as well as to support other typing tools which may have non-compliant pep-681 implementations, document a workaround class for :class:`.MappedAsDataclass`. Including this class as well as a decorator was considered, but overall this is an issue with typing tools that they will have to resolve and I'm not ready to set up for this issue going on long term. There's also no good solution for the decorator version since you have to have an ``__init__`` method indicated somewhere. References: https://github.com/python/mypy/issues/13856 Fixes: #9467 Change-Id: I1be6abea7f7fc72883c14ab2447edad937d0c23f
* fix unlengthed string used as pkMike Bayer2023-03-111-4/+6
| | | | | | | SQL Server has been failing on this test for a month as it does not allow a PK on VARCHAR(max) Change-Id: I3f43e660275e03ced1b584fe9d3c7f34f5558330