diff options
Diffstat (limited to 'python/report_ops/__main__.py')
| -rw-r--r-- | python/report_ops/__main__.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/report_ops/__main__.py b/python/report_ops/__main__.py index 94b670be..4372137a 100644 --- a/python/report_ops/__main__.py +++ b/python/report_ops/__main__.py @@ -87,9 +87,15 @@ if args.cash_reports or args.wire_reports: for custodian in custodians: get_custodian_download_fun(custodian)(args.date, fund, em=em) if args.cash_reports: - cash_report = CashReport[custodian](args.date, fund) + cash_report = CashReport[custodian] try: - cash_report.to_db() + for row in cash_report.yield_rows(args.date, fund): + cash = cash_report.from_report_line( + row | {"fund": fund, "knowledge_date": args.date} + ) + cash.stage() + cash_report.commit() + cash_report.clear() except (MissingDataError, RuntimeError) as e: logger.warning(e) if args.wire_reports: @@ -98,7 +104,8 @@ if args.cash_reports or args.wire_reports: for row in wire_report.yield_rows(args.date, fund): wire = wire_report.from_report_line(row | {"fund": fund}) wire.stage() - wire.commit() + wire_report.commit() + wire_report.clear() except (MissingDataError, RuntimeError) as e: logger.warning(e) |
