aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops')
-rw-r--r--python/report_ops/__main__.py5
-rw-r--r--python/report_ops/admin.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/python/report_ops/__main__.py b/python/report_ops/__main__.py
index 04c1b5de..796788b7 100644
--- a/python/report_ops/__main__.py
+++ b/python/report_ops/__main__.py
@@ -104,7 +104,10 @@ if args.isosel_reports:
for fund in ("ISOSEL",):
for report in ("isosel_accrued", "citco_reports"):
report = CitcoReport[report](cob, fund)
- report.to_db()
+ try:
+ report.to_db()
+ except MissingDataError as e:
+ logger.warning(e)
if args.send_to_custodians:
for account in (
diff --git a/python/report_ops/admin.py b/python/report_ops/admin.py
index 1d5079ac..f2e60e96 100644
--- a/python/report_ops/admin.py
+++ b/python/report_ops/admin.py
@@ -8,6 +8,7 @@ from serenitas.utils.remote import SftpClient
from serenitas.ops.trade_dataclasses import Fund
from serenitas.utils.db import dawn_engine, dbconn
from serenitas.analytics.dates import next_business_day
+from serenitas.analytics.exceptions import MissingDataError
from .misc import dt_from_citco
@@ -37,7 +38,9 @@ class CitcoReport:
def __post_init__(self):
self._sftp = SftpClient.from_creds("citco", folder="outgoing")
if not self.report_file_name:
- raise ValueError(f"No reports for {self.table} on {self.date}")
+ raise MissingDataError(
+ f"No reports for {self.fund}:{self.table} on {self.date}"
+ )
self.knowledge_date = datetime.datetime.combine(
next_business_day(self.date), self.dtkey_fun(self.report_file_name).time()
)