Sqlalchemy

Latest version: v2.0.30

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

Scan your dependencies

Page 22 of 50

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::

1.2.11

Not secure
:released: August 20, 2018

.. change::
:tags: bug, py3k

Started importing "collections" from "collections.abc" under Python 3.3 and
greater for Python 3.8 compatibility. Pull request courtesy Nathaniel
Knight.

.. change::
:tag: bug, sqlite

Fixed issue where the "schema" name used for a SQLite database within table
reflection would not quote the schema name correctly. Pull request
courtesy Phillip Cloud.

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

Fixed issue that is closely related to :ticket:`3639` where an expression
rendered in a boolean context on a non-native boolean backend would
be compared to 1/0 even though it is already an implicitly boolean
expression, when :meth:`_expression.ColumnElement.self_group` were used. While this
does not affect the user-friendly backends (MySQL, SQLite) it was not
handled by Oracle (and possibly SQL Server). Whether or not the
expression is implicitly boolean on any database is now determined
up front as an additional check to not generate the integer comparison
within the compilation of the statement.

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

For cx_Oracle, Integer datatypes will now be bound to "int", per advice
from the cx_Oracle developers. Previously, using cx_Oracle.NUMBER caused a
loss in precision within the cx_Oracle 6.x series.


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

Fixed issue in previously untested use case, allowing a declarative mapped
class to inherit from a classically-mapped class outside of the declarative
base, including that it accommodates for unmapped intermediate classes. An
unmapped intermediate class may specify ``__abstract__``, which is now
interpreted correctly, or the intermediate class can remain unmarked, and
the classically mapped base class will be detected within the hierarchy
regardless. In order to anticipate existing scenarios which may be mixing
in classical mappings into existing declarative hierarchies, an error is
now raised if multiple mapped bases are detected for a given class.

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

Added missing window function parameters
:paramref:`.WithinGroup.over.range_` and :paramref:`.WithinGroup.over.rows`
parameters to the :meth:`.WithinGroup.over` and
:meth:`.FunctionFilter.over` methods, to correspond to the range/rows
feature added to the "over" method of SQL functions as part of
:ticket:`3049` in version 1.1.

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

Fixed bug where the multi-table support for UPDATE and DELETE statements
did not consider the additional FROM elements as targets for correlation,
when a correlated SELECT were also combined with the statement. This
change now includes that a SELECT statement in the WHERE clause for such a
statement will try to auto-correlate back to these additional tables in the
parent UPDATE/DELETE or unconditionally correlate if
:meth:`_expression.Select.correlate` is used. Note that auto-correlation raises an
error if the SELECT statement would have no FROM clauses as a result, which
can now occur if the parent UPDATE/DELETE specifies the same tables in its
additional set of tables; specify :meth:`_expression.Select.correlate` explicitly to
resolve.

.. changelog::

1.2.10

Not secure
:released: July 13, 2018

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

Fixed bug where a :class:`.Sequence` would be dropped explicitly before any
:class:`_schema.Table` that refers to it, which breaks in the case when the
sequence is also involved in a server-side default for that table, when
using :meth:`_schema.MetaData.drop_all`. The step which processes sequences
to be dropped via non server-side column default functions is now invoked
after the table itself is dropped.

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

Fixed bug in :class:`.Bundle` construct where placing two columns of the
same name would be de-duplicated, when the :class:`.Bundle` were used as
part of the rendered SQL, such as in the ORDER BY or GROUP BY of the statement.


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

Fixed regression in 1.2.9 due to :ticket:`4287` where using a
:class:`_orm.Load` option in conjunction with a string wildcard would result
in a TypeError.

.. changelog::

Page 22 of 50

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.