HI
I have 2 nested dictionaries to compare and print their result. How can this be done ? Any thoughts ? I want to check if there are any databases and tables are missing or additonal tables are present by comparing the following 2 nested dictionaries.
expected_dbs:
‘database1’:
db_tables:
- “non-existant-table”
- “table1_db1”
- “table2_db2”
- “table3_db3”
‘database2’:
db_tables:
- “non-existant-table”
- “table1_db2”
- “table2_db2”
- “table3_db2”
‘database3’:
db_tables: - “non-existant-table”
- “table1_db3”
- “table2_db3”
- “table3_db3”
actual_dbs:
‘database1’:
db_tables:
- “table1_db1”
- “table2_db2”
- “table3_db3”
‘database2’:
db_tables:
- “table1_db2”
- “table2_db2”
- “table3_db2”
- “additional_table”
‘database3’:
db_tables:
- “table1_db3”
- “table2_db3”
I could iterate over one database at a time and then compare, but was thinking if there is any better way to do it ?