diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2022-01-20 23:06:00 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-01-20 23:06:00 +0000 |
| commit | 1a24813bab99376ccd1c726dd7b69db3635a2d2b (patch) | |
| tree | 724c0f41a2ac846b4b94a8f22725db3a32b578bc | |
| parent | 952f480bfe401ca35ff3ec3d87fa57ad2a87cf37 (diff) | |
| parent | becab8588cb7895839ba25299ad0d2d67a7b695f (diff) | |
| download | sqlalchemy-1a24813bab99376ccd1c726dd7b69db3635a2d2b.tar.gz | |
Merge "The parameter `as_uuid` of `UUID` now defaults to `True`." into main
| -rw-r--r-- | doc/build/changelog/unreleased_20/7225.rst | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 6 | ||||
| -rw-r--r-- | lib/sqlalchemy/engine/interfaces.py | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/doc/build/changelog/unreleased_20/7225.rst b/doc/build/changelog/unreleased_20/7225.rst new file mode 100644 index 000000000..c77a0c212 --- /dev/null +++ b/doc/build/changelog/unreleased_20/7225.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: postgresql, change + :tickets: 7225 + + The parameter :paramref:`_postgresql.UUID.as_uuid` of + :class:`_postgresql.UUID` now defaults to ``True``. diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 4f3e297ef..e4ebbcb80 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1707,14 +1707,16 @@ class UUID(sqltypes.TypeEngine): __visit_name__ = "UUID" - def __init__(self, as_uuid=False): + def __init__(self, as_uuid=True): """Construct a UUID type. - :param as_uuid=False: if True, values will be interpreted + :param as_uuid=True: if True, values will be interpreted as Python uuid objects, converting to/from string via the DBAPI. + .. versionchanged: 2 ``as_uuid`` now defaults to ``True``. + """ self.as_uuid = as_uuid diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index 62477f077..2bbe23e04 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -651,7 +651,7 @@ class Dialect: See :class:`.BindTyping` for values. - ..versionadded:: 2.0 + .. versionadded:: 2.0 """ |
