./databases/py-sqlalchemy, Python SQL toolkit and Object Relational Mapper

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]

Branch: CURRENT, Version: 1.3.13, Package name: py37-sqlalchemy-1.3.13, Maintainer: pkgsrc-users

SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that
gives application developers the full power and flexibility of SQL.

It provides a full suite of well known enterprise-level persistence
patterns, designed for efficient and high-performing database access,
adapted into a simple and Pythonic domain language.

Required to run:
[devel/py-setuptools] [lang/python37]

Required to build:

Master sites:

SHA1: 320ef8780bc92443bcf5dedf7609174865bbe66d
RMD160: 7fbe8fc6213598cf67372f2ce7c578ca81247a04
Filesize: 5899.315 KB

Version history: (Expand)

CVS history: (Expand)

   2020-03-22 23:45:24 by Roland Illig | Files touched by this commit (1)
Log message:
databases/py-sqlalchemy: remove nonexistent file

The test runner has apparently been replaced with a test suite.
   2020-02-04 17:57:21 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.13


[orm] [bug] [engine]
Added test support and repaired a wide variety of unnecessary reference cycles \ 
created for short-lived objects, mostly in the area of ORM queries. Thanks much \ 
to Carson Ip for the help on this.

[orm] [bug]
Fixed regression in loader options introduced in 1.3.0b3 via 4468 where the \ 
ability to create a loader option using PropComparator.of_type() targeting an \ 
aliased entity that is an inheriting subclass of the entity which the preceding \ 
relationship refers to would fail to produce a matching path. See also 5082 \ 
fixed in this same release which involves a similar kind of issue.

[orm] [bug]
Fixed regression in joined eager loading introduced in 1.3.0b3 via 4468 where \ 
the ability to create a joined option across a with_polymorphic() into a \ 
polymorphic subclass using RelationshipProperty.of_type() and then further along \ 
regular mapped relationships would fail as the polymorphic subclass would not \ 
add itself to the load path in a way that could be located by the loader \ 
strategy. A tweak has been made to resolve this scenario.

[orm] [bug]
Repaired a warning in the ORM flush process that was not covered by test \ 
coverage when deleting objects that use the “version_id” feature. This \ 
warning is generally unreachable unless using a dialect that sets the \ 
“supports_sane_rowcount” flag to False, which is not typically the case \ 
however is possible for some MySQL configurations as well as older Firebird \ 
drivers, and likely some third party dialects.

[orm] [bug]
Fixed bug where usage of joined eager loading would not properly wrap the query \ 
inside of a subquery when Query.group_by() were used against the query. When any \ 
kind of result-limiting approach is used, such as DISTINCT, LIMIT, OFFSET, \ 
joined eager loading embeds the row-limited query inside of a subquery so that \ 
the collection results are not impacted. For some reason, the presence of GROUP \ 
BY was never included in this criterion, even though it has a similar effect as \ 
using DISTINCT. Additionally, the bug would prevent using GROUP BY at all for a \ 
joined eager load query for most database platforms which forbid non-aggregated, \ 
non-grouped columns from being in the query, as the additional columns for the \ 
joined eager load would not be accepted by the database.

[orm] [performance]
Identified a performance issue in the system by which a join is constructed \ 
based on a mapped relationship. The clause adaption system would be used for the \ 
majority of join expressions including in the common case where no adaptation is \ 
needed. The conditions under which this adaptation occur have been refined so \ 
that average non-aliased joins along a simple relationship without a \ 
“secondary” table use about 70% less function calls.

[engine] [bug]
Fixed issue where the collection of value processors on a Compiled object would \ 
be mutated when “expanding IN” parameters were used with a datatype that has \ 
bind value processors; in particular, this would mean that when using statement \ 
caching and/or baked queries, the same compiled._bind_processors collection \ 
would be mutated concurrently. Since these processors are the same function for \ 
a given bind parameter namespace every time, there was no actual negative effect \ 
of this issue, however, the execution of a Compiled object should never be \ 
causing any changes in its state, especially given that they are intended to be \ 
thread-safe and reusable once fully constructed.

[sql] [usecase]
A function created using GenericFunction can now specify that the name of the \ 
function should be rendered with or without quotes by assigning the quoted_name \ 
construct to the .name element of the object. Prior to 1.3.4, quoting was never \ 
applied to function names, and some quoting was introduced in 4467 but no means \ 
to force quoting for a mixed case name was available. Additionally, the \ 
quoted_name construct when used as the name will properly register its lowercase \ 
name in the function registry so that the name continues to be available via the \ 
func. registry.

[postgresql] [usecase]
Added support for prefixes to the CTE construct, to allow support for Postgresql \ 
12 “MATERIALIZED” and “NOT MATERIALIZED” phrases. Pull request courtesy \ 
Marat Sharafutdinov.

[postgresql] [bug]
Fixed issue where the PostgreSQL dialect would fail to parse a reflected CHECK \ 
constraint that was a boolean-valued function (as opposed to a boolean-valued \ 

[postgresql] [tests]
Improved detection of two phase transactions requirement for the PostgreSQL \ 
database by testing that max_prepared_transactions is set to a value greater \ 
than 0. Pull request courtesy Federico Caselli.

[mssql] [bug]
Fixed issue where a timezone-aware datetime value being converted to string for \ 
use as a parameter value of a mssql.DATETIMEOFFSET column was omitting the \ 
fractional seconds.

[bug] [ext]
Fixed bug in sqlalchemy.ext.serializer where a unique BindParameter object could \ 
conflict with itself if it were present in the mapping itself, as well as the \ 
filter condition of the query, as one side would be used against the \ 
non-deserialized version and the other side would use the deserialized version. \ 
Logic is added to BindParameter similar to its “clone” method which will \ 
uniquify the parameter name upon deserialize so that it doesn’t conflict with \ 
its original.

[bug] [tests]
Fixed a few test failures which would occur on Windows due to SQLite file \ 
locking issues, as well as some timing issues in connection pool related tests; \ 
pull request courtesy Federico Caselli.


[orm] [bug]
Fixed issue involving lazy="raise" strategy where an ORM delete of an \ 
object would raise for a simple “use-get” style many-to-one relationship \ 
that had lazy=”raise” configured. This is inconsistent vs. the change \ 
introduced in 1.3 as part of 4353, where it was established that a history \ 
operation that does not expect emit SQL should bypass the lazy="raise" \ 
check, and instead effectively treat it as lazy="raise_on_sql" for \ 
this case. The fix adjusts the lazy loader strategy to not raise for the case \ 
where the lazy load was instructed that it should not emit SQL if the object \ 
were not present.

[orm] [bug]
Fixed regression introduced in 1.3.0 related to the association proxy refactor \ 
in 4351 that prevented composite() attributes from working in terms of an \ 
association proxy that references them.

[orm] [bug]
Setting persistence-related flags on relationship() while also setting \ 
viewonly=True will now emit a regular warning, as these flags do not make sense \ 
for a viewonly=True relationship. In particular, the “cascade” settings have \ 
their own warning that is generated based on the individual values, such as \ 
“delete, delete-orphan”, that should not apply to a viewonly relationship. \ 
Note however that in the case of “cascade”, these settings are still \ 
erroneously taking effect even though the relationship is set up as \ 
“viewonly”. In 1.4, all persistence-related cascade settings will be \ 
disallowed on a viewonly=True relationship in order to resolve this issue.

[orm] [bug] [py3k]
Fixed issue where when assigning a collection to itself as a slice, the mutation \ 
operation would fail as it would first erase the assigned collection \ 
inadvertently. As an assignment that does not change the contents should not \ 
generate events, the operation is now a no-op. Note that the fix only applies to \ 
Python 3; in Python 2, the __setitem__ hook isn’t called in this case; \ 
__setslice__ is used instead which recreates the list item-by-item in all cases.

[orm] [bug]
Fixed issue where by if the “begin” of a transaction failed at the Core \ 
engine/connection level, such as due to network error or database is locked for \ 
some transactional recipes, within the context of the Session procuring that \ 
connection from the conneciton pool and then immediately returning it, the ORM \ 
Session would not close the connection despite this connection not being stored \ 
within the state of that Session. This would lead to the connection being \ 
cleaned out by the connection pool weakref handler within garbage collection \ 
which is an unpreferred codepath that in some special configurations can emit \ 
errors in standard error.

[sql] [bug]
Fixed bug where “distinct” keyword passed to select() would not treat a \ 
string value as a “label reference” in the same way that the \ 
select.distinct() does; it would instead raise unconditionally. This keyword \ 
argument and the others passed to select() will ultimately be deprecated for \ 
SQLAlchemy 2.0.

[sql] [bug]
Changed the text of the exception for “Can’t resolve label reference” to \ 
include other kinds of label coercions, namely that “DISTINCT” is also in \ 
this category under the PostgreSQL dialect.

[sqlite] [bug]
Fixed issue to workaround SQLite’s behavior of assigning “numeric” \ 
affinity to JSON datatypes, first described at Support for SQLite JSON Added, \ 
which returns scalar numeric JSON values as a number and not as a string that \ 
can be JSON deserialized. The SQLite-specific JSON deserializer now gracefully \ 
degrades for this case as an exception and bypasses deserialization for single \ 
numeric values, as from a JSON perspective they are already deserialized.

[mssql] [bug]
Repaired support for the mssql.DATETIMEOFFSET datatype on PyODBC, by adding \ 
PyODBC-level result handlers as it does not include native support for this \ 
datatype. This includes usage of the Python 3 “timezone” tzinfo subclass in \ 
order to set up a timezone, which on Python 2 makes use of a minimal backport of \ 
“timezone” in sqlalchemy.util.
   2019-12-03 19:19:58 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.11

Release 1.3.11 has a significant number of bug fixes across all areas as well as \ 
new use case additions. While it is a "point release", it contains a \ 
few use case additions that amount to new features, as they are needed sooner \ 
than the 1.4 series will be ready. This includes new scalar accessors for JSON \ 
index expressions that work across all JSON-supporting backends as well as \ 
cross-dialect support for the "GENERATED ALWAYS AS" SQL construct, \ 
which allows for an automatically updated expression to be established within \ 
DDL in the database server.
   2019-10-10 20:22:49 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.10



[mssql] [bug]
Fixed bug in SQL Server dialect with new “max_identifier_length” feature \ 
where the mssql dialect already featured this flag, and the implementation did \ 
not accommodate for the new initialization hook correctly.


[oracle] [bug]
Fixed regression in Oracle dialect that was inadvertently using max identifier \ 
length of 128 characters on Oracle server 12.2 and greater even though the \ 
stated contract for the remainder of the 1.3 series is that this value stays at \ 
30 until version SQLAlchemy 1.4. Also repaired issues with the retrieval of the \ 
“compatibility” version, and removed the warning emitted when the \ 
“v$parameter” view was not accessible as this was causing user confusion.



[orm] [bug]
Fixed regression in selectinload loader strategy caused by 4775 (released in \ 
version 1.3.6) where a many-to-one attribute of None would no longer be \ 
populated by the loader. While this was usually not noticeable due to the \ 
lazyloader populating None upon get, it would lead to a detached instance error \ 
if the object were detached.

[orm] [bug]
Passing a plain string expression to Session.query() is deprecated, as all \ 
string coercions were removed in 4481 and this one should have been included. \ 
The literal_column() function may be used to produce a textual column \ 

[orm] [bug]
A warning is emitted for a condition in which the Session may implicitly swap an \ 
object out of the identity map for another one with the same primary key, \ 
detaching the old one, which can be an observed result of load operations which \ 
occur within the SessionEvents.after_flush() hook. The warning is intended to \ 
notify the user that some special condition has caused this to happen and that \ 
the previous object may not be in the expected state.


[engine] [usecase]
Added new create_engine() parameter create_engine.max_identifier_length. This \ 
overrides the dialect-coded “max identifier length” in order to accommodate \ 
for databases that have recently changed this length and the SQLAlchemy dialect \ 
has not yet been adjusted to detect for that version. This parameter interacts \ 
with the existing create_engine.label_length parameter in that it establishes \ 
the maximum (and default) value for anonymously generated labels. Additionally, \ 
post-connection detection of max identifier lengths has been added to the \ 
dialect system. This feature is first being used by the Oracle dialect.


[sql] [bug]
Characters that interfere with “pyformat” or “named” formats in bound \ 
parameters, namely %, (, ) and the space character, as well as a few other \ 
typically undesirable characters, are stripped early for a bindparam() that is \ 
using an anonymized name, which is typically generated automatically from a \ 
named column which itself includes these characters in its name and does not use \ 
a .key, so that they do not interfere either with the SQLAlchemy compiler’s \ 
use of string formatting or with the driver-level parsing of the parameter, both \ 
of which could be demonstrated before the fix. The change only applies to \ 
anonymized parameter names that are generated and consumed internally, not \ 
end-user defined names, so the change should have no impact on any existing \ 
code. Applies in particular to the psycopg2 driver which does not otherwise \ 
quote special parameter names, but also strips leading underscores to suit \ 
Oracle (but not yet leading numbers, as some anon parameters are c
urrently entirely numeric/underscore based); Oracle in any case continues to \ 
quote parameter names that include special characters.

[sql] [usecase]
Added an explicit error message for the case when objects passed to Table are \ 
not SchemaItem objects, rather than resolving to an attribute error.


[sqlite] [usecase]
Added support for sqlite “URI” connections, which allow for sqlite-specific \ 
flags to be passed in the query string such as “read only” for Python \ 
sqlite3 drivers that support this.


[mssql] [bug]
Added identifier quoting to the schema name applied to the “use” statement \ 
which is invoked when a SQL Server multipart schema name is used within a Table \ 
that is being reflected, as well as for Inspector methods such as \ 
Inspector.get_table_names(); this accommodates for special characters or spaces \ 
in the database name. Additionally, the “use” statement is not emitted if \ 
the current database matches the target owner database name being passed.


[oracle] [bug]
Restored adding cx_Oracle.DATETIME to the setinputsizes() call when a SQLAlchemy \ 
Date, DateTime or Time datatype is used, as some complex queries require this to \ 
be present. This was removed in the 1.2 series for arbitrary reasons.

[oracle] [usecase]
The Oracle dialect now emits a warning if Oracle version 12.2 or greater is \ 
used, and the create_engine.max_identifier_length parameter is not set. The \ 
version in this specific case defaults to that of the “compatibility” \ 
version set in the Oracle server configuration, not the actual server version. \ 
In version 1.4, the default max_identifier_length for 12.2 or greater will move \ 
to 128 characters. In order to maintain forwards compatibility, applications \ 
should set create_engine.max_identifier_length to 30 in order to maintain the \ 
same length behavior, or to 128 in order to test the upcoming behavior. This \ 
length determines among other things how generated constraint names are \ 
truncated for statements like CREATE CONSTRAINT and DROP CONSTRAINT, which means \ 
a the new length may produce a name-mismatch against a name that was generated \ 
with the old length, impacting database migrations.


[bug] [tests]
Fixed unit test regression released in 1.3.8 that would cause failure for \ 
Oracle, SQL Server and other non-native ENUM platforms due to new enumeration \ 
tests added as part of 4285 enum sortability in the unit of work; the \ 
enumerations created constraints that were duplicated on name.
   2019-08-28 08:32:52 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.8



[orm] [bug]
Fixed bug where Load objects were not pickleable due to mapper/relationship \ 
state in the internal context dictionary. These objects are now converted to \ 
picklable using similar techniques as that of other elements within the loader \ 
option system that have long been serializable.

[orm] [usecase]
Added support for the use of an Enum datatype using Python pep-435 enumeration \ 
objects as values for use as a primary key column mapped by the ORM. As these \ 
values are not inherently sortable, as required by the ORM for primary keys, a \ 
new TypeEngine.sort_key_function attribute is added to the typing system which \ 
allows any SQL type to implement a sorting for Python objects of its type which \ 
is consulted by the unit of work. The Enum type then defines this using the \ 
database value of a given enumeration. The sorting scheme can be also be \ 
redefined by passing a callable to the Enum.sort_key_function parameter. Pull \ 
request courtesy Nicolas Caniart.


[engine] [feature]
Added new parameter create_engine.hide_parameters which when set to True will \ 
cause SQL parameters to no longer be logged, nor rendered in the string \ 
representation of a StatementError object.

[engine] [bug]
Fixed an issue whereby if the dialect “initialize” process which occurs on \ 
first connect would encounter an unexpected exception, the initialize process \ 
would fail to complete and then no longer attempt on subsequent connection \ 
attempts, leaving the dialect in an un-initialized, or partially initialized \ 
state, within the scope of parameters that need to be established based on \ 
inspection of a live connection. The “invoke once” logic in the event system \ 
has been reworked to accommodate for this occurrence using new, private API \ 
features that establish an “exec once” hook that will continue to allow the \ 
initializer to fire off on subsequent connections, until it completes without \ 
raising an exception. This does not impact the behavior of the existing \ 
once=True flag within the event system.


[postgresql] [bug]
Revised the approach for the just added support for the psycopg2 \ 
“execute_values()” feature added in 1.3.7. The approach relied upon a \ 
regular expression that would fail to match for a more complex INSERT statement \ 
such as one which had subqueries involved. The new approach matches exactly the \ 
string that was rendered as the VALUES clause.

[postgresql] [bug]
Fixed bug where Postgresql operators such as \ 
postgresql.ARRAY.Comparator.contains() and \ 
postgresql.ARRAY.Comparator.contained_by() would fail to function correctly for \ 
non-integer values when used against a postgresql.array object, due to an \ 
erroneous assert statement.

[postgresql] [usecase]
Added support for reflection of CHECK constraints that include the special \ 
PostgreSQL qualifier “NOT VALID”, which can be present for CHECK constraints \ 
that were added to an exsiting table with the directive that they not be applied \ 
to existing data in the table. The PostgreSQL dictionary for CHECK constraints \ 
as returned by Inspector.get_check_constraints() may include an additional entry \ 
dialect_options which within will contain an entry "not_valid": True \ 
if this symbol is detected. Pull request courtesy Bill Finn.


[sqlite] [bug] [reflection]
Fixed bug where a FOREIGN KEY that was set up to refer to the parent table by \ 
table name only without the column names would not correctly be reflected as far \ 
as setting up the “referred columns”, since SQLite’s PRAGMA does not \ 
report on these columns if they weren’t given explicitly. For some reason this \ 
was harcoded to assume the name of the local column, which might work for some \ 
cases but is not correct. The new approach reflects the primary key of the \ 
referred table and uses the constraint columns list as the referred columns \ 
list, if the remote column(s) aren’t present in the reflected pragma directly.
   2019-08-26 12:26:49 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.7


Released: August 14, 2019

[orm] [bug]
Fixed regression caused by new selectinload for many-to-one logic where a \ 
primaryjoin condition not based on real foreign keys would cause KeyError if a \ 
related object did not exist for a given key value on the parent object.

[orm] [bug]
Fixed bug where using Query.first() or a slice expression in conjunction with a \ 
query that has an expression based “offset” applied would raise TypeError, \ 
due to an “or” conditional against “offset” that did not expect it to be \ 
a SQL expression as opposed to an integer or None.


[sql] [bug]
Fixed issue where Index object which contained a mixture of functional \ 
expressions which were not resolvable to a particular column, in combination \ 
with string-based column names, would fail to initialize its internal state \ 
correctly leading to failures during DDL compilation.

[sql] [bug]
Fixed bug where TypeEngine.column_expression() method would not be applied to \ 
subsequent SELECT statements inside of a UNION or other CompoundSelect, even \ 
though the SELECT statements are rendered at the topmost level of the statement. \ 
New logic now differentiates between rendering the column expression, which is \ 
needed for all SELECTs in the list, vs. gathering the returned data type for the \ 
result row, which is needed only for the first SELECT.

[sql] [bug]
Fixed issue where internal cloning of SELECT constructs could lead to a key \ 
error if the copy of the SELECT changed its state such that its list of columns \ 
changed. This was observed to be occurring in some ORM scenarios which may be \ 
unique to 1.3 and above, so is partially a regression fix.


[postgresql] [usecase]
Added new dialect flag for the psycopg2 dialect, executemany_mode which \ 
supersedes the previous experimental use_batch_mode flag. executemany_mode \ 
supports both the “execute batch” and “execute values” functions \ 
provided by psycopg2, the latter which is used for compiled insert() constructs. \ 
Pull request courtesy Yuval Dinari.
See also
Psycopg2 Fast Execution Helpers


[mysql] [bug]
The MySQL dialects will emit “SET NAMES” at the start of a connection when \ 
charset is given to the MySQL driver, to appease an apparent behavior observed \ 
in MySQL 8.0 that raises a collation error when a UNION includes string columns \ 
unioned against columns of the form CAST(NULL AS CHAR(..)), which is what \ 
SQLAlchemy’s polymorphic_union function does. The issue seems to have affected \ 
PyMySQL for at least a year, however has recently appeared as of mysqlclient \ 
1.4.4 based on changes in how this DBAPI creates a connection. As the presence \ 
of this directive impacts three separate MySQL charset settings which each have \ 
intricate effects based on their presense, SQLAlchemy will now emit the \ 
directive on new connections to ensure correct behavior.

[mysql] [bug]
Added another fix for an upstream MySQL 8 issue where a case sensitive table \ 
name is reported incorrectly in foreign key constraint reflection, this is an \ 
extension of the fix first added for 4344 which affects a case sensitive column \ 
name. The new issue occurs through MySQL 8.0.17, so the general logic of the \ 
88718 fix remains in place.
See also
https://bugs.mysql.com/bug.php?id=96365 - upstream bug

[mysql] [usecase]
Added reserved words ARRAY and MEMBER to the MySQL reserved words list, as MySQL \ 
8.0 has now made these reserved.


[sqlite] [bug]
The dialects that support json are supposed to take arguments json_serializer \ 
and json_deserializer at the create_engine() level, however the SQLite dialect \ 
calls them _json_serilizer and _json_deserilalizer. The names have been \ 
corrected, the old names are accepted with a change warning, and these \ 
parameters are now documented as create_engine.json_serializer and \ 

[sqlite] [bug]
Fixed bug where usage of “PRAGMA table_info” in SQLite dialect meant that \ 
reflection features to detect for table existence, list of table columns, and \ 
list of foreign keys, would default to any table in any attached database, when \ 
no schema name was given and the table did not exist in the base schema. The fix \ 
explicitly runs PRAGMA for the ‘main’ schema and then the ‘temp’ schema \ 
if the ‘main’ returned no rows, to maintain the behavior of tables + temp \ 
tables in the “no schema” namespace, attached tables only in the \ 
“schema” namespace.


[mssql] [usecase]
Added new mssql.try_cast() construct for SQL Server which emits “TRY_CAST” \ 
syntax. Pull request courtesy Leonel Atencio.


[bug] [events]
Fixed issue in event system where using the once=True flag with dynamically \ 
generated listener functions would cause event registration of future events to \ 
fail if those listener functions were garbage collected after they were used, \ 
due to an assumption that a listened function is strongly referenced. The \ 
“once” wrapped is now modified to strongly reference the inner function \ 
persistently, and documentation is updated that using “once” does not imply \ 
automatic de-registration of listener functions.



[orm] [feature]
Added new loader option method Load.options() which allows loader options to be \ 
constructed hierarchically, so that many sub-options can be applied to a \ 
particular path without needing to call defaultload() many times. Thanks to \ 
Alessio Bogon for the idea.

[orm] [bug]
Fixed regression caused by 4365 where a join from an entity to itself without \ 
using aliases no longer raises an informative error message, instead failing on \ 
an assertion. The informative error condition has been restored.

[orm] [bug]
Fixed an issue where the orm._ORMJoin.join() method, which is a \ 
not-internally-used ORM-level method that exposes what is normally an internal \ 
process of Query.join(), did not propagate the full and outerjoin keyword \ 
arguments correctly. Pull request courtesy Denis Kataev.

[orm] [bug]
Fixed bug where a many-to-one relationship that specified uselist=True would \ 
fail to update correctly during a primary key change where a related column \ 
needs to change.

[orm] [bug]
Fixed bug where the detection for many-to-one or one-to-one use with a \ 
“dynamic” relationship, which is an invalid configuration, would fail to \ 
raise if the relationship were configured with uselist=True. The current fix is \ 
that it warns, instead of raises, as this would otherwise be backwards \ 
incompatible, however in a future release it will be a raise.

[orm] [bug]
Fixed bug where a synonym created against a mapped attribute that does not exist \ 
yet, as is the case when it refers to backref before mappers are configured, \ 
would raise recursion errors when trying to test for attributes on it which \ 
ultimately don’t exist (as occurs when the classes are run through Sphinx \ 
autodoc), as the unconfigured state of the synonym would put it into an \ 
attribute not found loop.

[orm] [performance]
The optimization applied to selectin loading in 4340 where a JOIN is not needed \ 
to eagerly load related items is now applied to many-to-one relationships as \ 
well, so that only the related table is queried for a simple join condition. In \ 
this case, the related items are queried based on the value of a foreign key \ 
column on the parent; if these columns are deferred or otherwise not loaded on \ 
any of the parent objects in the collection, the loader falls back to the JOIN \ 


[engine] [bug]
Fixed bug where using reflection function such as MetaData.reflect() with an \ 
Engine object that had execution options applied to it would fail, as the \ 
resulting OptionEngine proxy object failed to include a .engine attribute used \ 
within the reflection routines.


[sql] [bug]
Adjusted the initialization for Enum to minimize how often it invokes the \ 
.__members__ attribute of a given PEP-435 enumeration object, to suit the case \ 
where this attribute is expensive to invoke, as is the case for some popular \ 
third party enumeration libraries.

[sql] [bug] [postgresql]
oduce the correct operator precedence in combination with the array index operator.

[sql] [bug]
Fixed an unlikely issue where the “corresponding column” routine for unions \ 
and other CompoundSelect objects could return the wrong column in some \ 
overlapping column situtations, thus potentially impacting some ORM operations \ 
when set operations are in use, if the underlying select() constructs were used \ 
previously in other similar kinds of routines, due to a cached value not being \ 


[postgresql] [usecase]
Added support for reflection of indexes on PostgreSQL partitioned tables, which \ 
was added to PostgreSQL as of version 11.

[postgresql] [usecase]
Added support for multidimensional Postgresql array literals via nesting the \ 
postgresql.array object within another one. The multidimensional array type is \ 
detected automatically.
See also


[mysql] [bug]
Fixed bug where the special logic to render “NULL” for the TIMESTAMP \ 
datatype when nullable=True would not work if the column’s datatype were a \ 
TypeDecorator or a Variant. The logic now ensures that it unwraps down to the \ 
original TIMESTAMP so that this special case NULL keyword is correctly rendered \ 
when requested.

[mysql] [bug]
Enhanced MySQL/MariaDB version string parsing to accommodate for exotic MariaDB \ 
version strings where the “MariaDB” word is embedded among other \ 
alphanumeric characters such as “MariaDBV1”. This detection is critical in \ 
order to correctly accommodate for API features that have split between MySQL \ 
and MariaDB such as the “transaction_isolation” system variable.


[sqlite] [usecase]
Added support for composite (tuple) IN operators with SQLite, by rendering the \ 
VALUES keyword for this backend. As other backends such as DB2 are known to use \ 
the same syntax, the syntax is enabled in the base compiler using a \ 
dialect-level flag tuple_in_values. The change also includes support for \ 
“empty IN tuple” expressions for SQLite when using “in_()” between a \ 
tuple value and an empty set.


[mssql] [bug]
Ensured that the queries used to reflect indexes and view definitions will \ 
explicitly CAST string parameters into NVARCHAR, as many SQL Server drivers \ 
frequently treat string values, particularly those with non-ascii characters or \ 
larger string values, as TEXT which often don’t compare correctly against \ 
VARCHAR characters in SQL Server’s information schema tables for some reason. \ 
These CAST operations already take place for reflection queries against SQL \ 
Server information_schema. tables but were missing from three additional queries \ 
that are against sys. tables.
   2019-07-03 22:19:11 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.5



[orm] [bug]
Fixed a series of related bugs regarding joined table inheritance more than two \ 
levels deep, in conjunction with modification to primary key values, where those \ 
primary key columns are also linked together in a foreign key relationship as is \ 
typical for joined table inheritance. The intermediary table in a three-level \ 
inheritance hierachy will now get its UPDATE if only the primary key value has \ 
changed and passive_updates=False (e.g. foreign key constraints not being \ 
enforced), whereas before it would be skipped; similarly, with \ 
passive_updates=True (e.g. ON UPDATE CASCADE in effect), the third-level table \ 
will not receive an UPDATE statement as was the case earlier which would fail \ 
since CASCADE already modified it. In a related issue, a relationship linked to \ 
a three-level inheritance hierarchy on the primary key of an intermediary table \ 
of a joined-inheritance hierarchy will also correctly have its foreign key \ 
column updated when the parent object’s primary key is modif
ied, even if that parent object is a subclass of the linked parent class, \ 
whereas before these classes would not be counted.

[orm] [bug]
Fixed bug where the Mapper.all_orm_descriptors accessor would return an entry \ 
for the Mapper itself under the declarative __mapper___ key, when this is not a \ 
descriptor. The .is_attribute flag that’s present on all InspectionAttr \ 
objects is now consulted, which has also been modified to be True for an \ 
association proxy, as it was erroneously set to False for this object.

[orm] [bug]
Fixed regression in Query.join() where the aliased=True flag would not properly \ 
apply clause adaptation to filter criteria, if a previous join were made to the \ 
same entity. This is because the adapters were placed in the wrong order. The \ 
order has been reversed so that the adapter for the most recent aliased=True \ 
call takes precedence as was the case in 1.2 and earlier. This broke the \ 
“elementtree” examples among other things.

[orm] [bug] [py3k]
Replaced the Python compatbility routines for getfullargspec() with a fully \ 
vendored version from Python 3.3. Originally, Python was emitting deprecation \ 
warnings for this function in Python 3.8 alphas. While this change was reverted, \ 
it was observed that Python 3 implementations for getfullargspec() are an order \ 
of magnitude slower as of the 3.4 series where it was rewritten against \ 
Signature. While Python plans to improve upon this situation, SQLAlchemy \ 
projects for now are using a simple replacement to avoid any future issues.

[orm] [bug]
Reworked the attribute mechanics used by AliasedClass to no longer rely upon \ 
calling __getattribute__ on the MRO of the wrapped class, and to instead resolve \ 
the attribute normally on the wrapped class using getattr(), and then \ 
unwrap/adapt that. This allows a greater range of attribute styles on the mapped \ 
class including special __getattr__() schemes; but it also makes the code \ 
simpler and more resilient in general.


[sql] [bug]
Fixed a series of quoting issues which all stemmed from the concept of the \ 
literal_column() construct, which when being “proxied” through a subquery to \ 
be referred towards by a label that matches its text, the label would not have \ 
quoting rules applied to it, even if the string in the Label were set up as a \ 
quoted_name construct. Not applying quoting to the text of the Label is a bug \ 
because this text is strictly a SQL identifier name and not a SQL expression, \ 
and the string should not have quotes embedded into it already unlike the \ 
literal_column() which it may be applied towards. The existing behavior of a \ 
non-labeled literal_column() being propagated as is on the outside of a subquery \ 
is maintained in order to help with manual quoting schemes, although it’s not \ 
clear if valid SQL can be generated for such a construct in any case.


[postgresql] [bug]
Fixed bug where PostgreSQL dialect could not correctly reflect an ENUM datatype \ 
that has no members, returning a list with None for the get_enums() call and \ 
raising a TypeError when reflecting a column which has such a datatype. The \ 
inspection now returns an empty list.

[postgresql] [usecase]
Added support for column sorting flags when reflecting indexes for PostgreSQL, \ 
including ASC, DESC, NULLSFIRST, NULLSLAST. Also adds this facility to the \ 
reflection system in general which can be applied to other dialects in future \ 
releases. Pull request courtesy Eli Collins.


[mysql] [bug]
Fixed bug where MySQL ON DUPLICATE KEY UPDATE would not accommodate setting a \ 
column to the value NULL.
   2019-05-29 23:11:51 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-sqlalchemy: updated to 1.3.4


[orm] [bug]
Fixed issue where the AttributeEvents.active_history flag would not be set for \ 
an event listener that propgated to a subclass via the AttributeEvents.propagate \ 
flag. This bug has been present for the full span of the AttributeEvents system.

[orm] [bug]
Fixed regression where new association proxy system was still not proxying \ 
hybrid attributes when they made use of the @hybrid_property.expression \ 
decorator to return an alternate SQL expression, or when the hybrid returned an \ 
arbitrary PropComparator, at the expression level. This involved futher \ 
generalization of the heuristics used to detect the type of object being proxied \ 
at the level of QueryableAttribute, to better detect if the descriptor \ 
ultimately serves mapped classes or column expressions.

[orm] [bug]
Applied the mapper “configure mutex” against the declarative class mapping \ 
process, to guard against the race which can occur if mappers are used while \ 
dynamic module import schemes are still in the process of configuring mappers \ 
for related classes. This does not guard against all possible race conditions, \ 
such as if the concurrent import has not yet encountered the dependent classes \ 
as of yet, however it guards against as much as possible within the SQLAlchemy \ 
declarative process.

[orm] [bug]
A warning is now emitted for the case where a transient object is being merged \ 
into the session with Session.merge() when that object is already transient in \ 
the Session. This warns for the case where the object would normally be \ 

[orm] [bug]
Fixed regression in new relationship m2o comparison logic first introduced at \ 
Improvement to the behavior of many-to-one query expressions when comparing to \ 
an attribute that is persisted as NULL and is in an un-fetched state in the \ 
mapped instance. Since the attribute has no explicit default, it needs to \ 
default to NULL when accessed in a persistent setting.

[engine] [bug] [postgresql]
Moved the “rollback” which occurs during dialect initialization so that it \ 
occurs after additional dialect-specific initialize steps, in particular those \ 
of the psycopg2 dialect which would inadvertently leave transactional state on \ 
the first new connection, which could interfere with some psycopg2-specific APIs \ 
which require that no transaction is started. Pull request courtesy Matthew \ 

[sql] [bug]
Fixed that the GenericFunction class was inadvertently registering itself as one \ 
of the named functions. Pull request courtesy Adrien Berchet.

[sql] [bug]
Fixed issue where double negation of a boolean column wouldn’t reset the \ 
“NOT” operator.

[sql] [bug]
The GenericFunction namespace is being migrated so that function names are \ 
looked up in a case-insensitive manner, as SQL functions do not collide on case \ 
sensitive differences nor is this something which would occur with user-defined \ 
functions or stored procedures. Lookups for functions declared with \ 
GenericFunction now use a case insensitive scheme, however a deprecation case is \ 
supported which allows two or more GenericFunction objects with the same name of \ 
different cases to exist, which will cause case sensitive lookups to occur for \ 
that particular name, while emitting a warning at function registration time. \ 
Thanks to Adrien Berchet for a lot of work on this complicated feature.

[postgresql] [bug] [orm]
Fixed an issue where the “number of rows matched” warning would emit even if \ 
the dialect reported “supports_sane_multi_rowcount=False”, as is the case \ 
for psycogp2 with use_batch_mode=True and others.

[mysql] [bug]
Added support for DROP CHECK constraint which is required by MySQL 8.0.16 to \ 
drop a CHECK constraint; MariaDB supports plain DROP CONSTRAINT. The logic \ 
distinguishes between the two syntaxes by checking the server version string for \ 
MariaDB presence. Alembic migrations has already worked around this issue by \ 
implementing its own DROP for MySQL / MariaDB CHECK constraints, however this \ 
change implements it straight in Core so that its available for general use. \ 
Pull request courtesy Hannes Hansen.

[mssql] [feature]
Added support for SQL Server filtered indexes, via the mssql_where parameter \ 
which works similarly to that of the postgresql_where index function in the \ 
PostgreSQL dialect.

[mssql] [bug]
Added error code 20047 to “is_disconnect” for pymssql. Pull request courtesy \ 
Jon Schuff.

[misc] [bug]
Removed errant “sqla_nose.py” symbol from MANIFEST.in which created an \ 
undesirable warning message.