<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/sqlalchemy.git/lib/sqlalchemy/ext/mutable.py, branch ticket_5648</title>
<subtitle>github.com: zzzeek/sqlalchemy.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/'/>
<entry>
<title>Unify doc typing</title>
<updated>2023-01-31T19:45:48+00:00</updated>
<author>
<name>Harry Lees</name>
<email>harry.lees@gmail.com</email>
</author>
<published>2023-01-31T13:38:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=961f0762304db1db931d399e3b0b35cd99a4b21d'/>
<id>961f0762304db1db931d399e3b0b35cd99a4b21d</id>
<content type='text'>
### Description
&lt;!-- Describe your changes in detail --&gt;

Fixes #9168

This PR replaces common occurrences of [PEP 585](https://peps.python.org/pep-0585/) style type annotations with annotations compatible with older versions of Python.

I searched for instances of the following supported types from the PEP and replaced with their legacy typing couterparts.

* tuple # typing.Tuple
* list # typing.List
* dict # typing.Dict
* set # typing.Set
* frozenset # typing.FrozenSet
* type # typing.Type

```
grep -r "list\[.*\]" ./build --exclude-dir="./build/venv/*" --exclude-dir="./build/output/*" --exclude="changelog_[0-9]*\.rst"
```

I excluded changelog files from being altered, I think some of these could be changed if necessary but others are likely to require manual checking as the change may target the new typing style specifically.

For any examples that included imports, I tried to ensure that the correct typing imports were included and properly ordered.

### Checklist
&lt;!-- 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)

--&gt;

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: #&lt;issue number&gt;` 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: #&lt;issue number&gt;` in the commit message
	- please include tests.

Closes: #9198
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9198
Pull-request-sha: 05ad4651b57c6275b29433e5e76e166344ba6c4c

Change-Id: I41b93b3dee85f9fe00cfbb3d3eb011212795de29
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
### Description
&lt;!-- Describe your changes in detail --&gt;

Fixes #9168

This PR replaces common occurrences of [PEP 585](https://peps.python.org/pep-0585/) style type annotations with annotations compatible with older versions of Python.

I searched for instances of the following supported types from the PEP and replaced with their legacy typing couterparts.

* tuple # typing.Tuple
* list # typing.List
* dict # typing.Dict
* set # typing.Set
* frozenset # typing.FrozenSet
* type # typing.Type

```
grep -r "list\[.*\]" ./build --exclude-dir="./build/venv/*" --exclude-dir="./build/output/*" --exclude="changelog_[0-9]*\.rst"
```

I excluded changelog files from being altered, I think some of these could be changed if necessary but others are likely to require manual checking as the change may target the new typing style specifically.

For any examples that included imports, I tried to ensure that the correct typing imports were included and properly ordered.

### Checklist
&lt;!-- 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)

--&gt;

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: #&lt;issue number&gt;` 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: #&lt;issue number&gt;` in the commit message
	- please include tests.

Closes: #9198
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9198
Pull-request-sha: 05ad4651b57c6275b29433e5e76e166344ba6c4c

Change-Id: I41b93b3dee85f9fe00cfbb3d3eb011212795de29
</pre>
</div>
</content>
</entry>
<entry>
<title>happy new year 2023</title>
<updated>2023-01-03T17:45:52+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2023-01-03T17:45:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=5147bf8e3cb321b8728b3af5bb0b2644995b3793'/>
<id>5147bf8e3cb321b8728b3af5bb0b2644995b3793</id>
<content type='text'>
Change-Id: I625af65b3fb1815b1af17dc2ef47dd697fdc3fb1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I625af65b3fb1815b1af17dc2ef47dd697fdc3fb1
</pre>
</div>
</content>
</entry>
<entry>
<title>annotated / DC forms for association proxy</title>
<updated>2022-11-30T00:25:59+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-11-25T19:29:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=3e3e3ab0d46b8912649afc7c3eb63b76c19d93fe'/>
<id>3e3e3ab0d46b8912649afc7c3eb63b76c19d93fe</id>
<content type='text'>
Added support for the :func:`.association_proxy` extension function to
take part within Python ``dataclasses`` configuration, when using
the native dataclasses feature described at
:ref:`orm_declarative_native_dataclasses`.  Included are attribute-level
arguments including :paramref:`.association_proxy.init` and
:paramref:`.association_proxy.default_factory`.

Documentation for association proxy has also been updated to use
"Annotated Declarative Table" forms within examples, including type
annotations used for :class:`.AssocationProxy` itself.

Also modernized documentation examples in sqlalchemy.ext.mutable,
which was not up to date even for 1.4 style code.

Corrected typing for relationship(secondary) where "secondary"
accepts a callable (i.e. lambda) as well

Fixes: #8878
Fixes: #8876
Fixes: #8880
Change-Id: Ibd4f3591155a89f915713393e103e61cc072ed57
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added support for the :func:`.association_proxy` extension function to
take part within Python ``dataclasses`` configuration, when using
the native dataclasses feature described at
:ref:`orm_declarative_native_dataclasses`.  Included are attribute-level
arguments including :paramref:`.association_proxy.init` and
:paramref:`.association_proxy.default_factory`.

Documentation for association proxy has also been updated to use
"Annotated Declarative Table" forms within examples, including type
annotations used for :class:`.AssocationProxy` itself.

Also modernized documentation examples in sqlalchemy.ext.mutable,
which was not up to date even for 1.4 style code.

Corrected typing for relationship(secondary) where "secondary"
accepts a callable (i.e. lambda) as well

Fixes: #8878
Fixes: #8876
Fixes: #8880
Change-Id: Ibd4f3591155a89f915713393e103e61cc072ed57
</pre>
</div>
</content>
</entry>
<entry>
<title>Type annotations for sqlalchemy.ext.mutable</title>
<updated>2022-11-22T15:39:41+00:00</updated>
<author>
<name>Gleb Kisenkov</name>
<email>g.kisenkov@gmail.com</email>
</author>
<published>2022-11-16T15:23:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=ba0e508141206efc55cdab91df21c18e7dd63c80'/>
<id>ba0e508141206efc55cdab91df21c18e7dd63c80</id>
<content type='text'>
The ``sqlalchemy.ext.mutable`` extension is now fully pep-484 typed. Huge
thanks to Gleb Kisenkov for their efforts on this.

Fixes: #8667
Closes: #8775
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8775
Pull-request-sha: b907888ec67facc12dbdbccd6f2d9cd533b08a50

Change-Id: Id9224e03201e6970b1ec56eb546ece4b2f3e0edd
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ``sqlalchemy.ext.mutable`` extension is now fully pep-484 typed. Huge
thanks to Gleb Kisenkov for their efforts on this.

Fixes: #8667
Closes: #8775
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8775
Pull-request-sha: b907888ec67facc12dbdbccd6f2d9cd533b08a50

Change-Id: Id9224e03201e6970b1ec56eb546ece4b2f3e0edd
</pre>
</div>
</content>
</entry>
<entry>
<title>implement event for merge/load=False for mutable state setup</title>
<updated>2022-08-30T14:35:25+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-08-30T14:25:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=e15cf451affdef95b3248d1ea5c31ac923e661c3'/>
<id>e15cf451affdef95b3248d1ea5c31ac923e661c3</id>
<content type='text'>
Fixed issue in :mod:`sqlalchemy.ext.mutable` extension where collection
links to the parent object would be lost if the object were merged with
:meth:`.Session.merge` while also passing :paramref:`.Session.merge.load`
as False.

The event added here is currently private for expediency, but
is acceptable to become a public event at some point.

Fixes: #8446
Change-Id: I9e5b9f1f5a0c5a9781f51635d5e57b1134c9e866
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed issue in :mod:`sqlalchemy.ext.mutable` extension where collection
links to the parent object would be lost if the object were merged with
:meth:`.Session.merge` while also passing :paramref:`.Session.merge.load`
as False.

The event added here is currently private for expediency, but
is acceptable to become a public event at some point.

Fixes: #8446
Change-Id: I9e5b9f1f5a0c5a9781f51635d5e57b1134c9e866
</pre>
</div>
</content>
</entry>
<entry>
<title>update ORM declarative docs for new features</title>
<updated>2022-07-16T20:28:11+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-07-15T16:53:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=9a37ebdf99d0e3fcca53ca8f00f101fe475a1b01'/>
<id>9a37ebdf99d0e3fcca53ca8f00f101fe475a1b01</id>
<content type='text'>
I screwed up a rebase or something so this was
temporarily in Ic51a12de3358f3a451bd7cf3542b375569499fc1

Change-Id: I847ee1336381221c0112b67854df022edf596b25
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I screwed up a rebase or something so this was
temporarily in Ic51a12de3358f3a451bd7cf3542b375569499fc1

Change-Id: I847ee1336381221c0112b67854df022edf596b25
</pre>
</div>
</content>
</entry>
<entry>
<title>support dataclasses with MutableComposite</title>
<updated>2022-07-13T18:30:36+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-07-13T18:30:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=fa8a7715a3f184c708a5e1625f63849844667da4'/>
<id>fa8a7715a3f184c708a5e1625f63849844667da4</id>
<content type='text'>
basically a one line change

Change-Id: If6a70d49777e77f86e2b6936dd4aece20b00708e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
basically a one line change

Change-Id: If6a70d49777e77f86e2b6936dd4aece20b00708e
</pre>
</div>
</content>
</entry>
<entry>
<title>add fallback for old mutable format</title>
<updated>2022-06-24T14:31:46+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-06-24T14:31:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=271c38fd15b94d8acd0e6f054c8001b22535844e'/>
<id>271c38fd15b94d8acd0e6f054c8001b22535844e</id>
<content type='text'>
Fixed regression caused by :ticket:`8133` where the pickle format for
mutable attributes was changed, without a fallback to recognize the old
format, causing in-place upgrades of SQLAlchemy to no longer be able to
read pickled data from previous versions. A check plus a fallback for the
old format is now in place.

Fixes: #8133
Change-Id: I9029729b4bc56c8b3145797869229eeff48a3b3b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed regression caused by :ticket:`8133` where the pickle format for
mutable attributes was changed, without a fallback to recognize the old
format, causing in-place upgrades of SQLAlchemy to no longer be able to
read pickled data from previous versions. A check plus a fallback for the
old format is now in place.

Fixes: #8133
Change-Id: I9029729b4bc56c8b3145797869229eeff48a3b3b
</pre>
</div>
</content>
</entry>
<entry>
<title>pickle mutable parents according to key</title>
<updated>2022-06-14T20:16:06+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-06-14T19:41:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=042bccd2e4d6fbfcdf70ede760b29f78771f4b22'/>
<id>042bccd2e4d6fbfcdf70ede760b29f78771f4b22</id>
<content type='text'>
Fixed bug in :class:`.Mutable` where pickling and unpickling of an ORM
mapped instance would not correctly restore state for mappings that
contained multiple :class:`.Mutable`-enabled attributes.

Fixes: #8133
Change-Id: I508763e0df0d7a624e1169f9a46d7f25404add1e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixed bug in :class:`.Mutable` where pickling and unpickling of an ORM
mapped instance would not correctly restore state for mappings that
contained multiple :class:`.Mutable`-enabled attributes.

Fixes: #8133
Change-Id: I508763e0df0d7a624e1169f9a46d7f25404add1e
</pre>
</div>
</content>
</entry>
<entry>
<title>inline mypy config; files ignoring type errors for the moment</title>
<updated>2022-04-28T19:02:50+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2022-04-27T19:43:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=f2bd4f513628bb2a7a8e8b36383e3a4324eac803'/>
<id>f2bd4f513628bb2a7a8e8b36383e3a4324eac803</id>
<content type='text'>
to simplify pyproject.toml change the remaining files
that aren't going to be typed on this first pass
(unless of course someone wants to type some of these)
to include # mypy: ignore-errors.   for the moment, only a handful
of ORM modules are to have more type checking implemented.

It's important that ignore-errors is used and
not "# type: ignore", as in the latter case, mypy doesn't even
read the existing types in the file, which makes it impossible to
type any files that refer to those modules at all.

to simplify ongoing typing work use inline mypy config
for remaining files that are "done" for now, indicating the
level of type checking they currently have.

Change-Id: I98669c1a305c2f0adba85d10b5425541f3fe9533
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to simplify pyproject.toml change the remaining files
that aren't going to be typed on this first pass
(unless of course someone wants to type some of these)
to include # mypy: ignore-errors.   for the moment, only a handful
of ORM modules are to have more type checking implemented.

It's important that ignore-errors is used and
not "# type: ignore", as in the latter case, mypy doesn't even
read the existing types in the file, which makes it impossible to
type any files that refer to those modules at all.

to simplify ongoing typing work use inline mypy config
for remaining files that are "done" for now, indicating the
level of type checking they currently have.

Change-Id: I98669c1a305c2f0adba85d10b5425541f3fe9533
</pre>
</div>
</content>
</entry>
</feed>
