Sqlalchemy

Latest version: v2.0.36

Safety actively analyzes 683249 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 23 of 51

1.2.17

Not secure
:released: January 25, 2019

.. change::
:tags: feature, orm
:tickets: 4461

Added new event hooks :meth:`.QueryEvents.before_compile_update` and
:meth:`.QueryEvents.before_compile_delete` which complement
:meth:`.QueryEvents.before_compile` in the case of the :meth:`_query.Query.update`
and :meth:`_query.Query.delete` methods.


.. change::
:tags: bug, postgresql
:tickets: 4463

Revised the query used when reflecting CHECK constraints to make use of the
``pg_get_constraintdef`` function, as the ``consrc`` column is being
deprecated in PG 12. Thanks to John A Stevenson for the tip.


.. change::
:tags: bug, orm
:tickets: 4454

Fixed issue where when using single-table inheritance in conjunction with a
joined inheritance hierarchy that uses "with polymorphic" loading, the
"single table criteria" for that single-table entity could get confused for
that of other entities from the same hierarchy used in the same query.The
adaption of the "single table criteria" is made more specific to the target
entity to avoid it accidentally getting adapted to other tables in the
query.


.. change::
:tags: bug, oracle
:tickets: 4457

Fixed regression in integer precision logic due to the refactor of the
cx_Oracle dialect in 1.2. We now no longer apply the cx_Oracle.NATIVE_INT
type to result columns sending integer values (detected as positive
precision with scale ==0) which encounters integer overflow issues with
values that go beyond the 32 bit boundary. Instead, the output variable
is left untyped so that cx_Oracle can choose the best option.

.. changelog::

1.2.16

Not secure
:released: January 11, 2019

.. change::
:tag: bug, sql
:tickets: 4394

Fixed issue in "expanding IN" feature where using the same bound parameter
name more than once in a query would lead to a KeyError within the process
of rewriting the parameters in the query.

.. change::
:tags: bug, postgresql
:tickets: 4416

Fixed issue where a :class:`_postgresql.ENUM` or a custom domain present
in a remote schema would not be recognized within column reflection if
the name of the enum/domain or the name of the schema required quoting.
A new parsing scheme now fully parses out quoted or non-quoted tokens
including support for SQL-escaped quotes.

.. change::
:tags: bug, postgresql

Fixed issue where multiple :class:`_postgresql.ENUM` objects referred to
by the same :class:`_schema.MetaData` object would fail to be created if
multiple objects had the same name under different schema names. The
internal memoization the PostgreSQL dialect uses to track if it has
created a particular :class:`_postgresql.ENUM` in the database during
a DDL creation sequence now takes schema name into account.

.. change::
:tags: bug, engine
:tickets: 4429

Fixed a regression introduced in version 1.2 where a refactor
of the :class:`.SQLAlchemyError` base exception class introduced an
inappropriate coercion of a plain string message into Unicode under
python 2k, which is not handled by the Python interpreter for characters
outside of the platform's encoding (typically ascii). The
:class:`.SQLAlchemyError` class now passes a bytestring through under
Py2K for ``__str__()`` as is the behavior of exception objects in general
under Py2K, does a safe coercion to unicode utf-8 with
backslash fallback for ``__unicode__()``. For Py3K the message is
typically unicode already, but if not is again safe-coerced with utf-8
with backslash fallback for the ``__str__()`` method.

.. change::
:tags: bug, sql, oracle, mysql
:tickets: 4436

Fixed issue where the DDL emitted for :class:`.DropTableComment`, which
will be used by an upcoming version of Alembic, was incorrect for the MySQL
and Oracle databases.

.. change::
:tags: bug, sqlite
:tickets: 4431

Reflection of an index based on SQL expressions are now skipped with a
warning, in the same way as that of the Postgresql dialect, where we currently
do not support reflecting indexes that have SQL expressions within them.
Previously, an index with columns of None were produced which would break
tools like Alembic.

.. changelog::

1.2.15

Not secure
:released: December 11, 2018

.. change::
:tags: bug, orm
:tickets: 4367

Fixed bug where the ORM annotations could be incorrect for the
primaryjoin/secondaryjoin a relationship if one used the pattern
``ForeignKey(SomeClass.id)`` in the declarative mappings. This pattern
would leak undesired annotations into the join conditions which can break
aliasing operations done within :class:`_query.Query` that are not supposed to
impact elements in that join condition. These annotations are now removed
up front if present.

.. change::
:tags: bug, orm, declarative
:tickets: 4374

A warning is emitted in the case that a :func:`_expression.column` object is applied to
a declarative class, as it seems likely this intended to be a
:class:`_schema.Column` object.

.. change::
:tags: bug, orm
:tickets: 4366

In continuing with a similar theme as that of very recent :ticket:`4349`,
repaired issue with :meth:`.RelationshipProperty.Comparator.any` and
:meth:`.RelationshipProperty.Comparator.has` where the "secondary"
selectable needs to be explicitly part of the FROM clause in the
EXISTS subquery to suit the case where this "secondary" is a :class:`_expression.Join`
object.

.. change::
:tags: bug, orm
:tickets: 4363

Fixed regression caused by :ticket:`4349` where adding the "secondary"
table to the FROM clause for a dynamic loader would affect the ability of
the :class:`_query.Query` to make a subsequent join to another entity. The fix
adds the primary entity as the first element of the FROM list since
:meth:`_query.Query.join` wants to jump from that. Version 1.3 will have
a more comprehensive solution to this problem as well (:ticket:`4365`).




.. change::
:tags: bug, orm
:tickets: 4400

Fixed bug where chaining of mapper options using
:meth:`.RelationshipProperty.of_type` in conjunction with a chained option
that refers to an attribute name by string only would fail to locate the
attribute.

.. change::
:tag: feature, mysql
:tickets: 4381

Added support for the ``write_timeout`` flag accepted by mysqlclient and
pymysql to be passed in the URL string.

.. change::
:tag: bug, postgresql
:tickets: 4377, 4380

Fixed issue where reflection of a PostgreSQL domain that is expressed as an
array would fail to be recognized. Pull request courtesy Jakub Synowiec.


.. changelog::

1.2.14

Not secure
:released: November 10, 2018

.. change::
:tags: bug, orm
:tickets: 4357

Fixed bug in :meth:`.Session.bulk_update_mappings` where alternate mapped
attribute names would result in the primary key column of the UPDATE
statement being included in the SET clause, as well as the WHERE clause;
while usually harmless, for SQL Server this can raise an error due to the
IDENTITY column. This is a continuation of the same bug that was fixed in
:ticket:`3849`, where testing was insufficient to catch this additional
flaw.

.. change::
:tags: bug, mysql
:tickets: 4361

Fixed regression caused by :ticket:`4344` released in 1.2.13, where the fix
for MySQL 8.0's case sensitivity problem with referenced column names when
reflecting foreign key referents is worked around using the
``information_schema.columns`` view. The workaround was failing on OSX /
``lower_case_table_names=2`` which produces non-matching casing for the
``information_schema.columns`` vs. that of ``SHOW CREATE TABLE``, so in
case-insensitive SQL modes case-insensitive matching is now used.

.. change::
:tags: bug, orm
:tickets: 4347

Fixed a minor performance issue which could in some cases add unnecessary
overhead to result fetching, involving the use of ORM columns and entities
that include those same columns at the same time within a query. The issue
has to do with hash / eq overhead when referring to the column in different
ways.

.. changelog::

1.2.13

Not secure
:released: October 31, 2018

.. change::
:tags: bug, postgresql
:tickets: 4337

Added support for the :class:`.aggregate_order_by` function to receive
multiple ORDER BY elements, previously only a single element was accepted.


.. change::
:tags: bug, mysql
:tickets: 4348

Added word ``function`` to the list of reserved words for MySQL, which is
now a keyword in MySQL 8.0

.. change::
:tags: feature, sql
:versions: 1.3.0b1

Refactored :class:`.SQLCompiler` to expose a
:meth:`.SQLCompiler.group_by_clause` method similar to the
:meth:`.SQLCompiler.order_by_clause` and :meth:`.SQLCompiler.limit_clause`
methods, which can be overridden by dialects to customize how GROUP BY
renders. Pull request courtesy Samuel Chou.

.. change::
:tags: bug, misc

Fixed issue where part of the utility language helper internals was passing
the wrong kind of argument to the Python ``__import__`` builtin as the list
of modules to be imported. The issue produced no symptoms within the core
library but could cause issues with external applications that redefine the
``__import__`` builtin or otherwise instrument it. Pull request courtesy Joe
Urciuoli.

.. change::
:tags: bug, orm
:tickets: 4349

Fixed bug where "dynamic" loader needs to explicitly set the "secondary"
table in the FROM clause of the query, to suit the case where the secondary
is a join object that is otherwise not pulled into the query from its
columns alone.


.. change::
:tags: bug, orm, declarative
:tickets: 4350

Fixed regression caused by :ticket:`4326` in version 1.2.12 where using
:class:`.declared_attr` with a mixin in conjunction with
:func:`_orm.synonym` would fail to map the synonym properly to an inherited
subclass.

.. change::
:tags: bug, misc, py3k
:tickets: 4339

Fixed additional warnings generated by Python 3.7 due to changes in the
organization of the Python ``collections`` and ``collections.abc`` packages.
Previous ``collections`` warnings were fixed in version 1.2.11. Pull request
courtesy xtreak.

.. change::
:tags: bug, ext

Added missing ``.index()`` method to list-based association collections
in the association proxy extension.

.. change::
:tags: bug, mysql
:tickets: 4344

Added a workaround for a MySQL bug 88718 introduced in the 8.0 series,
where the reflection of a foreign key constraint is not reporting the
correct case sensitivity for the referred column, leading to errors during
use of the reflected constraint such as when using the automap extension.
The workaround emits an additional query to the information_schema tables in
order to retrieve the correct case sensitive name.

.. change::
:tags: bug, sql
:tickets: 4341

Fixed bug where the :paramref:`.Enum.create_constraint` flag on the
:class:`.Enum` datatype would not be propagated to copies of the type, which
affects use cases such as declarative mixins and abstract bases.

.. change::
:tags: bug, orm, declarative
:tickets: 4352

The column conflict resolution technique discussed at
:ref:`orm_inheritance_column_conflicts` is now functional for a :class:`_schema.Column`
that is also a primary key column. Previously, a check for primary key
columns declared on a single-inheritance subclass would occur before the
column copy were allowed to pass.


.. changelog::

1.2.12

Not secure
:released: September 19, 2018

.. change::
:tags: bug, postgresql
:tickets: 4325

Fixed bug in PostgreSQL dialect where compiler keyword arguments such as
``literal_binds=True`` were not being propagated to a DISTINCT ON
expression.

.. change::
:tags: bug, ext
:tickets: 4328

Fixed issue where :class:`.BakedQuery` did not include the specific query
class used by the :class:`.Session` as part of the cache key, leading to
incompatibilities when using custom query classes, in particular the
:class:`.ShardedQuery` which has some different argument signatures.

.. change::
:tags: bug, postgresql
:tickets: 4324

Fixed the :func:`_postgresql.array_agg` function, which is a slightly
altered version of the usual :func:`_functions.array_agg` function, to also
accept an incoming "type" argument without forcing an ARRAY around it,
essentially the same thing that was fixed for the generic function in 1.1
in :ticket:`4107`.

.. change::
:tags: bug, postgresql
:tickets: 4323

Fixed bug in PostgreSQL ENUM reflection where a case-sensitive, quoted name
would be reported by the query including quotes, which would not match a
target column during table reflection as the quotes needed to be stripped
off.


.. change::
:tags: bug, orm

Added a check within the weakref cleanup for the :class:`.InstanceState`
object to check for the presence of the ``dict`` builtin, in an effort to
reduce error messages generated when these cleanups occur during interpreter
shutdown. Pull request courtesy Romuald Brunet.

.. change::
:tags: bug, orm, declarative
:tickets: 4326

Fixed bug where the declarative scan for attributes would receive the
expression proxy delivered by a hybrid attribute at the class level, and
not the hybrid attribute itself, when receiving the descriptor via the
``declared_attr`` callable on a subclass of an already-mapped class. This
would lead to an attribute that did not report itself as a hybrid when
viewed within :attr:`_orm.Mapper.all_orm_descriptors`.


.. change::
:tags: bug, orm
:tickets: 4334
:versions: 1.3.0b1

Fixed bug where use of :class:`_expression.Lateral` construct in conjunction with
:meth:`_query.Query.join` as well as :meth:`_query.Query.select_entity_from` would not
apply clause adaption to the right side of the join. "lateral" introduces
the use case of the right side of a join being correlatable. Previously,
adaptation of this clause wasn't considered. Note that in 1.2 only,
a selectable introduced by :meth:`_query.Query.subquery` is still not adapted
due to :ticket:`4304`; the selectable needs to be produced by the
:func:`_expression.select` function to be the right side of the "lateral" join.

.. change::
:tags: bug, oracle
:tickets: 4335

Fixed issue for cx_Oracle 7.0 where the behavior of Oracle param.getvalue()
now returns a list, rather than a single scalar value, breaking
autoincrement logic throughout the Core and ORM. The dml_ret_array_val
compatibility flag is used for cx_Oracle 6.3 and 6.4 to establish compatible
behavior with 7.0 and forward, for cx_Oracle 6.2.1 and prior a version
number check falls back to the old logic.


.. change::
:tags: bug, orm
:tickets: 4327

Fixed 1.2 regression caused by :ticket:`3472` where the handling of an
"updated_at" style column within the context of a post-update operation
would also occur for a row that is to be deleted following the update,
meaning both that a column with a Python-side value generator would show
the now-deleted value that was emitted for the UPDATE before the DELETE
(which was not the previous behavior), as well as that a SQL- emitted value
generator would have the attribute expired, meaning the previous value
would be unreachable due to the row having been deleted and the object
detached from the session.The "postfetch" logic that was added as part of
:ticket:`3472` is now skipped entirely for an object that ultimately is to
be deleted.

.. changelog::

Page 23 of 51

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.