@@ -5751,14 +5751,15 @@ def test_archive_deleted_rows(self):
5751
5751
where (self .instance_id_mappings .c .uuid .in_ (self .uuidstrs [:4 ]))\
5752
5752
.values (deleted = 1 , deleted_at = timeutils .utcnow ())
5753
5753
self .conn .execute (update_statement )
5754
- qiim = sql .select ([self .instance_id_mappings ]).where (self .
5755
- instance_id_mappings .c .uuid .in_ (self .uuidstrs ))
5754
+ qiim = sql .select (self .instance_id_mappings ).where (
5755
+ self .instance_id_mappings .c .uuid .in_ (self .uuidstrs )
5756
+ )
5756
5757
rows = self .conn .execute (qiim ).fetchall ()
5757
5758
# Verify we have 6 in main
5758
5759
self .assertEqual (len (rows ), 6 )
5759
- qsiim = sql .select ([ self .shadow_instance_id_mappings ]).\
5760
- where ( self .shadow_instance_id_mappings .c .uuid .in_ (
5761
- self . uuidstrs ) )
5760
+ qsiim = sql .select (self .shadow_instance_id_mappings ). where (
5761
+ self .shadow_instance_id_mappings .c .uuid .in_ (self . uuidstrs )
5762
+ )
5762
5763
rows = self .conn .execute (qsiim ).fetchall ()
5763
5764
# Verify we have 0 in shadow
5764
5765
self .assertEqual (len (rows ), 0 )
@@ -5829,10 +5830,12 @@ def test_archive_deleted_rows_before(self):
5829
5830
where (self .instances .c .uuid .in_ (self .uuidstrs [2 :4 ]))\
5830
5831
.values (deleted = 1 , deleted_at = timeutils .utcnow ())
5831
5832
self .conn .execute (update_statement )
5832
- qiim = sql .select ([self .instances ]).where (self .
5833
- instances .c .uuid .in_ (self .uuidstrs ))
5834
- qsiim = sql .select ([self .shadow_instances ]).\
5835
- where (self .shadow_instances .c .uuid .in_ (self .uuidstrs ))
5833
+ qiim = sql .select (self .instances ).where (
5834
+ self . instances .c .uuid .in_ (self .uuidstrs )
5835
+ )
5836
+ qsiim = sql .select (self .shadow_instances ).where (
5837
+ self .shadow_instances .c .uuid .in_ (self .uuidstrs )
5838
+ )
5836
5839
5837
5840
# Verify we have 6 in main
5838
5841
rows = self .conn .execute (qiim ).fetchall ()
@@ -5923,13 +5926,15 @@ def _test_archive_deleted_rows_for_one_uuid_table(self, tablename):
5923
5926
where (main_table .c .uuid .in_ (self .uuidstrs [:4 ]))\
5924
5927
.values (deleted = 1 , deleted_at = timeutils .utcnow ())
5925
5928
self .conn .execute (update_statement )
5926
- qmt = sql .select ([main_table ]).where (main_table .c .uuid .in_ (
5927
- self .uuidstrs ))
5929
+ qmt = sql .select (main_table ).where (
5930
+ main_table .c .uuid .in_ (self .uuidstrs )
5931
+ )
5928
5932
rows = self .conn .execute (qmt ).fetchall ()
5929
5933
# Verify we have 6 in main
5930
5934
self .assertEqual (len (rows ), 6 )
5931
- qst = sql .select ([shadow_table ]).\
5932
- where (shadow_table .c .uuid .in_ (self .uuidstrs ))
5935
+ qst = sql .select (shadow_table ).where (
5936
+ shadow_table .c .uuid .in_ (self .uuidstrs )
5937
+ )
5933
5938
rows = self .conn .execute (qst ).fetchall ()
5934
5939
# Verify we have 0 in shadow
5935
5940
self .assertEqual (len (rows ), 0 )
@@ -5972,15 +5977,16 @@ def test_archive_deleted_rows_shadow_insertions_equals_deletions(self):
5972
5977
where (self .instance_id_mappings .c .uuid .in_ (self .uuidstrs [:2 ]))\
5973
5978
.values (deleted = 1 )
5974
5979
self .conn .execute (update_statement )
5975
- qiim = sql .select ([self .instance_id_mappings ]).where (self .
5976
- instance_id_mappings .c .uuid .in_ (self .uuidstrs [:2 ]))
5980
+ qiim = sql .select (self .instance_id_mappings ).where (
5981
+ self . instance_id_mappings .c .uuid .in_ (self .uuidstrs [:2 ])
5982
+ )
5977
5983
rows = self .conn .execute (qiim ).fetchall ()
5978
5984
# Verify we have 2 in main
5979
5985
self .assertEqual (len (rows ), 2 )
5980
5986
5981
- qsiim = sql .select ([ self .shadow_instance_id_mappings ]).\
5982
- where ( self .shadow_instance_id_mappings .c .uuid .in_ (
5983
- self . uuidstrs [: 2 ]) )
5987
+ qsiim = sql .select (self .shadow_instance_id_mappings ). where (
5988
+ self .shadow_instance_id_mappings .c .uuid .in_ (self . uuidstrs [: 2 ])
5989
+ )
5984
5990
shadow_rows = self .conn .execute (qsiim ).fetchall ()
5985
5991
# Verify we have 0 in shadow
5986
5992
self .assertEqual (len (shadow_rows ), 0 )
@@ -6036,22 +6042,25 @@ def test_archive_deleted_rows_2_tables(self):
6036
6042
.values (deleted = 1 , deleted_at = timeutils .utcnow ())
6037
6043
self .conn .execute (update_statement2 )
6038
6044
# Verify we have 6 in each main table
6039
- qiim = sql .select ([self .instance_id_mappings ]).where (
6040
- self .instance_id_mappings .c .uuid .in_ (self .uuidstrs ))
6045
+ qiim = sql .select (self .instance_id_mappings ).where (
6046
+ self .instance_id_mappings .c .uuid .in_ (self .uuidstrs )
6047
+ )
6041
6048
rows = self .conn .execute (qiim ).fetchall ()
6042
6049
self .assertEqual (len (rows ), 6 )
6043
- qi = sql .select ([self .instances ]).where (self .instances .c .uuid .in_ (
6044
- self .uuidstrs ))
6050
+ qi = sql .select (self .instances ).where (
6051
+ self .instances .c .uuid .in_ (self .uuidstrs )
6052
+ )
6045
6053
rows = self .conn .execute (qi ).fetchall ()
6046
6054
self .assertEqual (len (rows ), 6 )
6047
6055
# Verify we have 0 in each shadow table
6048
- qsiim = sql .select ([ self .shadow_instance_id_mappings ]).\
6049
- where ( self .shadow_instance_id_mappings .c .uuid .in_ (
6050
- self . uuidstrs ) )
6056
+ qsiim = sql .select (self .shadow_instance_id_mappings ). where (
6057
+ self .shadow_instance_id_mappings .c .uuid .in_ (self . uuidstrs )
6058
+ )
6051
6059
rows = self .conn .execute (qsiim ).fetchall ()
6052
6060
self .assertEqual (len (rows ), 0 )
6053
- qsi = sql .select ([self .shadow_instances ]).\
6054
- where (self .shadow_instances .c .uuid .in_ (self .uuidstrs ))
6061
+ qsi = sql .select (self .shadow_instances ).where (
6062
+ self .shadow_instances .c .uuid .in_ (self .uuidstrs )
6063
+ )
6055
6064
rows = self .conn .execute (qsi ).fetchall ()
6056
6065
self .assertEqual (len (rows ), 0 )
6057
6066
# Archive 7 rows, which should be 4 in one table and 3 in the other.
@@ -6112,13 +6121,15 @@ def test_archive_deleted_rows_task_log(self):
6112
6121
updated_at = timeutils .utcnow ())
6113
6122
self .conn .execute (update_statement )
6114
6123
# Verify we have 6 in main
6115
- qtl = sql .select ([self .task_log ]).where (
6116
- self .task_log .c .id .in_ (range (1 , 7 )))
6124
+ qtl = sql .select (self .task_log ).where (
6125
+ self .task_log .c .id .in_ (range (1 , 7 ))
6126
+ )
6117
6127
rows = self .conn .execute (qtl ).fetchall ()
6118
6128
self .assertEqual (len (rows ), 6 )
6119
6129
# Verify we have 0 in shadow
6120
- qstl = sql .select ([self .shadow_task_log ]).where (
6121
- self .shadow_task_log .c .id .in_ (range (1 , 7 )))
6130
+ qstl = sql .select (self .shadow_task_log ).where (
6131
+ self .shadow_task_log .c .id .in_ (range (1 , 7 ))
6132
+ )
6122
6133
rows = self .conn .execute (qstl ).fetchall ()
6123
6134
self .assertEqual (len (rows ), 0 )
6124
6135
# Make sure 'before' comparison is for < not <=
0 commit comments