diff --git a/assume/common/outputs.py b/assume/common/outputs.py index cea9045a..c4583437 100644 --- a/assume/common/outputs.py +++ b/assume/common/outputs.py @@ -357,8 +357,10 @@ async def on_stop(self): for query in queries: try: df = pd.read_sql(query, self.db) - except Exception as e: + except (OperationalError, ProgrammingError): continue + except Exception as e: + raise e dfs.append(df) diff --git a/assume/common/units_operator.py b/assume/common/units_operator.py index 5f383ffa..22a12d84 100644 --- a/assume/common/units_operator.py +++ b/assume/common/units_operator.py @@ -400,7 +400,7 @@ def write_learning_to_output(self, start: datetime, marketconfig: MarketConfig): ) or self.context.data_dict.get("output_agent_id") db_addr = self.context.data_dict.get( "learning_output_agent_addr" - ) or self.context.data_dict.get("output_agent_id") + ) or self.context.data_dict.get("output_agent_addr") if db_aid and db_addr: self.context.schedule_instant_acl_message(