diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-12-31 11:53:07 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-12-31 16:13:13 -0500 |
| commit | 7210595a79cd33b3b0da48db2806856fe018f495 (patch) | |
| tree | cb4a3240b8577bd2b138f365fc728848cd317cdc /lib/sqlalchemy | |
| parent | 65428cf95023a462ec452d7c6a1a6aff7c4c20a4 (diff) | |
| download | sqlalchemy-7210595a79cd33b3b0da48db2806856fe018f495.tar.gz | |
Repair uncovered warning in persistnce.py; update versioning tests
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.
As part of this change, we would like to establish that versionining-
related warnings are not expected to emit for the core set of
test-covered dialects, and if they are we would like the check for
warning emitted to be explicit, rather than an ignore.
Fixes: #5068
Change-Id: Iee097554e43cbb54ced1be056635809e67cf30d6
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/engine/default.py | 7 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/persistence.py | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 7016adcf4..bfc6dfee8 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -271,6 +271,13 @@ class DefaultDialect(interfaces.Dialect): @property def supports_sane_rowcount_returning(self): + """True if this dialect supports sane rowcount even if RETURNING is + in use. + + For dialects that don't support RETURNING, this is synomous + with supports_sane_rowcount. + + """ return self.supports_sane_rowcount @classmethod diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index 58c8bcc06..3ba4907df 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -1336,8 +1336,7 @@ def _emit_delete_statements( util.warn( "Dialect %s does not support deleted rowcount " "- versioning cannot be verified." - % connection.dialect.dialect_description, - stacklevel=12, + % connection.dialect.dialect_description ) connection.execute(statement, del_objects) else: |
