@@ -83,8 +83,10 @@ def run_test_transaction(engine, schema, trans_op):
83
83
# depends on the database type and other factors)
84
84
if trans_op == 'commit' :
85
85
df_db = select_table (engine = engine , schema = schema , table_name = table_name , index_col = 'ix' )
86
- pd .testing .assert_frame_equal (df_db .sort_index (),
87
- pd .DataFrame (index = pd .Index (['bar' , 'foo' ], name = 'ix' )))
86
+ # this simple check will be enough since we do not have values, only an index
87
+ assert df_db .index .sort_values ().tolist () == ['bar' , 'foo' ]
88
+ assert df_db .index .name == 'ix'
89
+
88
90
elif trans_op == 'rollback' :
89
91
df_db = select_table (engine = engine , schema = schema , table_name = table_name , error_if_missing = False )
90
92
# no table or an empty table
@@ -117,8 +119,10 @@ async def run_test_transaction_async(engine, schema, trans_op):
117
119
# depends on the database type and other factors)
118
120
if trans_op == 'commit' :
119
121
df_db = await aselect_table (engine = engine , schema = schema , table_name = table_name , index_col = 'ix' )
120
- pd .testing .assert_frame_equal (df_db .sort_index (),
121
- pd .DataFrame (index = pd .Index (['bar' , 'foo' ], name = 'ix' )))
122
+ # this simple check will be enough since we do not have values, only an index
123
+ assert df_db .index .sort_values ().tolist () == ['bar' , 'foo' ]
124
+ assert df_db .index .name == 'ix'
125
+
122
126
elif trans_op == 'rollback' :
123
127
df_db = await aselect_table (engine = engine , schema = schema , table_name = table_name , error_if_missing = False )
124
128
# no table or an empty table
@@ -157,7 +161,9 @@ def run_test_commit_as_you_go(engine, schema):
157
161
# the table in the db should be equal to the initial df as the second
158
162
# operation was rolled back
159
163
df_db = select_table (engine = engine , schema = schema , table_name = table_name , index_col = 'ix' )
160
- pd .testing .assert_frame_equal (df_db , df )
164
+ # this simple check will be enough since we do not have values, only an index
165
+ assert df_db .index .sort_values ().tolist () == df .index .sort_values ().tolist ()
166
+ assert df_db .index .name == 'ix'
161
167
162
168
163
169
@adrop_table_between_tests (table_name = TableNames .COMMIT_AS_YOU_GO )
@@ -180,7 +186,9 @@ async def run_test_commit_as_you_go_async(engine, schema):
180
186
# the table in the db should be equal to the initial df as the second
181
187
# operation was rolled back
182
188
df_db = await aselect_table (engine = engine , schema = schema , table_name = table_name , index_col = 'ix' )
183
- pd .testing .assert_frame_equal (df_db , df )
189
+ # this simple check will be enough since we do not have values, only an index
190
+ assert df_db .index .sort_values ().tolist () == df .index .sort_values ().tolist ()
191
+ assert df_db .index .name == 'ix'
184
192
185
193
186
194
# -
0 commit comments