Sqlalchemy

Latest version: v2.0.36

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

Scan your dependencies

Page 29 of 51

1.1.3

Not secure
:released: October 27, 2016

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

Fixed regression caused by :ticket:`2677` whereby calling
:meth:`.Session.delete` on an object that was already flushed as
deleted in that session would fail to set up the object in the
identity map (or reject the object), causing flush errors as the
object were in a state not accommodated by the unit of work.
The pre-1.1 behavior in this case has been restored, which is that
the object is put back into the identity map so that the DELETE
statement will be attempted again, which emits a warning that the number
of expected rows was not matched (unless the row were restored outside
of the session).

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

PostgreSQL table reflection will ensure that the
:paramref:`_schema.Column.autoincrement` flag is set to False when reflecting
a primary key column that is not of an :class:`.Integer` datatype,
even if the default is related to an integer-generating sequence.
This can happen if a column is created as SERIAL and the datatype
is changed. The autoincrement flag can only be True if the datatype
is of integer affinity in the 1.1 series.

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

Fixed regression where some :class:`_query.Query` methods like
:meth:`_query.Query.update` and others would fail if the :class:`_query.Query`
were against a series of mapped columns, rather than the mapped
entity as a whole.

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

Fixed bug involving new value translation and validation feature
in :class:`.Enum` whereby using the enum object in a string
concatenation would maintain the :class:`.Enum` type as the type
of the expression overall, producing missing lookups. A string
concatenation against an :class:`.Enum`-typed column now uses
:class:`.String` as the datatype of the expression itself.

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

Fixed regression which occurred as a side effect of :ticket:`2919`,
which in the less typical case of a user-defined
:class:`.TypeDecorator` that was also itself an instance of
:class:`.SchemaType` (rather than the implementation being such)
would cause the column attachment events to be skipped for the
type itself.


.. changelog::

1.1.2

Not secure
:released: October 17, 2016

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

Fixed a regression caused by a newly added function that performs the
"wrap callable" function of sql :class:`.DefaultGenerator` objects,
an attribute error raised for ``__module__`` when the default callable
was a ``functools.partial`` or other object that doesn't have a
``__module__`` attribute.

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

Fixed bug involving the rule to disable a joined collection eager
loader on the other side of a many-to-one lazy loader, first added
in :ticket:`1495`, where the rule would fail if the parent object
had some other lazyloader-bound query options associated with it.

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

Fixed self-referential entity, deferred column loading issue in a
similar style as that of :ticket:`3431`, :ticket:`3811` where an entity
is present in multiple positions within the row due to self-referential
eager loading; when the deferred loader only applies to one of the
paths, the "present" column loader will now override the deferred non-
load for that entity regardless of row ordering.

.. change::
:tags: bug, sql, postgresql
:tickets: 3827

Fixed regression in :class:`.Enum` type where event handlers were not
transferred in the case of the type object being copied, due to a
conflicting copy() method added as part of :ticket:`3250`. This copy
occurs normally in situations when the column is copied, such as
in tometadata() or when using declarative mixins with columns. The
event handler not being present would impact the constraint being
created for a non-native enumerated type, but more critically the
ENUM object on the PostgreSQL backend.


.. change::
:tags: bug, postgresql, sql
:tickets: 3828

Changed the naming convention used when generating bound parameters
for a multi-VALUES insert statement, so that the numbered parameter
names don't conflict with the anonymized parameters of a WHERE clause,
as is now common in a PostgreSQL ON CONFLICT construct.

.. changelog::

1.1.1

Not secure
:released: October 7, 2016

.. change::
:tags: bug, mssql
:tickets: 3820

The "SELECT SERVERPROPERTY"
query added in :ticket:`3810` and :ticket:`3814` is failing on unknown
combinations of Pyodbc and SQL Server. While failure of this function
was anticipated, the exception catch was not broad enough so it now
catches all forms of pyodbc.Error.

.. change::
:tags: bug, core
:tickets: 3216

Changed the CompileError raised when various primary key missing
situations are detected to a warning. The statement is again
passed to the database where it will fail and the DBAPI error (usually
IntegrityError) raises as usual.

.. seealso::

:ref:`change_3216`

.. changelog::

1.1.0

Not secure
:released: October 5, 2016

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

Execution options can now be propagated from within a
statement at compile time to the outermost statement, so that
if an embedded element wants to set "autocommit" to be True for example,
it can propagate this to the enclosing statement. Currently, this
feature is enabled for a DML-oriented CTE embedded inside of a SELECT
statement, e.g. INSERT/UPDATE/DELETE inside of SELECT.

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

ORM attributes can now be assigned any object that is has a
``__clause_element__()`` attribute, which will result in inline
SQL the way any :class:`_expression.ClauseElement` class does. This covers other
mapped attributes not otherwise transformed by further expression
constructs.

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

Enhanced the new "raise" lazy loader strategy to also include a
"raise_on_sql" variant, available both via :paramref:`.orm.relationship.lazy`
as well as :func:`_orm.raiseload`. This variant only raises if the
lazy load would actually emit SQL, vs. raising if the lazy loader
mechanism is invoked at all.

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

An adjustment to ON CONFLICT such that the "inserted_primary_key"
logic is able to accommodate the case where there's no INSERT or
UPDATE and there's no net change. The value comes out as None
in this case, rather than failing on an exception.

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

Made an adjustment to the bug fix first introduced in [ticket:3431]
that involves an object appearing in multiple contexts in a single
result set, such that an eager loader that would set the related
object value to be None will still fire off, thus satisfying the
load of that attribute. Previously, the adjustment only honored
a non-None value arriving for an eagerly loaded attribute in a
secondary row.

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

Fixed bug in new :meth:`.SessionEvents.persistent_to_deleted` event
where the target object could be garbage collected before the event
is fired off.

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

A string sent as a column default via the
:paramref:`_schema.Column.server_default` parameter is now escaped for quotes.

.. seealso::

:ref:`change_3809`

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

Fixed issue in new PG "on conflict" construct where columns including
those of the "excluded" namespace would not be table-qualified
in the WHERE clauses in the statement.

.. change::
:tags: bug, sql, postgresql
:tickets: 3806

Added compiler-level flags used by PostgreSQL to place additional
parenthesis than would normally be generated by precedence rules
around operations involving JSON, HSTORE indexing operators as well as
within their operands since it has been observed that PostgreSQL's
precedence rules for at least the HSTORE indexing operator is not
consistent between 9.4 and 9.5.

.. change::
:tags: bug, sql, mysql
:tickets: 3803

The ``BaseException`` exception class is now intercepted by the
exception-handling routines of :class:`_engine.Connection`, and includes
handling by the :meth:`_events.ConnectionEvents.handle_error`
event. The :class:`_engine.Connection` is now **invalidated** by default in
the case of a system level exception that is not a subclass of
``Exception``, including ``KeyboardInterrupt`` and the greenlet
``GreenletExit`` class, to prevent further operations from occurring
upon a database connection that is in an unknown and possibly
corrupted state. The MySQL drivers are most targeted by this change
however the change is across all DBAPIs.

.. seealso::

:ref:`change_3803`

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

The "eq" and "ne" operators are no longer part of the list of
"associative" operators, while they remain considered to be
"commutative". This allows an expression like ``(x == y) == z``
to be maintained at the SQL level with parenthesis. Pull request
courtesy John Passaro.

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

The primaryjoin of a :func:`_orm.relationship` construct can now include
a :func:`.bindparam` object that includes a callable function to
generate values. Previously, the lazy loader strategy would
be incompatible with this use, and additionally would fail to correctly
detect if the "use_get" criteria should be used if the primary key
were involved with the bound parameter.

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

An UPDATE emitted from the ORM flush process can now accommodate a
SQL expression element for a column within the primary key of an
object, if the target database supports RETURNING in order to provide
the new value, or if the PK value is set "to itself" for the purposes
of bumping some other trigger / onupdate on the column.

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

Fixed bug where the "simple many-to-one" condition that allows lazy
loading to use get() from identity map would fail to be invoked if the
primaryjoin of the relationship had multiple clauses separated by AND
which were not in the same order as that of the primary key columns
being compared in each clause. This ordering
difference occurs for a composite foreign key where the table-bound
columns on the referencing side were not in the same order in the .c
collection as the primary key columns on the referenced side....which
in turn occurs a lot if one is using declarative mixins and/or
declared_attr to set up columns.

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

Stringify of expression with unnamed :class:`_schema.Column` objects, as
occurs in lots of situations including ORM error reporting,
will now render the name in string context as "<name unknown>"
rather than raising a compile error.

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

Raise a more descriptive exception / message when ClauseElement
or non-SQLAlchemy objects that are not "executable" are erroneously
passed to ``.execute()``; a new exception ObjectNotExecutableError
is raised consistently in all cases.

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

An exception is raised when two ``validates`` decorators on a mapping
make use of the same name. Only one validator of a certain name
at a time is supported, there's no mechanism to chain these together,
as the order of the validators at the level of function decorator
can't be made deterministic.

.. seealso::

:ref:`change_3776`

.. change::
:tags: bug, orm

Mapper errors raised during :func:`.configure_mappers` now explicitly
include the name of the originating mapper in the exception message
to help in those situations where the wrapped exception does not
itself include the source mapper. Pull request courtesy
John Perkins.

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

Fixed bug where the "literal_binds" flag would not be propagated
to a CAST expression under MySQL.

.. change::
:tags: bug, sql, postgresql, mysql
:tickets: 3765

Fixed regression in JSON datatypes where the "literal processor" for
a JSON index value would not be invoked. The native String and Integer
datatypes are now called upon from within the JSONIndexType
and JSONPathType. This is applied to the generic, PostgreSQL, and
MySQL JSON types and also has a dependency on :ticket:`3766`.

.. change::
:tags: change, orm

Passing False to :meth:`_query.Query.order_by` in order to cancel
all order by's is deprecated; there is no longer any difference
between calling this method with False or with None.

.. change::
:tags: feature, orm

The :meth:`_query.Query.group_by` method now resets the group by collection
if an argument of ``None`` is passed, in the same way that
:meth:`_query.Query.order_by` has worked for a long time. Pull request
courtesy Iuri Diniz.

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

Fixed bug where :class:`.Index` would fail to extract columns from
compound SQL expressions if those SQL expressions were wrapped inside
of an ORM-style ``__clause_element__()`` construct. This bug
exists in 1.0.x as well, however in 1.1 is more noticeable as
hybrid_property expression now returns a wrapped element.

.. change::
:tags: change, orm, declarative

Constructing a declarative base class that inherits from another class
will also inherit its docstring. This means
:func:`~.ext.declarative.as_declarative` acts more like a normal class
decorator.

.. changelog::

1.1.0b3

Not secure
:released: July 26, 2016

.. change::
:tags: change, orm
:tickets: 3749

Removed a warning that dates back to 0.4 which emits when a same-named
relationship is placed on two mappers that inherits via joined or
single table inheritance. The warning does not apply to the
current unit of work implementation.

.. seealso::

:ref:`change_3749`


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

Fixed bug in new CTE feature for update/insert/delete stated
as a CTE inside of an enclosing statement (typically SELECT) whereby
oninsert and onupdate values weren't called upon for the embedded
statement.

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

Fixed bug in new CTE feature for update/insert/delete whereby
an anonymous (e.g. no name passed) :class:`_expression.CTE` construct around
the statement would fail.

.. change::
:tags: bug, ext

sqlalchemy.ext.indexable will intercept IndexError as well
as KeyError when raising as AttributeError.

.. change::
:tags: feature, ext

Added a "default" parameter to the new sqlalchemy.ext.indexable
extension.

.. changelog::

1.1.0b2

Not secure
:released: July 1, 2016

.. change::
:tags: bug, ext, postgresql
:tickets: 3732

Made a slight behavioral change in the ``sqlalchemy.ext.compiler``
extension, whereby the existing compilation schemes for an established
construct would be removed if that construct itself didn't already
have its own dedicated ``__visit_name__``. This was a
rare occurrence in 1.0, however in 1.1 :class:`_postgresql.ARRAY`
subclasses :class:`_types.ARRAY` and has this behavior.
As a result, setting up a compilation handler for another dialect
such as SQLite would render the main :class:`_postgresql.ARRAY`
object no longer compilable.

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

The processing performed by the :class:`.Boolean` datatype for backends
that only feature integer types has been made consistent between the
pure Python and C-extension versions, in that the C-extension version
will accept any integer value from the database as a boolean, not just
zero and one; additionally, non-boolean integer values being sent to
the database are coerced to exactly zero or one, instead of being
passed as the original integer value.

.. seealso::

:ref:`change_3730`

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

Rolled back the validation rules a bit in :class:`.Enum` to allow
unknown string values to pass through, unless the flag
``validate_string=True`` is passed to the Enum; any other kind of object is
still of course rejected. While the immediate use
is to allow comparisons to enums with LIKE, the fact that this
use exists indicates there may be more unknown-string-comparison use
cases than we expected, which hints that perhaps there are some
unknown string-INSERT cases too.

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

Dialed back the "order the primary key columns per auto-increment"
described in :ref:`change_mysql_3216` a bit, so that if the
:class:`.PrimaryKeyConstraint` is explicitly defined, the order
of columns is maintained exactly, allowing control of this behavior
when necessary.

.. changelog::

Page 29 of 51

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.