| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Resolve the following RemovedIn20Warning warning:
Using non-integer/slice indices on Row is deprecated and will be
removed in version 2.0; please use row._mapping[<key>], or the
mappings() accessor on the Result object.
Change-Id: I3a4845216914635e5802a70c2b1be757d82b7a49
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid the following warning seen in e.g. nova unit tests:
WARNING oslo_db.sqlalchemy.engines [-] URL postgresql://.../foo does
not contain a '+drivername' portion, and will make use of a default
driver.
A full dbname+drivername:// protocol is recommended.
The 'psycopg2' driver is chosen since this is the default for SQLAlchemy
[1] and therefore what we're currently using.
[1] https://docs.sqlalchemy.org/en/14/core/engines.html#postgresql
Change-Id: I0f8f358a49a83366d7dec17e7bac346453f3027b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Resolve the following RemovedIn20Warning:
The update.whereclause parameter will be removed in SQLAlchemy 2.0.
Please refer to the Update.where() method.
Change-Id: I50064d16de6e1951b2282fcf9548a0ff2cd0fe55
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Resolve the following RemovedIn20Warning warning:
The update.values parameter will be removed in SQLAlchemy 2.0. Please
refer to the Update.values() method.
Change-Id: I426605aa8f4332fd0b7d9f6fa0e97d7e02c7cbdc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resolve the following RemovedIn20Warning warning:
Passing a string to Connection.execute() is deprecated and will be
removed in version 2.0. Use the text() construct, or the
Connection.exec_driver_sql() method to invoke a driver-level SQL
string.
Change-Id: I1faa8c957649a04aa080518651045b432c6bd372
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Resolves the following RemovedIn20Warning warning:
The MetaData.bind argument is deprecated and will be removed in
SQLAlchemy 2.0.
Change-Id: I468048c01455d9dfe12004736c181806dc218e37
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Resolve the following SADeprecationWarning warning:
The legacy calling style of select() is deprecated and will be removed
in SQLAlchemy 2.0. Please use the new calling style described at
select().
Change-Id: Ic5f7240e790425d2689c6870483748650a49bc3d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
| |
These are using private APIs of SQLAlchemy but, more importantly, are
not necessary in an alembic-only world. Mark them deprecated for
removal.
Change-Id: I6efb6e1d35542cd8df922c86e134fe1e0b8c2e52
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Highlight use of deprecated SQLAlchemy APIs to ensure we keep on top of
things. This requires resolving the following SADeprecationWarning
warnings:
The from_engine() method on Inspector is deprecated and will be
removed in a future release. Please use the sqlalchemy.inspect()
function on an Engine or Connection in order to acquire an Inspector.
The Column.copy() method is deprecated and will be removed in a future
release.
The ColumnCollectionConstraint.copy() method is deprecated and will be
removed in a future release.
There are more warnings to be resolved related to SQLAlchemy 2.0, but
those require a special environment option (SQLALCHEMY_WARN_20) to
trigger and a lot of work to resolve. We'll address those in a series of
follow-ups.
Change-Id: I34b395e6d50f4e4151178c327d94308e6f5d5b6e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This hasn't been supported by any project for many years. Quoting from
the nova patch that removed DB2 support [1]
This removes db2 support from tree completely. This is an oddball non
open database that made doing live data migrations difficult. It is
used by 0% of users in the OpenStack User Survey.
Supporting commercial software that doesn't have users at the cost of
delivering features and fixes to our community is the wrong tradeoff.
This corrects that.
There's no need to keep this around.
[1] Ifeb9929e4515e3483eb65d371126afd7672b92a4
Change-Id: I8c3f23083e09e5ac924e35d1b7b3248a0d074e1b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The 'check_foreign_key' method was removed in oslo.db 1.4.0 [1] and
re-added but marked as deprecated in 1.4.1 [2] to allow for a
deprecation period. That was over 6 years ago so we can now remove it.
Meanwhile, the private '_walk_versions', '_migrate_down' and
'_migrate_up' methods have been marked as deprecated since oslo.db 0.5.0
(!!!) [3]. We can definitely remove these now. codesearch.o.o reveals no
users of any of these methods.
[1] I77a2bba2de08125b5a601de03c1d2d5c73fa33ee
[2] Id892567bd60d6b4b88765bbfe3cd5c5e75910b25
[3] Ic9358445e60a0dd43a5900e8bda7b12f2bebf679
Change-Id: Idb9596284df3e5d038c939d27fe14fe2cc2f4318
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|/
|
|
|
|
|
|
|
| |
We already state a minimum in our requirements.txt files to prevent use
of this package with older alembic and sqlalchemy releases, making these
checks simply noise. Remove them.
Change-Id: Ie3fbc54aa0c791e6e8ca3164c95051039e82b0e3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Resolves the following warning that has been popping up on tests:
SAWarning: TypeDecorator SoftDeleteInteger() will not produce a cache
key because the ``cache_ok`` flag is not set to True. Set this flag
to True if this type object's state is safe to use in a cache key, or
False to disable this warning.
Both SoftDeleteInteger and the various subclasses of 'JsonEncodedType'
are hashable and should return a consistent hash and key. For more
information, refer to the SQLAlchemy docs [1].
[1] https://docs.sqlalchemy.org/en/14/core/custom_types.html#sqlalchemy.types.TypeDecorator.cache_ok
Change-Id: Idf6fd858fad9521c7c5ba82c31b6d3077756abd9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
We return the value in the if condition, so the else is not necessary.
Change-Id: I1de4b7f7f7ea3634e3a2d49704f689205f746085
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The option was replaced 4 years ago[1] by connection_recycle_time. The
option is not anymore present in sqlalchemy. It's the good time to
remove it.
[1] https://opendev.org/openstack/oslo.db/commit/6634218415906192fca891362b8fa0ac50b66284
Change-Id: I0c26c3e14ad9ad9a4f30af80757e369d6042441a
|
|\ \ \
| |_|/
|/| | |
|
| |/
| |
| |
| |
| |
| |
| |
| | |
getargspec() is deprecated since py3
[1] https://docs.python.org/3/library/inspect.html#inspect.getargspec
Change-Id: Ie1513f9b4911e54ce6714074eb2dc4052323ef42
|
|/
|
|
|
|
|
|
|
|
|
| |
In mysql 8.0.19 , Duplicate key error information is extended to
include the table name of the key.Previously, duplicate key error
information included only the key value and key name.
Unit tests are provided for updated changes.
Change-Id: Ic78059b625e73cece355541cb4d89e641abc1103
Closes-Bug: #1896916
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Another change for SQLAlchemy 1.4 is the mechanics
of how the ``QueryContext`` object works. Update the
update_match extension such that it does not rely upon the
``QueryContext`` object and uses public APIs instead.
Change-Id: I27e20e59bce8c98b5a507c617364652aa6eb33f5
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
SQLAlchemy 1.4 has modified the URL object to be immutable.
This patch makes the adjustments needed, using duck-typing
to check if the URL object is of the new style. When
requirements reach SQLAlchemy 1.4 as the minimum required
version, these conditionals should be removed in favor of
the noted option in each.
Change-Id: Id2f0663b13ed0f81e91a8d44f73d8541015bf844
|
| |
| |
| |
| | |
Change-Id: Ia782bc7127a1cb967e2f475065b1fb963b9c184f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This API allowed users to abstract the differences between
sqlalchemy-migrate and alembic. However, no one is using it for that and
its continued existence necessitates continued support for
sqlalchemy-migrate. Deprecate it now and encourage the odd user to
switch to alembic directly.
Change-Id: Ia5979369f23b38a2c7307f4112651a8bedb45c01
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|/
|
|
|
|
|
|
|
| |
This module hasn't been touched with years and 'sqlalchemy-migrate' is
effectively abandoned. It's time to drop support for this an encourage
the laggards to switch to alembic and use it directly.
Change-Id: I59335b4f318bae2e29ab139cdea089a4d6e14305
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
| |
Change-Id: Icea747aff5fe51b96c70d263fa0f0e2e9c5ab917
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
blacklist:
W504 line break after binary operator
Fix:
E305 expected 2 blank lines after class or function definition, found 1
Change-Id: I56d62f67914f07e7aef74f857c4b42e3bfd3416e
|
|
|
|
|
|
|
|
|
| |
Nothing appears to be using this, based on codesearch.o.o, and it's
useless. Drop it.
Change-Id: I9ce39e69a6fdb2e216da9fd903b5dc8aa7eaab80
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Sem-Ver: api-break
|
|
|
|
|
|
|
| |
No need for this in a Python 3-only world.
Change-Id: I8923f2b87c1bd114b8c55210100c7485a0de8f28
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Per [1], this is the latest supported version of SQLAlchemy. 1.1.x and
earlier are EOL.
[1] https://www.sqlalchemy.org/download.html#relstatus
Change-Id: I63e4baf772be9ddfb787ac3aff01fcaddf7b901c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|
|
|
|
|
| |
Change-Id: I6ea68fb17ceac23337bfb7405eb3f7a6df8b61f2
Closes-Bug: 1851797
|
|
|
|
|
|
|
|
|
|
| |
SQLAlchemy 1.4 will be adding stricter rules to Connection objects
such that a new transaction cannot be started while an old one hasn't
been cleared. Ensure this particular test fixture clears
the "savepoint" transaction first before starting a new one.
References: https://github.com/sqlalchemy/sqlalchemy/issues/4712
Change-Id: Idcb616fd3add4d58f22b91865cec8a54fe492093
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Today, when a user uses enginefacade reader/writer decorators
he/she is forced to pass the context argument as the
first positional argument. performing a decorated function
call with this argument passed as a keyword would lead to
an out of range exception.
This patch proposes to add support for the context argument
to be passed as a keyword argument in decorated functions.
e.g
@enginefacade.reader
def foo(context):
...
foo(context=ctxt) <- will now be possible
Change-Id: Ief0b71bf9a7eb75935612431bdcc26d33bce852d
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The database option min_pool_size is not actually
used in oslo.db.
This is a folllow up to
Ib07b7b4200b5cf3a34b8eed441e6754da7d446cf
Change-Id: I89754e9e4b42c45259729b0b0bb0a4bf464a981c
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This addresses two sources of deprecation warnings.
The collections package has moved ABC classes under collections.abc. Six
does not support this move yet, so this updates the code to try to
import from the newer locations, and if that fails, import from the old
location.
Py36 is also more strict about escape sequences in strings. This happens
move often with regex strings that are valid regex but not a valid
normal string escape sequence. This addresses those errors by switching
to raw strings.
Change-Id: I4c61df6b6432b135297f38c02b4538e4ba56be51
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We currently see a lot of warnings like this from
the soft_delete() method:
sqlalchemy.exc.SAWarning: Evaluating non-mapped column expression
'updated_at' onto ORM instances; this is a deprecated use case.
Please make use of the actual mapped columns in ORM-evaluated
UPDATE / DELETE expressions.
This is because the "evaluate" synchronization strategy would like
to search for objects and update them based on the UPDATE criteria
passed, however the columns given, literal_column('id'),
literal_column('updated_at'), are not mapped to anything. The
evaluator has to make a guess that the string contained in these
expressions should be matched to a mapped attribute on the given
entity and this guess was first removed in [1], then added back in
[2] with a warning (likely since oslo.db is invoking it).
This uses the actual entity-mapped column for the query rather
than the literal string column.
[1] https://docs.sqlalchemy.org/en/latest/changelog/changelog_12.html#change-b1e620dece39006ab44c47044e9a6fee
[2] https://docs.sqlalchemy.org/en/latest/changelog/changelog_12.html#change-dff3a469788c81a46440584406cb22be
Change-Id: I192e84ce757d12d33085a209dd58d8ea46fb90fb
Closes-Bug: #1814199
|
|/
|
|
|
|
|
|
|
|
|
| |
MariasDB/Galera cluster server produces an error like:
(1213, u'Deadlock: wsrep aborted transaction')
which is currently not detected properly and, thus, not retried.
Change-Id: Ifb4a81d50e490e734e12986e51efd6bd3c339c31
Signed-off-by: Pierre-Samuel Le Stang <pierre-samuel.le-stang@corp.ovh.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
update the hacking to latest, due to [1]
[1]: https://github.com/openstack/oslo.db/blob/master/HACKING.rst
Change-Id: I04147f3cbcb9c89a9a1afc1bcb299be8bdf06718
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This flag is to be deprecated in SQLAlchemy version 1.3,
as it is a leftover from the pre-Python 3 legacy days when
DBAPIs under Python 2 would crash if you passed them a
u'' object. While still available in 1.3, it will emit a
deprecation warning, so it's time to stop using this flag and to
locate any downstream Openstack projects that might be relying
on its behavior in a Python 2 context; the flag has no real effect
on Python 3.
Change-Id: I01984b4ff7e03dcf91ef8dcb05da67dda8270ae3
References: https://github.com/sqlalchemy/sqlalchemy/issues/4393
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Raising warnings from an exception module can result in a rather
confusing message:
Running command: '/usr/bin/nova-scheduler '
/.../sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
exception.NotSupportedWarning
For someone not used to Python's 'warning' infrastructure, this can look
worse than it is, as seen at [1].
While this particular warning was resolved in change I4a5f8958c3e, it's
possible that a similar warning could be raised for other options. Best
to move this out of the 'exception' module and into something more
sensible.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1639423
Change-Id: I8e0480fb11123067a111ed6aeda6b47614615645
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
|