summaryrefslogtreecommitdiff
path: root/oslo_db
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-07-19 10:37:39 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-08-10 16:53:47 +0100
commit8772fcc349226b152e8a04a8ed3e883231412043 (patch)
treed65fa799bbee79b3e72a71394fa19425b97dc68d /oslo_db
parent5544f1033fdbbfe7fba170c82407df0dbb78ad10 (diff)
downloadoslo-db-8772fcc349226b152e8a04a8ed3e883231412043.tar.gz
Don't use the 'Row.keys()' method
Resolve the following RemovedIn20Warning warning: The Row.keys() method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. Use the namedtuple standard accessor Row._fields, or for full mapping behavior use row._mapping.keys() Change-Id: I647a57909df56fec7b570ae29efbc731126df14d Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db')
-rw-r--r--oslo_db/tests/fixtures.py5
-rw-r--r--oslo_db/tests/sqlalchemy/test_update_match.py2
2 files changed, 1 insertions, 6 deletions
diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py
index 7db7b78..20b8a38 100644
--- a/oslo_db/tests/fixtures.py
+++ b/oslo_db/tests/fixtures.py
@@ -59,11 +59,6 @@ class WarningsFixture(fixtures.Fixture):
warnings.filterwarnings(
'once',
- message=r'The Row.keys\(\) method is considered legacy .*',
- category=sqla_exc.SADeprecationWarning)
-
- warnings.filterwarnings(
- 'once',
message=r'Retrieving row members using strings or other .*',
category=sqla_exc.SADeprecationWarning)
diff --git a/oslo_db/tests/sqlalchemy/test_update_match.py b/oslo_db/tests/sqlalchemy/test_update_match.py
index fdd1887..b4c025b 100644
--- a/oslo_db/tests/sqlalchemy/test_update_match.py
+++ b/oslo_db/tests/sqlalchemy/test_update_match.py
@@ -122,7 +122,7 @@ class UpdateMatchTest(db_test_base._DbTestCase):
sql.select(MyModel.__table__).where(MyModel.__table__.c.id == pk)
).first()
values['id'] = pk
- self.assertEqual(values, dict(row))
+ self.assertEqual(values, dict(row._mapping))
def test_update_specimen_successful(self):
uuid = '136254d5-3869-408f-9da7-190e0072641a'