flux-framework / flux-accounting

bank/accounting interface for the Flux resource manager
https://flux-framework.readthedocs.io/projects/flux-accounting/en/latest/index.html
GNU Lesser General Public License v3.0
3 stars 10 forks source link

Improve.export.and.pop.db #529

Open cmoussa1 opened 5 hours ago

cmoussa1 commented 5 hours ago

Problem

The export_db_info() function statically defines the columns extracted from both the bank_table and the association_table, but there could definitely be a case where the user extracting DB information wants to customize the format of the data they are retrieving.


This PR refactors the export_db_info() function to allow customization of which fields to extract from both association_table and bank_table through optional arguments. It dynamically builds each SQLite query using these custom fields and includes which columns are being used in the header of the .csv files.

I've adjusted the populate_db() function as well as the tests for both the pop-db and export-db commands to account for the adjustments to export_db_info() - namely, skipping the headers of the .csv files and including custom formatting in the export-db calls.