HelloI think my original question was too generic so rephrasing... Is there a way in sqlalchemy to:
- Assert a ResultProxy against an expected ResultProxy (or list of RowProxies against expected list of RowProxies)
- Show any differences
I wanted to check first before writing my own script :-)
RegardsSOn Friday, 22 November 2019 10:50:54 UTC, sumau wrote:HelloI would like to assert the contents of tables in my PG schema i.e. make sure it contains the data I'm expectingI am aware of various options:1) Compare the actual and expected tables using a sql query, orchestrated by sqlalchemy (i.e. create the actual and expected tables in DB, run the sql comparison script, return the output)2) Load the actual tables as tuples and compare them with expected tuples using something like assert_result3) Load the actual tables as dataframes and compare them with expected dataframes using pandas assert_frame_equalAny recommendations / thoughts would be much appreciated, both as to the approach and the implementation :-)
--SQLAlchemy -The Python SQL Toolkit and Object Relational MapperTo post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.---You received this message because you are subscribed to the Google Groups "sqlalchemy" group.To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/0baf6b7a-69e7-4dcf-a76a-813ff7583ac0%40googlegroups.com.
for tag, i1, i2, j1, j2 in sm.get_opcodes():
if tag == 'replace':
for i in range(i1,i2):
print (seq1[i])
print (seq2[i])